mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-07 03:43:19 +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.
44 lines
619 B
Verilog
44 lines
619 B
Verilog
`celldefine
|
|
//`timescale 1ns / 1ps
|
|
|
|
// Description : 2 input XOR
|
|
|
|
module XOR20 (input A, input B, output Q);
|
|
|
|
xor (Q,B,A);
|
|
|
|
specify
|
|
(A => Q) = (1,1);
|
|
(B => Q) = (1,1);
|
|
endspecify
|
|
|
|
endmodule
|
|
|
|
`endcelldefine
|
|
|
|
module plug(input A, input B, output Q);
|
|
|
|
XOR20 U1(.A(A), .B(B), .Q(Q));
|
|
|
|
endmodule // plug
|
|
|
|
module tb;
|
|
|
|
reg a, b;
|
|
wire q;
|
|
plug dut(.A(a), .B(b), .Q(q));
|
|
|
|
initial begin
|
|
$monitor($time,, "A=%b, B=%b, Q=%b", a, b, q);
|
|
$sdf_annotate("ivltests/sdf2.sdf");
|
|
|
|
#10 ;
|
|
a = 1;
|
|
b = 1;
|
|
#10 ;
|
|
b = 0;
|
|
#10 $finish(0);
|
|
end
|
|
|
|
endmodule // tb
|