add microwatt mmu config option to compunits.py
authorTobias Platen <tplaten@posteo.de>
Sun, 10 Jan 2021 13:05:03 +0000 (14:05 +0100)
committerTobias Platen <tplaten@posteo.de>
Sun, 10 Jan 2021 13:05:03 +0000 (14:05 +0100)
src/soc/experiment/memory_types.org [new file with mode: 0644]
src/soc/fu/compunits/compunits.py

diff --git a/src/soc/experiment/memory_types.org b/src/soc/experiment/memory_types.org
new file mode 100644 (file)
index 0000000..2e9aede
--- /dev/null
@@ -0,0 +1,16 @@
+* MMU
+| MMUToLoadStore1Type (l_out) | LoadStore1ToMMUType (l_in) |
+| MMUToDCacheType     (d_out) | DCacheToMMUType     (d_in) |
+| MMUToICacheType NC  (i_out) | None                       |
+
+* DCache
+| DCacheToLoadStore1Type (d_out) | LoadStore1ToDCacheType (d_in) |
+| DCacheToMMUType (m_out)        | MMUToDCacheType (m_in)        |
+| WBMasterOut (wb_out)           | WBSlaveOut (wb_in)            |
+| stall_out                      | None                          |
+
+* Loadstore1 -- microwatt only
+| Loadstore1ToMmuType (m_out)       | MmuToLoadstore1Type (m_in)          |
+| Loadstore1ToDcacheType (d_out)    | DcacheToLoadstore1Type (d_in)       |
+| Loadstore1ToWritebackType (l_out) | Execute1ToLoadstore1Type (l_in)     |
+| Loadstore1ToExecute1Type (e_out)  | None                                |
index 096cda34f4a5974ecdd9cc93c454e595765a3192..de88bffd90ad2626a8b44972c5216ae6df10b517 100644 (file)
@@ -225,7 +225,6 @@ class LDSTFunctionUnit(LDSTCompUnit):
 
 # TODO: ReservationStations-based.
 
-
 # simple one-only function unit class, for test purposes
 class AllFunctionUnits(Elaboratable):
     """AllFunctionUnits
@@ -239,7 +238,7 @@ class AllFunctionUnits(Elaboratable):
 
     """
 
-    def __init__(self, pspec, pilist=None, div_fsm=True):
+    def __init__(self, pspec, pilist=None, div_fsm=True,microwatt_mmu = True):
         addrwid = pspec.addr_wid
         units = pspec.units
         if not isinstance(units, dict):
@@ -247,8 +246,9 @@ class AllFunctionUnits(Elaboratable):
                      'spr': 1,
                      'logical': 1,
                      'mul': 1,
-                     #'mmu': 1,
                      'div': 1, 'shiftrot': 1}
+            if microwatt_mmu:
+                units['mmu'] = 1
         alus = {'alu': ALUFunctionUnit,
                 'cr': CRFunctionUnit,
                 'branch': BranchFunctionUnit,
@@ -269,6 +269,13 @@ class AllFunctionUnits(Elaboratable):
             kls = alus[name]
             for i in range(qty):
                 self.fus["%s%d" % (name, i)] = kls(i)
+        if microwatt_mmu:
+            print("cut here ==============================")
+            alu = self.fus["mmu0"].alu
+            print("alu",alu)
+            pi = alu.pi
+            print("pi",pi)
+            pilist = [pi]
         if pilist is None:
             return
         for i, pi in enumerate(pilist):