Files
iverilog/ivtest/ivltests/sv_queue2.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

46 lines
850 B
Verilog

module main;
string words [$];
int nums [$];
initial begin
words.push_back("Hello");
words.push_back("World");
nums.push_back(1);
nums.push_back(2);
nums.push_front(0);
foreach (words[widx]) begin
case (widx)
0: if (words[widx] != "Hello") begin
$display("FAILED -- words[%0d] == %s", widx, words[widx]);
$finish;
end
1: if (words[widx] != "World") begin
$display("FAILED -- words[%0d] == %s", widx, words[widx]);
$finish;
end
default:
begin
$display("FAILED -- widx = %0d", widx);
$finish;
end
endcase
end
foreach (nums[nidx]) begin
if (nidx !== nums[nidx]) begin
$display("FAILED -- nums[%0d] == %0d", nidx, nums[nidx]);
$finish;
end
end
$display("PASSED");
end
endmodule // main