mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 08:25:32 +02:00
cb_data.obj must be set to a valid handle when requesting vpiScaledRealTime. Check the returned time value as well as the actual callback time. Zero the requested cb_data after registering the callbacks to make sure it is not used during the callback execution.
36 lines
502 B
Verilog
36 lines
502 B
Verilog
`timescale 1s/1ms
|
|
|
|
module dut;
|
|
|
|
reg [7:0] a, b;
|
|
|
|
endmodule
|
|
|
|
`timescale 1ms/1ms
|
|
|
|
module test;
|
|
|
|
dut dut();
|
|
|
|
initial begin
|
|
dut.a = 0; dut.b = 0;
|
|
$monitor_time_slot(2.0, dut.a, dut.b);
|
|
$monitor_time_slot(5.0, dut.a, dut.b);
|
|
#1000;
|
|
dut.a = 1; dut.b <= 1;
|
|
#1000;
|
|
dut.a = 2; dut.b <= 2;
|
|
#1000;
|
|
dut.a = 3; dut.b <= 3;
|
|
#1000;
|
|
dut.a = 4; dut.b <= 4;
|
|
#1000;
|
|
dut.a = 5; dut.b <= 5;
|
|
#1000;
|
|
dut.a = 6; dut.b <= 6;
|
|
#1000;
|
|
$finish(0);
|
|
end
|
|
|
|
endmodule
|