add optional LDSTFunctionUnit to compunits
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Jun 2020 20:22:04 +0000 (21:22 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Jun 2020 20:22:04 +0000 (21:22 +0100)
src/soc/fu/compunits/compunits.py

index 6b082d4ed697c78758959c7246ac972b5baec9da..1ffe7d8de4a9d0fd49a7693ef181719ad7197bc3 100644 (file)
@@ -156,16 +156,20 @@ class AllFunctionUnits(Elaboratable):
      * type of FU required
 
     """
-    def __init__(self):
+    def __init__(self, pi=None):
         self.fus = {}
         for (name, qty, kls) in (('alu', 1, ALUFunctionUnit),
                                  ('cr', 1, CRFunctionUnit),
                                  ('branch', 1, BranchFunctionUnit),
                                  ('logical', 1, LogicalFunctionUnit),
-                                 ('shiftrot', 1, ShiftRotFunctionUnit)
+                                 ('shiftrot', 1, ShiftRotFunctionUnit),
                                 ):
             for i in range(qty):
                 self.fus["%s%d" % (name, i)] = kls()
+        if pi is None:
+            return
+        for i in enumerate(pi):
+            self.fus["ldst%d" % (i)] = LDSTFunctionUnit(pi[i])
 
     def elaborate(self, platform):
         m = Module()