more code-munging
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 May 2020 21:12:37 +0000 (22:12 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 May 2020 21:12:37 +0000 (22:12 +0100)
src/soc/logical/main_stage.py

index 961b201c1d59d3c1715f24c73cb08d47112f852b..014056445e16821e52608a19240769f09324dee2 100644 (file)
@@ -49,9 +49,11 @@ class LogicalMainStage(PipeModBase):
 
             ###### cmpb #######
             with m.Case(InternalOp.OP_CMPB):
+                l = []
                 for i in range(8):
                     slc = slice(i*8, (i+1)*8)
-                    comb += o[slc].eq(Repl(a[slc] == b[slc], 8))
+                    l.append(Repl(a[slc] == b[slc], 8))
+                comb += o.eq(Cat(*l))
 
             ###### popcount #######
             with m.Case(InternalOp.OP_POPCNT):
@@ -88,8 +90,8 @@ class LogicalMainStage(PipeModBase):
             ###### parity #######
             with m.Case(InternalOp.OP_PRTY):
                 # strange instruction which XORs together the LSBs of each byte
-                par0 = Signal(8, reset_less=True)
-                par1 = Signal(8, reset_less=True)
+                par0 = Signal(reset_less=True)
+                par1 = Signal(reset_less=True)
                 comb += par0.eq(Cat(a[0] , a[8] , a[16], a[24]).xor())
                 comb += par1.eq(Cat(a[32], a[40], a[48], a[32]).xor())
                 with m.If(op.data_len[3] == 1):