mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 16:29:25 +02:00
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.
30 lines
540 B
Verilog
30 lines
540 B
Verilog
// This test program shows how programs can be instantiated
|
|
// within another module.
|
|
|
|
program test(input [7:0] sh1, input [7:0] sh2);
|
|
|
|
final begin
|
|
if (sh1 !== 'h55) begin
|
|
$display("FAILED -- shared=%b is not correct", sh1);
|
|
$finish;
|
|
end
|
|
|
|
if (sh2 !== 'haa) begin
|
|
$display("FAILED -- sh2 not correct", sh2);
|
|
$finish;
|
|
end
|
|
|
|
$display("PASSED");
|
|
end
|
|
|
|
endprogram :test
|
|
|
|
module main;
|
|
|
|
reg[7:0] shared = 'h55;
|
|
wire [7:0] not_shared = ~shared;
|
|
|
|
test check(shared, not_shared);
|
|
|
|
endmodule // main
|