allow MultiCompUnit outputs to be Records, to capture Data.ok
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 30 May 2020 18:39:11 +0000 (19:39 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 30 May 2020 18:39:11 +0000 (19:39 +0100)
src/soc/experiment/compalu_multi.py

index a8374f750e550702b7d924d27a301363498a75c4..9518a3f076e771e780ce39524651e7e36bd61696 100644 (file)
@@ -233,8 +233,12 @@ class MultiCompUnit(RegSpecALUAPI, Elaboratable):
         drl = []
         for i in range(self.n_dst):
             name = "data_r%d" % i
-            data_r = Signal(self.cu._get_dstwid(i), name=name, reset_less=True)
-            latchregister(m, self.get_out(i), data_r, alu_pulsem, name + "_l")
+            lro = self.get_out(i)
+            if isinstance(lro, Record):
+                data_r = Record.like(lro, name=name)
+            else:
+                data_r = Signal.like(lro, name=name, reset_less=True)
+            latchregister(m, lro, data_r, alu_pulsem, name + "_l")
             drl.append(data_r)
 
         # pass the operation to the ALU