fix dependency problems caused by pypi master
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 14 Jun 2022 14:17:46 +0000 (15:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 14 Jun 2022 14:17:46 +0000 (15:17 +0100)
c4m/nmigen/jtag/tap.py
setup.py

index e0cf747150c03c45a7be16682b31422103ab75bc..f5bfd8cc676e02f0e9e53b882a41c2cac25e6bf7 100755 (executable)
@@ -568,7 +568,6 @@ class TAP(Elaboratable):
         return ioconn
 
     def _elaborate_ios(self, *, m, capture, shift, update, bd2io, bd2core):
-        length = sum(IOConn.lengths[conn._iotype] for conn in self._ios)
         # note: the starting points where each IOConn is placed into
         # the Shift Register depends *specifically* on the type (parameters)
         # of each IOConn, and therefore on all IOConn(s) that came before it
@@ -579,9 +578,13 @@ class TAP(Elaboratable):
         # IOtype, banksel, pullup *and* pulldown.
 
         # pre-compute the length of the IO shift registers needed.
-        # relies on Record.len() returning the total bit-width including
-        # all Signals
-        length = sum(len(conn) for conn in self._ios)
+        length = 0
+        for conn in self._ios:
+            length += IOConn.lengths[conn._iotype] + conn._banksel
+            if conn._pullup:
+                length += 1
+            if conn._pulldown:
+                length += 1
         if length == 0:
             return self.bus.tdi
 
@@ -604,7 +607,7 @@ class TAP(Elaboratable):
                 # now also banksel, pullup and pulldown from core are added
                 if conn._banksel != 0:
                     iol.append(conn.core.sel)
-                    idx += 1
+                    idx += conn._banksel
                 if conn._pullup:
                     iol.append(conn.core.pu)
                     idx += 1
index b57c2e4587251ef5acd8da52d0ca8f77b4631e4d..5ad599503e623457c7ab6a0f5727b938ae57b379 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,10 @@ setup(
     setup_requires=["setuptools_scm"],
 
     # removing cocotb, causing unnecessary dependency and install problems
-    install_requires=["setuptools", "nmigen", "nmigen-soc", "modgrammar"],
+    install_requires=["setuptools",
+        "nmigen>=0.0,<=0.5",
+        "nmigen-soc",
+        "modgrammar"],
 
     # unit tests require cocotb: main operation does not
     tests_require=['cocotb'],