The file is coded in ASCII and uses a line-oriented syntax:
define LocalChain <name> define LocalNet <name> define LocalInst <name>The built-in defaults are LocalChain=LocalChain, LocalNet=LocalNet and LocalInst=LocalInst.
Tree-buffers and inverters that are included to the top module, get an instance-name prefix from LocalInst.
Local nets that must be created in the top module, get an net-name prefix from LocalNet.
Local chain nets (created in all modules that contain a scan chain) get an net-name prefix from LocalChain.
Please note, that the name of the ports are defined in the scan-chain file by the SCN_CHAIN line. Here are some comments about additional internal naming rules:
gate inv <name>(<portkeywords>) gate and <name>(<portkeywords>) gate nand <name>(<portkeywords>) gate or <name>(<portkeywords>) gate nor <name>(<portkeywords>) gate mux <name>(<portkeywords>) gate tree_buf <name>(<portkeywords>)There are no built-in defaults. If any library component is required but not defined, then the tool prints an error message. If a nor/nand is required and not defined but or/and and inv is defined, then the tool creates a or/and - inv combination.
For all those components, the <portkeywords> define the meaning of the ports. For inv and tree_buf, the <portkeywords> are Out and In0.
For and, nand, or, and nor, the <portkeywords> are Out, In0 and In1.
For mux, the select pin means 0: Out=In0 and 1: Out=In1. The <portkeywords> are Out, In0, In1 and Select.
rule <ff_name>(<ff_ports>) -> <scanff_name>(<scanff_nets>) <polarity>The <ff_name> and <ff_ports> define an existing flipflop, that needs to be replaced by <scanff_name> and <scanff_nets>.
<ff_ports> is a list of ports. The order of this list and the name of the ports is expected to be exactly equal to the primitive definition in the verilog file. The output port must be indicated by a trailing "'" character. Consider the following example. We assume FF is a flipflop defined in Verilog as follows:
module FF(Q,D,CK,SET,CLR); input D,CK,SET,CLR; output Q; ... endmoduleFor this example you should use FF for <ff_name> and Q', D, CK, SET, CLR for <ff_ports>.
<scanff_ports> is a list of nets that connect to the scan-flipflop. The order of this list defines how the scan-flipflop must be connected. We assume SFF is a scan-flipflop defined in Verilog as follows:
module SFF(q,qb,clk,d,set,clr,tin,te); input clk,d,set,clr,tin,te; output q,qb; ... endmoduleFor this example you may want to connect Q=q, D=d, CK=clk, SET=set, CLR=clr and tin=ScanIn and te=ScanMode. Therefore, you should set <scanff_nets> to Q,,CK,D,SET,CLR,ScanIn,ScanMode. For this example, the rule command looks like:
rule FF(Q',D,CK,SET,CLR) -> SFF(Q,,CK,D,SET,CLR,ScanIn,ScanMode) ...Note:
TestEnable ScanMode ScanClock ScanIn<polarity> identifies some signals and their polarity. You can identify all or some of the signals Set, Clr, Clock and ScanOut. For example, assume:
Clock=CK, Set=!SET, Clr=CLRNote:
Clock=CK, Set=!SET, Clr=CLR, ScanOut=QNote:
# complete rule example
rule FF(Q',D,CK,SET,CLR) -> \
SFF(Q,,CK,D,SET,CLR,ScanIn,ScanMode) \
Clock=CK, Set=!SET, Clr=CLR, ScanOut=Q
Consider the following example. We assume that FF's port "CLR" is high-active but the SFF's port "clr" is low-active (the ports FF.SET and SFF.set are both low-active; the ports FF.CK and SFF.clk are both high-active). For this case you can re-write the rule:
# complete rule example including an inverter for "CLR"
rule FF(Q',D,CK,SET,CLR) -> \
SFF(Q,,CK,D,SET,-CLR,ScanIn,ScanMode) \
Clock=CK, Set=!SET, Clr=CLR, ScanOut=Q
In this case,
an additional inverter for the signal CLR is created in each SFF
# complete rule example including one global inverter for ScanMode.
rule FF(Q',D,CK,SET,CLR) -> \
SFF(Q,,CK,D,SET,CLR,ScanIn,-ScanMode) \
Clock=CK, Set=!SET, Clr=CLR, ScanOut=Q
In this case, one inverter for ScanMode and one
tree buffer (tree_buf) is created within the top-level
module. The inverted ScanMode signal (rather than the
non-inverted ScanMode) is routed to the scan-flipflop.
Please note, that the scanmaker's repair activities may require additional signals (TestEnable and ScanClock) non-inverted or inverted (suffix "_n" for "not"). Because all global signals are only inverted once (in the top level module) the signals TestEnable, TestEnable_n, ScanMode, ScanMode_n, ScanClock and ScanClock_n are routed through all hierarchy levels to the repair modules (scan-flipflops and other repaired cells). These global signals are only routed if required.
To define flipflops/latches/tree-state-buffers without scan counterparts, add null-rules like in the following example:
# complete null-rule for the flipflop FF
rule0 FF(Q',D,CK,SET,CLR) \
Clock=CK, Set=SET, Clr=CLR
# complete null-rule for the latch DL
rule0 DL(Q',D,EN,SET,CLR) \
Enable=!EN, Set=!SET, Clr=!CLR
The mapfile must not include a "rule" and a "rule0" for the
same cell. The most important part of the null-rules are the
identification of the Clock/Enable, Set and
Clr port and the definition of their polarities.
SAFE clt.rx.c6.tdxi_df CLK clt.rx.c1.tdxi_df ... SCN clt.rx.c6.tdxi_dfVery often, but not always, you can directly map those reported lines to scanmaker commands by removing the last component of the instance-paths (that dives into the silicon-level library cell). You may/will run into problems, if the reported instances dive into complex silicon-level cells. e.g. If the silicon-level cell contains more than one tdx_dff1 or tdx_dlatch then the silicon-level cell's Set, Clr or Clock signals are not directly connected to the Set, Clr or Clock pins of the tdx simulator primitive (inverters are harmless).
Be aware of this problem when creating a command file from the tdx_step's output and also when you map the scanmaker's scan-out output file back into the simulator's world.