Generating Asic Test Vectors With Verilog
Generating Asic Test Vectors With Verilog
Clifford E. Cummings
Compiling a design verification test suite is a non-trivi- Generation of test vectors with relative timing is gener-
a1 task. Creating that test suite to satisfy an ASIC vendor ally well understood by most users of the Verilog language.
can be even more diSJicurt.An awareness of existing Verilog This is perhaps the most commonly taught stimulus genera-
HDL capabilities may assist design engineers in the cre- tion method in Verilog classes.
ation of ASIC test vectors to satis& ASIC-vendor vector This method employs one or more initial procedural
requirements. This paper outlines simple Verilog tech- blocks with sequential lists of constant-delay vectors sur-
niques which demonstrate Verilog’spower not only for de- rounded by begin - end key words.
scribing hardware, but for creating ASIC test vectors.
3. Test vectors with absolute timing
63
0-8186-5455-7194 $03.000 1994 IEEE
4. Print-on-change value comparison”[l 1. The Verilog $fstrobe command can
be executed at two separate, but fixed intervals to generate
Some ASIC Vendors require hard copy ”Print-On- both of these files.
Change” output, for specific tests[4]. The sequence of commands in Figure8 (starting at label
The Verilog $monitor command provides a ”Print-On- L) call functions and tasks to create the ”Strobed-Input”
Change” output, while the $fmonitor command will send file. ‘The code starts by calling the OpenFile function from
”Print-Onxhange” output to an ASCII tile. Figure9 (label N) to open a file called ”input.vec”, uses the
The code in Figures 8-10 (starting at label J) becomes predefined, ASIC-vendor specific header from the
Printf-header task, case lYPE=O (label 0), to print the
active whenever +define+tekasic is added to the Verilog
vector-column header, calls the Printf-vector, case
command line.
The sequence of commands in Figure 8 (starting at label TYPE=O (Figure 10 - label Q) task to strobe the input state
K) create the ”Print-On-Change” file. The code starts by
at time 0, then uses a forever ... Printf-vector call to strobe
calling the OpenFile function from Figure 9 (label N) to the ASIC input state at fixed intervals #(‘cycle) (every
open a file called ”change.vec”, uses the predefined,
-
lOOns in this example, Figure 5 label A) to the ”in-
ASIC-vendor specific header from the Printf-header put.vec” vector file.
task, case TYPE=l (label 0), to print the vector-column
header, then monitors the ASIC I/O signals to produce an The ”input.vec” output for multiple writes to the sample
AS IC-style ”Print-On-Change” file. ASIC are shown below in Figure 3.
The ”change.vec” output for multiple writes to the sam-
ple ASIC are shown below in Figure 2.
AAAAAAAAAAAAAAADDDDDDDDADR
AAAAAAAAAAAAAAADDDDDDDDADR CCCCCCCCCDDDDDDAAAALUASS-
CCCCCCCCCDDDDDDAAAAAAAASS_ QQQQQQQQQDDDDDDTTTTTTTT W
QQQQQQQQQDDDDDDTTTTTTTT W RRRRRRAAAALUA N
RRRRRRAAAAAAAA N DDDDDDDDCBBBBBBBBBBBBBB
DDDDDDDDCBBBBBBBBBBBBBB MAAAAAAIJ-
A A A A A A A A L W - TTTTTTTTKSSSSSSSSSSSSSS
TTTTTTTTKSSSSSSSSSSSSSS AAAAAAAA
AAAAAAAA 76543210 54321076543210
76543210 54321076543210 Ons oooooooooxxxxxxxxxxxxxxxxx
Ons OOOOOOOOOxxxxxxxxxxxxxxxxx 10Ons 00000000010000000000001010
50ns 00000000110000000000001000 20011s 00000001010000000000010010
lOOns 00000000010000000000001010 300ns 00000010022222222222222111
12511s OOOOOOOOOzzzzzzzzzzzzzzlll 400ns 0000001102z222222222222111
150x1s 00000000110000000000010000 50Ons 0000010002222222z222222111
200x1s 00000001010000000000010010 ...
...
Figure 3. “input.vec” file
Figure 2. “change.vec” file
64
The ”io.vec” output for multiple writes to the ASIC are 6. Conclusions
shown below in Figure 4.
A single language for behavioral modeling, circuit de-
sign, behavioral testing, ASIC test vector generation, de-
AkAAAAAAAAAAAAADDDDDDDDADR
sign debug, as well as synthesis of FPGAs, ASICs and
CCCCCCCCCDDDDDDAAAAAAAASS_
board designs is highly desirable, and the ability to use a
QQQQQQQQQDDDDDDTTTTTTTT W
common syntax for all of these activities promotes tool-
~- RRRRRRAAAAAAkA N usage expertise. Instead of using and forgetting new vector
DDDDDDDDCBBBBBBBBBBBBBB generation languages or vendor-dependent waveform
AAAAAAAALUtTUUUUlTUUUUUUU stimulus-sketching tools during the development process,
TTTTTTTTKSSSSSSSSSSSSSS design engineers could master a single language; thereby
AAAAAAAA developing greater efficiency and productivity with the
76543210 54321076543210 chosen tool set. Verilog HDI, is just such a language.
99ns 00000000110000000000001000
199ns 00000000110000000000010000 7. References
29911s 00000001122222222222222111
399ns 00000010122222222222222111
[ l ] L. Saunders and Y. Trivedi, ”Beyond Modeling...,”
499x1s 000000111222zz222222zzz111
ASIC & EDA, September 1993, pp. 28-33.
599ns 0000010012222222222z2zz111
. . . [2] W. R. Huttel, ”MTV (Macro Test Vector) Processor
Definition,” Technical Report No. 4, Computer Aided
Figure 4. “io.vec” file
Test Group, CAE Systems Division, Tektronix, Inc.,
January 21,1988.
131 D. McKinney, ”VGP, A language to aid in the creation
Once the ASIC file vector generation code is complete, and documentation of test vectors,” Advance Devel-
multiple tasks to define complex series of signal transitions opment Group Instrument Division, July 20, 1988.
can be written, to allow efficient, simple, easy to under-
stand test cases (Figure 6 - labels G, H & I, and Figure 5 - [ 41 ”MacroMatrix Design Manual, Volume 11”, Applied
label B). Micro Circuits Corporation, 1990, Section 4:Simula-
While these vector generation tasks are being executed, tion Rules, Vector Submission Rules and Guidelines.
if the +define+tekasic Verilog command switch is in-
[5] C.E. Cummings, ”Synthesizing ASIC Vectors with
voked, a binary pattem of 1’s and 0’s will automatically be
Verilog”, International Cadence User Group Confer-
written to three separate files: the ”Print-On-Change”,
ence Proceedings, August 1993, pp. SD22-SD30.
”Strobed-Input” and ”Strobed-I/O” files. Whenever the
+define+tekasic switch is not used, simulation runs faster
by ignoring the file I/O operations.
/I This File: acqasic.v
‘timescale 1ns / 1ns
‘define cycle 100 Global clock cycle definition I
‘define STOP-ACQ wr-reg(8’hO)
‘define RESET-ALL w r-reg(8’h 1)
‘define START-ACQ wr_reg(8’h2) Test command name definitions
‘define ACQUIRE.-DATA-CYCLE B(posedge acq-clk)
‘define READ-ACQ-MEMO RY rd-mem
module test;
reg [7:0] acq-data, datareg, i;
reg [5:0] addrbus;
reg acq-clk, as, ds, r-wn;
Figure 5. File: acqasic.v - Test Code: Test Definitions
wire [7:0] databus = (r-wn ? 8’bz : datareg );
65
always begin @ I/ acq-data triangle wave input
endtask
Figure 6. File: acqasic.v (cont.) - Test Code: Register Write
endmodule
and Acquisition Memory Read Tasks
66
// DATA ACQUISITION ASIC
module acqasic(acq-data, acq-clk, addrbus, databus, as, ds, r-wn);
input [7:0] acq-data; /I external acquisition data
input acq-clk; /I free-running ext acquisition clk
input [5:0] addrbus; // lxxxxx reg / Oxxxxx acqmem
inout [7:0] databus; // Processor data bus
input as, ds, r.-wn; I/ addr strb, data strb, rd(H)/wr(L)
reg [31:O] fanout, pipe; N acquisition fanout and pipe regs
reg [31:O] acqmem [0:7]; /I slower acquisition RAM
reg [3:0] fo-clk; N fanout clk (johnson counter)
integer memaddr; /I acquisition RAM addr
reg reset, acqen; N Reset and Acquisition Enable FF‘s
reg [3:0] addr-.reg; /I ASIC Address register
wire rdRAM;
reg [31 :O] ramdata; /I temporary readback register
reg [7:0] muxdata; /I sliced readback register
67
always Q(negedge as) begin // Latch Address
addr-reg = addrbus;
end
assign rdRAM = (!addrbus[5] && !as && r-wn); // Read RAM Qualifier
assign databus = (rdRAM ? muxdata : 8’bz); // Bi-Dir Data Bus
Figure 8. File: acqasic.v (cont.) - Data Acquisition ASIC Behavioral Model (cont.)
and ASIC Vector File Code
68
@I I
~~
69
task Printf-vector; @I // Print ASIC vectors I
input [31:O] MCD; // 32-bit Multi-Channel Descriptor
input [31:O] TYPE;
case (TYPE)
0: begin // Print input vector
$fstrobe(MCD,””/ot”,$time,,
acq_data[7], acq_data[6], acq_data[5], acq_data[4],
acq_data[3], acq_data[2], acq-data[ 11, acq-data[O],
acq-clk,
addrbus[5], addrbus[4], addrbus[3],
addrbus[2], addrbus[l 1, addrbus[O],
databus[7], databus[6], databus[5], databus[4],
databus[3], databus[2], databus[l], databus[O],
as, ds, r-wn);
end
1: begin // Print VO vector
$fstrobe(MCD,”%t”,$time,,
acq_data[7], acq_data[6], acq_data[5], acq_data[4],
acq_data[3], acq_data[2], acq-data[ 11, acq-data[O], vector list is identical to
acq-c Ik, case 0 vector list because
addrbus[5], addrbus[4], addrbus[3], there are no dedicated
addrbus[2], addrbus[l], addrbus[O], output pins on this ASIC.
databus[7], databus[6], databus[5], databus[4], Typically these lists are
databus[3], databus[2], databus[l], databus[O],
as, ds, r-wn);
end
default: begin
$display(”lnvalid Printf-vector TYPE - %d”, TYPE);
$finish;
end
endcase
endtask
‘endif
endmodule
Figure 10. File: acqasic.v (cont.) - ASIC Vector File Code (cont.)
70