Files
iverilog/ivtest/ivltests/string_events.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

44 lines
681 B
Verilog

module test();
string str;
always @(str) begin
$display("str = %s", str);
end
task automatic test_task(input integer delay, input string str1, input string str2);
string str;
fork
begin
@(str) $display("str%0d = %s", delay, str);
@(str) $display("str%0d = %s", delay, str);
end
begin
#delay;
#2 str = str1;
#2 str = str1;
#2 str = str2;
end
join
endtask
initial begin
#1 str = "hello";
#1 str = "hello";
#1 str = "world";
fork
test_task(1, "hello1", "world1");
test_task(2, "hello2", "world2");
join
fork
test_task(1, "world1", "hello1");
test_task(2, "world2", "hello2");
join
#1 $finish(0);
end
endmodule