aboutsummaryrefslogtreecommitdiffstats
path: root/tests/efinix/tribuf.v
blob: 3fa6eb6c62134f5454cf90769a6b3389288a0d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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