From 8184efd61215c575848fd51c60977f405a17ea36 Mon Sep 17 00:00:00 2001 From: schwigi <48810576+schwigi@users.noreply.github.com> Date: Thu, 9 Jan 2020 11:09:35 +0100 Subject: [PATCH] vendor.intel: fix output enable width for XDR=0 case. Fixes #297. --- nmigen/vendor/intel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nmigen/vendor/intel.py b/nmigen/vendor/intel.py index bc6e9b4..7ff366d 100644 --- a/nmigen/vendor/intel.py +++ b/nmigen/vendor/intel.py @@ -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 -- 2.30.2