vendor.intel: fix output enable width for XDR=0 case.

Fixes #297.
This commit is contained in:
schwigi 2020-01-09 11:09:35 +01:00 committed by whitequark
parent 63902dddb7
commit 8184efd612

View file

@ -221,8 +221,9 @@ class IntelPlatform(TemplatedPlatform):
@staticmethod
def _get_oereg(m, pin):
# altiobuf_ requires an output enable signal for each pin, but pin.oe is 1 bit wide.
if pin.xdr == 0:
return pin.oe
return Repl(pin.oe, pin.width)
elif pin.xdr in (1, 2):
oe_reg = Signal(pin.width, name="{}_oe_reg".format(pin.name))
oe_reg.attrs["useioff"] = "1"
@ -283,7 +284,7 @@ class IntelPlatform(TemplatedPlatform):
p_use_oe="TRUE",
i_datain=self._get_oreg(m, pin, invert),
o_dataout=port,
i_oe=pin.oe,
i_oe=self._get_oereg(m, pin)
)
return m