#!/usr/local/bin/perl
# trace_scan_chain.pl A script to extract scan chains from netlists
#
# By Jeff Winston http://www.kwcpa.com/tools
# Rev. 1.0, 6/4/04 Copyright (C) 2004
#
# ---------------------------------------------------------------------
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# #of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# #along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA. or check out http://www.gnu.org/copyleft/gpl.html
# ---------------------------------------------------------------------
# for a thorough description, type trace_scan_chain.pl with no parameters
$| = 1; # enable autoflush
# user editable definitions - see the help description for details
# place and route tools add _ and numbers to the end of clock names when
# building clock trees. Trace_Scan_Chain needs to know which numerical suffixes
# are valid. The user must supply a list of clock names that end in numbers.
@clock_names_ending_in_numbers = ("clock_90","clock_150","clock_180");
# the below are all library specific. The defaults are for Artisan
# valid names of output pins of devices found on scan chain
@valid_output_pins = (".Y",".PAD",".Q",".QN",".P",".S",".Z");
# valid names of clock pins for flops
@flop_clock_pins = (".CK",".CKN");
# valid names of clock pins for latches
@non_flop_clock_pins = (".G");
# valid names of scan input pins for flops
@pure_chain_input_pins = (".SI");
# valid names of input pins for lockdown latches
@valid_lockdown_input_pins = (".D");
# valid names of inputs pins for logic elements found on scan chains
@valid_logic_input_pins = (".A");
# valid names of other inputs pins of elements found on scan chains
@other_chain_input_pins = (".P",".PAD");
if ($#ARGV != 2) {
print "Usage: trace_scan_chain.pl