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

42 lines
685 B
Verilog

/*
* This is derived from PR#938 in the test suite.
*/
`timescale 1ns/100ps
module test;
wire out;
reg A, B, select;
prim_mux2 mux (out, B, A, select);
reg [3:0] cnt;
initial begin
$display("A B S out");
for (cnt = 0 ; cnt <= 'b0111 ; cnt = cnt + 1) begin
A <= cnt[0];
B <= cnt[1];
select <= cnt[2];
#1 $display("%b %b %b --> %b", A, B, select, out);
end
end
endmodule
primitive prim_mux2( output out, input in1, input in0, input select);
table
//in1 in0 select : out
0 0 1 : 0;
1 1 ? : 1;
0 ? 1 : 0;
1 ? 1 : 1;
? 0 0 : 0;
? 1 0 : 1;
endtable
endprimitive