aboutsummaryrefslogtreecommitdiffstats
path: root/tests/efinix/tribuf.v
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-10-04 12:20:49 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-10-04 12:20:49 +0200
commitef417fb1b3555a3075bcd01cb7c5267f3e55b407 (patch)
tree80813ffc49a6a645cb28224af9359ebfe12634a5 /tests/efinix/tribuf.v
parent2ed2e9c3e8f2d9d6882588857c8556a6e2af57ea (diff)
parenteb750670e3835a1bad36cb604e04bf4836cc7f91 (diff)
downloadyosys-ef417fb1b3555a3075bcd01cb7c5267f3e55b407.tar.gz
yosys-ef417fb1b3555a3075bcd01cb7c5267f3e55b407.tar.bz2
yosys-ef417fb1b3555a3075bcd01cb7c5267f3e55b407.zip
Merge branch 'SergeyDegtyar/efinix' of https://github.com/SergeyDegtyar/yosys into mmicko/efinix
Diffstat (limited to 'tests/efinix/tribuf.v')
-rw-r--r--tests/efinix/tribuf.v29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/efinix/tribuf.v b/tests/efinix/tribuf.v
new file mode 100644
index 000000000..3fa6eb6c6
--- /dev/null
+++ b/tests/efinix/tribuf.v
@@ -0,0 +1,29 @@
+module tristate (en, i, o);
+ input en;
+ input i;
+ output reg o;
+`ifndef BUG
+
+ always @(en or i)
+ o <= (en)? i : 1'bZ;
+`else
+
+ always @(en or i)
+ o <= (en)? ~i : 1'bZ;
+`endif
+endmodule
+
+
+module top (
+input en,
+input a,
+output b
+);
+
+tristate u_tri (
+ .en (en ),
+ .i (a ),
+ .o (b )
+ );
+
+endmodule