Remove useless variables in _Steerer, ensure command array has 4 elements
authorJean THOMAS <git0@pub.jeanthomas.me>
Wed, 8 Jul 2020 12:51:34 +0000 (14:51 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Wed, 8 Jul 2020 12:51:34 +0000 (14:51 +0200)
gram/core/multiplexer.py

index fa521fd555bd294d37fe26529861200c409ccfb4..b813b807f8c7ba2e7cc6d96c90650e8afc8e1924 100644 (file)
@@ -143,11 +143,10 @@ class _Steerer(Elaboratable):
     """
 
     def __init__(self, commands, dfi):
+        assert len(commands) == 4
         self._commands = commands
         self._dfi = dfi
-        ncmd = len(commands)
-        nph = len(dfi.phases)
-        self.sel = [Signal(range(ncmd)) for i in range(nph)]
+        self.sel = [Signal(range(len(commands))) for i in range(len(dfi.phases))]
 
     def elaborate(self, platform):
         m = Module()