|
发表于 2004-3-19 02:51:50
|
显示全部楼层
关于testbench 的初级问题
module test_bench();
//testing signal generator, generating input signals to
//your circuit under test
sig_gen_prototype sig_gen(...);
//circuit under test
your_module cut(...);
//verification module, to verify the simulation results, basically it
//compares cut results with some goden model results (could be PLI)
verifier_prototype verify(....);
//monitor module, the purpose of this module is to make sure the timing
//and transition of each signal is valid or consist with your
//specification, much like assert() macro in C, can use OVL
monitor_prototype mon(...);
//other stuff
//initialization
initial begin
//initialize your rams, roms, etc.
end
//simulation control
initial begin
//generating reset signal
....
//generating clock signal
....
//stop
repeat(# of cycles you want to simulate)
@(posedge clk);
$stop;
end
endmodule |
|