3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 12:08:19 +00:00
yosys/tests/xilinx/tribuf.v
2019-10-17 17:10:02 +02:00

30 lines
341 B
Verilog

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