FunctionUnitBaseMulti which derives from ReservationStations2
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Dec 2021 13:41:21 +0000 (13:41 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Dec 2021 13:41:21 +0000 (13:41 +0000)
*requires* the muxid to be set for each RS.  these can be set
combinatorially no problem, to indicate to ReservationStations2 where
to route the data after it pops out the end of the "real" ALU
without these muxids being set everything is royally screwed

src/soc/fu/compunits/compunits.py
src/soc/simple/test/test_core.py

index 8c48a13dec870dfe9c306a311f8017f429b2dd85..03c28c426e88635001976f8616da250b81b1c261 100644 (file)
@@ -169,8 +169,17 @@ class FunctionUnitBaseMulti(ReservationStations2):
             palu = self.pseudoalus[idx]
             cu = MultiCompUnit(regspec, palu, opsubset, name=alu_name)
             cu.fnunit = self.fnunit
+            cu.fu_muxidx = idx
             self.cu.append(cu)
 
+    def elaborate(self, platform):
+        m = super().elaborate(platform)
+        # set the muxids so that ReservationStations2 can direct data
+        # without this the incoming data gets routed to the wrong place!
+        # NOTE: for Mask Cancellation this has to be done slightly differently
+        for i, p in enumerate(self.p):
+            m.d.comb += p.i_data.muxid.eq(i)
+        return m
 
 ######################################################################
 ###### actual Function Units: these are "single" stage pipelines #####
index ee8581e9a2d1feacd81d42618c49cf57365b6cc5..83f741e9d170d3801e68453886bc63e9a465ce04 100644 (file)
@@ -213,10 +213,10 @@ class TestRunner(FHDLTestCase):
         comb = m.d.comb
         instruction = Signal(32)
 
-        units = {'alu': 1, 'cr': 1, 'branch': 1, 'trap': 1,
+        units = {'alu': 3, 'cr': 1, 'branch': 1, 'trap': 1,
                  'spr': 1,
                  'logical': 1,
-                 'mul': 1,
+                 'mul': 3,
                  'div': 1, 'shiftrot': 1}
 
         pspec = TestMemPspec(ldst_ifacetype='testpi',