aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ice40/tribuf_tb.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ice40/tribuf_tb.v')
-rw-r--r--tests/ice40/tribuf_tb.v34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ice40/tribuf_tb.v b/tests/ice40/tribuf_tb.v
new file mode 100644
index 000000000..16871b7b2
--- /dev/null
+++ b/tests/ice40/tribuf_tb.v
@@ -0,0 +1,34 @@
+module testbench;
+ reg en;
+
+ initial begin
+ // $dumpfile("testbench.vcd");
+ // $dumpvars(0, testbench);
+
+ #5 en = 0;
+ repeat (10000) begin
+ #5 en = 1;
+ #5 en = 0;
+ end
+
+ $display("OKAY");
+ end
+
+
+ reg dinA = 0;
+ wire doutB;
+
+ top uut (
+ .en (en ),
+ .a (dinA ),
+ .b (doutB )
+ );
+
+ always @(posedge en) begin
+ #3;
+ dinA <= !dinA;
+ end
+
+ assert_tri b_test(.en(en), .A(dinA), .B(doutB));
+
+endmodule