mirror of https://github.com/YosysHQ/yosys.git
ecp5: Sim model fixes
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
677b8ed3ca
commit
d29b517fef
|
@ -265,16 +265,18 @@ module TRELLIS_IO(
|
||||||
output O
|
output O
|
||||||
);
|
);
|
||||||
parameter DIR = "INPUT";
|
parameter DIR = "INPUT";
|
||||||
|
reg T_pd;
|
||||||
|
always @(*) if (T === 1'bz) T_pd <= 1'b0; else T_pd <= T;
|
||||||
|
|
||||||
generate
|
generate
|
||||||
if (DIR == "INPUT") begin
|
if (DIR == "INPUT") begin
|
||||||
assign B = 1'bz;
|
assign B = 1'bz;
|
||||||
assign O = B;
|
assign O = B;
|
||||||
end else if (DIR == "OUTPUT") begin
|
end else if (DIR == "OUTPUT") begin
|
||||||
assign B = T ? 1'bz : I;
|
assign B = T_pd ? 1'bz : I;
|
||||||
assign O = 1'bx;
|
assign O = 1'bx;
|
||||||
end else if (DIR == "INOUT") begin
|
end else if (DIR == "BIDIR") begin
|
||||||
assign B = T ? 1'bz : I;
|
assign B = T_pd ? 1'bz : I;
|
||||||
assign O = B;
|
assign O = B;
|
||||||
end else begin
|
end else begin
|
||||||
ERROR_UNKNOWN_IO_MODE error();
|
ERROR_UNKNOWN_IO_MODE error();
|
||||||
|
|
Loading…
Reference in New Issue