Archived
1
0

testbench dump

This commit is contained in:
Erick
2022-03-01 23:35:40 +01:00
parent 0646b73f9a
commit 001b7886d6
10 changed files with 77 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
include "predefined/and16.v"
module and_tb();
reg ta,tb;
wire ty;
and_gate dut(y, ta, tb);
initial begin
ta = 0'b16;
tb = 0'b16;
i=0
for(i<=15, i=i+1)
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta = ta+1;
tb = tb+1;
end
endmodule
+1 -1
View File
@@ -1,4 +1,4 @@
include "and_gate.v"
include "predefined/and_gate.v"
module and_tb();
reg ta,tb;
@@ -1,3 +1,5 @@
include "predefined/demux.v"
module demux_tb();
reg a,b, sel;
output y;
@@ -1,4 +1,4 @@
include "mux.v"
include "predefined/mux.v"
module mux_tb();
reg a,b, sel;
+1 -1
View File
@@ -1,4 +1,4 @@
include "nand_gate.v"
include "predefined/nand_gate.v"
module nand_tb();
reg ta,tb;
+18
View File
@@ -0,0 +1,18 @@
include "predefined/nor_gate.v"
module nor_tb();
reg ta, tb;
wire ty;
nor_gate dut(y, ta, tb);
initial begin
ta=0, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=0, tb=1;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=1;
end
endmodule
+1 -1
View File
@@ -1,4 +1,4 @@
include "not_gate.v"
include "predefined/not_gate.v"
module not_tb();
reg ta;
+1 -1
View File
@@ -1,4 +1,4 @@
include "or_gate.v"
include "predefined/or_gate.v"
module or_tb();
reg ta, tb;
+18
View File
@@ -0,0 +1,18 @@
include "predefined/xnor_gate.v"
module xnor_tb();
reg ta, tb;
wire ty;
xnor_gate dut(y, ta, tb);
initial begin
ta=0, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=0, tb=1;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=1;
end
endmodule
+18
View File
@@ -0,0 +1,18 @@
include "predefined/nor_gate.v"
module nor_tb();
reg ta, tb;
wire ty;
nor_gate dut(y, ta, tb);
initial begin
ta=0, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=0, tb=1;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=0;
$monitor("IN: %b, %b ",ta, tb, "OUT: ",y);
ta=1, tb=1;
end
endmodule