mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 01:13:47 +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.
33 lines
586 B
Verilog
33 lines
586 B
Verilog
/*
|
|
* This example is a distillation of the essence of PR#993.
|
|
* Or at least the essence that led to a bug report.
|
|
*/
|
|
|
|
module main;
|
|
|
|
parameter [31:0] fifo_address = 32'hc0_00_00_00;
|
|
|
|
reg [31:0] bar;
|
|
reg flag;
|
|
wire [31:0] foo = flag? fifo_address : bar;
|
|
|
|
initial begin
|
|
bar = ~fifo_address;
|
|
|
|
flag = 1;
|
|
#1 if (foo !== fifo_address) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
|
|
flag = 0;
|
|
#1 if (foo !== bar) begin
|
|
$display("FAILED");
|
|
$finish;
|
|
end
|
|
|
|
$display("PASSED");
|
|
end // initial begin
|
|
|
|
endmodule // main
|