1 Compilation
Compile:
-f <filename>
Specifies a file that contains a list of pathnames to source files
and compile-time options.
-F <filename>
Same as the -f option but allows you to specify a path to the file
and the source files listed in the file do not have to be absolute
pathnames.
-R
Run the executable file immediately after VCS links together the
executable file. You can add any runtime option to the vcs command
line.
# vcs -R -gui -f Intro_Top.vcs
# vim Intro_Top.vcs
./TestBench.v
./Intro_Top.v
./AndOr.v
./SR.v
./XorNor.v
然后DVE会自动打开,并自动加载相应的内容,如图:
然后设置setup
然后在wave window窗口选择simulator菜单,并点击start/continue 或按下F5,如下图,波形就出来了,要刚好显示完整波形,按下F键。
2 user tips
initial
begin
`include "../Extras.inc"
//
// Each '#' precedes a delay time, here in 1 ns units:
//
i = -6'd2;
j = 4'd31;
k = -4'd15;
l = -4'd16;
$display("..................%d, %d, %d, %d", i, j, k, l); // print log
#1 Astim = 1'b0; // For Astim, 1 bit, representing a binary 0.
end // No semicolon after end.
always
#50 Astim = ~Astim; // clock simulation
initial
#1000 $finish; // Terminates simulation.
show schematic
supply1 vdd; // correspond to vdd in the below picture
supply0 GND; // correspond to vdd in the below picture
pmos p1 (vdd, p2n, A); // a CMOS inverter
nmos n1 (p2n, GND, A); // a CMOS inverter
assign W = p2n;
nmos n1 (drain, source, gate);
pmos p1 (drain, source, gate);
and A1 (out, in1, in2, in3); // nand, or, nor, xor, xnor is the same as and
bufif1 B1 (out, in, ctrl); // bufif0, notif1, notif0 is the same as bufif1 (三态门)
buf B1 (out1, out2, ..., in); // not is the same (多输出门)