STIL中的Scan数据和WGl中的数据是不一样的。
WGL中的数据是基于scan cell的;
STIL中的Scan数据是基于ATE中的cycle的,对ATE来说,相对比较友好。
SignalGroups {
ABUS = ’A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7’;
BBUS = ’B0 + B1 + B2 + B3 + B4 + B5 + B6 + B7’;
ALL = ’DIR + OE_ + ABUS + BBUS’;
SI1 = ’A0’ { ScanIn 30; } //scanin pin, scan chain的长度是30
SI2 = ’A1’ { ScanIn 34; }
SO1 = ’B0’ { ScanOut 30; } //scanout pin, scan chain的长度是34
SO2 = ’B1’ { ScanOut 34; }
MASTER= ’A6’;
SLAVE = ’A7’;
}
Timing {
WaveformTable one {
Period ’500ns’;
Waveforms {
DIR { 10 { ’0ns’ U/D; }}
OE_ { 10 { ’0ns’ U; ’200ns’ U/D; ’300ns’ U; }}
ABUS { 10 { ’10ns’ U/D; }}
BBUS { 10 { ’10ns’ U/D; }}
ABUS {HLZX { ’0ns’ Z;’0ns’ X; ’260ns’ H/L/T/X;’280ns’ X;}}
BBUS {HLZX { ’0ns’ Z;’0ns’ X; ’260ns’ H/L/T/X;’280ns’ X;}}
}
} // end WaveformTable one
WaveformTable two {
Period ’100ns’;
Waveforms {
ALL { 10 { ’0ns’ U/D; }}
ALL { HLZX{ ’0ns’ Z; ’50ns’ H/L/T/X; }}
MASTER{ P { ’0ns’ D; ’10ns’ U; ’40ns’ D; }}
SLAVE { P { ’0ns’ D; ’60ns’ U; ’90ns’ D; }}
}
} // end WaveformTable two
}
MacroDefs { //定义一个Macro,在Pattern中会使用到,这里的MacoDefs没有起名字,所有是全局的
“scan” {
W two; //using timing two
// set MASTER=P, SLAVE=P, etc for next vector
// When SI1 and SI2 need to be pre-padded to normalize all chains to the same length, 0 is used.
// When SO1 and SO2 need to be post-padded during scan length normalization, X’s are used
// C means Condition,就是说,在执行它下面紧接着的vector的时候,MASTER必须是P,SLAVE必须是P...
C { MASTER=P; SLAVE=P; SI1=0; SI2=0; SO1=X; SO2=X; }
//shift start,Shift和Loop比较相似。只不过它的Loop次数是由Scan chain的长度决定。
//#的意思是她的内容会被传入的参数替换掉
Shift { V { SI1=#; SI2=#; SO1=#; SO2=#; } }
W one; //using timing one
C { MASTER=0; SLAVE=0;} // set MASTER=0, SLAVE=0 for next vector
}
} // end MacroDefs
Procedures {//定义一个Procedures,在Pattern中会使用到,这里的Procedures没有起名字,所有是全局的
“scan” {
//The procedure must first define all signals and the current WaveformTable,
// since nothing is assumed from the calling environment (the environment may be different for each call of the procedure).
// This is the major difference between procedures and macros.
W two;
V { ALL=0011ZZZZZZXXXXXXXX; } // define all signals
//because there not have Condition statement, so we must explicitly defined as P for MASTER and SLAVE
// The pad event for scan signals is the last defined WaveformChar from the previous vector (“1” for inputs, “X” for outputs).
Shift { V { MASTER=P; SLAVE=P; SI1=#;SI2=#;SO1=#;SO2=#;}}
// Remember that upon return from a procedure call, the environment before the procedure invocation is reinstated
// so there don't need reset MASTER and SLAVE like in MacroDefs
}
} // end procedures
Pattern “scan” {
W one;
V { ALL=00ZZZZZZZZXXXXXXXX; } // define all signals
Macro “scan” { //call Macro scan
SI1=000000000000000000000000000000;
SI2=1111111111111111111111111111111111;
//SO1=X 这是上一行SO1的状态
//SO2=X 这是上一行SO2的状态
//scan in的padding是从左边开始的;scan out的padding是从右边的
//SI1=0000000000000000000000000000000000; 最前面的四个0是padding
//SI2=1111111111111111111111111111111111;
//SO1=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; 使用上一行的WFC来pading
//SO2=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
}
// 尽管macro中的最后一句话是C { MASTER=0; SLAVE=0;},但是下面的V的优先级更高,
// 所以MASTER=P, SLAVE=0;
// 在macro执行结束之后,它对各个pin的设置会被保留下来,
// 所以SI1=0, SI2=1, SO1=X, SO2=X
V { MASTER=P; OE_=1; B0=H; }
Call “scan” {
SO1=LLLLLLLLLLLLLLLLLLLLLLLLLLLLLL;
// 因为SO1的scan china是30;SO2的scan chain长度是34,
// 但这里给的期望比较的数据长度只有10,所以max(30,10)=30
// 最后我们需要shift 的数据长度是30,对应SO2我们需要进行padding
SO2=\l10 HHHHHHHHHH; //\l用来指定后面比较的次数,10
// so we have below padding,
//SI1=111111111111111111111111111111;
//SI2=111111111111111111111111111111;
//SO1=LLLLLLLLLLLLLLLLLLLLLLLLLLLLLL; 这里的顺序是从左到右的,第一个L先被shift进入scan chain
//SO2=HHHHHHHHHHXXXXXXXXXXXXXXXXXXXX; 这里的顺序是从左到右的,第一个H先被比较
}
// restore the timing and state for pins after Procedures call
// timing is one, MASTER=P, SLAVE=0, SI1=0, SI2=1, SO1=X, SO2=X
}
需要注意的一点的是,Shift数据长度有可能大于scan chain的长度。
例如:
A skewed load test refers to applying an extra MASTER clock after loading a scan chain. This will shift the
contents of the SLAVE latches into the next MASTER latches, potentially skewing the contents of individual
shift register latch’s MASTER/SLAVE pairs
unload_skewedload {
W scan;
C{ all=100 001 00 XX 0000 XXXX; }
Shift {
V{si1=#; si2=#; so1=#; so2=#;} #消耗掉10个
}
V{MASTER=0; SLAVE=1; si1=#; si2=#; so1=X; so2=X;} #消耗掉地11个
} // unload_skewedload
Call unload_skewedload {
si1=\l11 11100101010; 这里scan chain的长度是10,传入的数据长度是11
si2=\l11 01101100111;
}
还有一种情况就是给scan chain传入数据的时候,同时shift out数据。这样可以节省一些时间。
unload_load {
W scan;
C{ all=100 001 00 XX 0000 XXXX; }
Shift {
V{si1=#; si2=#; so1=#; so2=#;}
}
} // unload_load
Call unload_load {
so1=HLHLHLHLHL;
so2=HLHHHHHLLL;
si1=0010010011;
si2=0100010011;
}
当然STIL也可以表示Scan chain的具体信息,但是因为它对生产ATE的pattern没有帮助,所有如果你是往ATE的pattern转换的话,可以不需要关注。
它主要是用来在ATE的测试项fail之后,反向的往设计那边找问题的时候,才需要看的东西。
ScanStructure中的scan chain数据和WGL中的scan 信息基本一样,只是格式不一样而已。