vendor.lattice_ice40: avoid routing conflicts with SDR/DDR input pins.
authorwhitequark <whitequark@whitequark.org>
Sun, 4 Aug 2019 00:30:50 +0000 (00:30 +0000)
committerwhitequark <whitequark@whitequark.org>
Sun, 4 Aug 2019 00:30:50 +0000 (00:30 +0000)
nmigen/vendor/lattice_ice40.py

index 6f1021ab13eaa3dc03b86b0d266d0fb26ef6e641..3ab0747b1bd7cac65038a1a251cc40cde541821e 100644 (file)
@@ -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":