add reconfigureable Load/Store class
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 26 Jun 2020 10:36:34 +0000 (11:36 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 26 Jun 2020 10:36:34 +0000 (11:36 +0100)
src/soc/config/loadstore.py [new file with mode: 0644]

diff --git a/src/soc/config/loadstore.py b/src/soc/config/loadstore.py
new file mode 100644 (file)
index 0000000..8291276
--- /dev/null
@@ -0,0 +1,20 @@
+"""ConfigureableLoadStoreUnit
+
+allows the type of LoadStoreUnit to be run-time selectable
+
+"""
+from soc.experiment.pimem import TestMemoryLoadStoreUnit
+from soc.minerva.units.loadstore import BareLoadStoreUnit, CacheLoadStoreUnit
+
+
+class ConfigureableLoadStoreUnit:
+    def __init__(self, pspec):
+        lsidict = {'testmem': TestMemoryLoadStoreUnit,
+                   'bare_wb': BareLoadStoreUnit,
+                   'cache_wb': CacheLoadStoreUnit # TODO dcache parameters
+                  }
+        lsikls = lsidict[pspec.ldst_ifacetype]
+        self.lsi = lsikls(addr_wid=pspec.addr_wid,
+                          mask_wid=pspec.mask_wid, # cache line range
+                          data_wid=pspec.reg_wid)
+