From 34a97b27512a208101619b8c6f4434bef97e1808 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 4 Aug 2019 00:30:50 +0000 Subject: [PATCH] vendor.lattice_ice40: avoid routing conflicts with SDR/DDR input pins. --- nmigen/vendor/lattice_ice40.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nmigen/vendor/lattice_ice40.py b/nmigen/vendor/lattice_ice40.py index 6f1021a..3ab0747 100644 --- a/nmigen/vendor/lattice_ice40.py +++ b/nmigen/vendor/lattice_ice40.py @@ -244,11 +244,15 @@ class LatticeICE40Platform(TemplatedPlatform): ] if "i" not in pin.dir: - i_type = 0b00 # PIN_NO_INPUT aka PIN_INPUT_REGISTERED + # If no input pin is requested, it is important to use a non-registered input pin + # type, because an output-only pin would not have an input clock, and if its input + # is configured as registered, this would prevent a co-located input-capable pin + # from using an input clock. + i_type = 0b01 # PIN_INPUT elif pin.xdr == 0: i_type = 0b01 # PIN_INPUT elif pin.xdr > 0: - i_type = 0b00 # PIN_INPUT_REGISTERED + i_type = 0b00 # PIN_INPUT_REGISTERED aka PIN_INPUT_DDR if "o" not in pin.dir: o_type = 0b0000 # PIN_NO_OUTPUT elif pin.xdr == 0 and pin.dir == "o": -- 2.30.2