move FUMemMatchMatrix to mdm module
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 10 Jun 2019 04:24:55 +0000 (05:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 10 Jun 2019 04:24:55 +0000 (05:24 +0100)
src/scoreboard/mdm.py [new file with mode: 0644]
src/scoreboard/test_mem2_fu_matrix.py

diff --git a/src/scoreboard/mdm.py b/src/scoreboard/mdm.py
new file mode 100644 (file)
index 0000000..72ac959
--- /dev/null
@@ -0,0 +1,22 @@
+from nmigen.compat.sim import run_simulation
+from nmigen.cli import verilog, rtlil
+from nmigen import Module
+
+from scoreboard.fu_reg_matrix import FURegDepMatrix
+from scoreboard.addr_match import PartialAddrMatch
+
+class FUMemMatchMatrix(FURegDepMatrix, PartialAddrMatch):
+    """ implement a FU-Regs overload with memory-address matching
+    """
+    def __init__(self, n_fu, addrbitwid):
+        PartialAddrMatch.__init__(self, n_fu, addrbitwid)
+        FURegDepMatrix.__init__(self, n_fu, n_fu, 1, self.addr_match_o)
+
+    def elaborate(self, platform):
+        m = Module()
+        PartialAddrMatch._elaborate(self, m, platform)
+        FURegDepMatrix._elaborate(self, m, platform)
+
+        return m
+
+
index de9715e54b068832acc7eebb62b9ae2e31cc680b..4679105e28519fd465477d769927e9f96fc13b71 100644 (file)
@@ -4,13 +4,11 @@ from nmigen import Module, Const, Signal, Array, Cat, Elaboratable
 
 from regfile.regfile import RegFileArray, treereduce
 from scoreboard.fu_fu_matrix import FUFUDepMatrix
-from scoreboard.fu_reg_matrix import FURegDepMatrix
 from scoreboard.global_pending import GlobalPending
 from scoreboard.group_picker import GroupPicker
 from scoreboard.issue_unit import IssueUnitGroup, IssueUnitArray, RegDecode
 from scoreboard.shadow import ShadowMatrix, BranchSpeculationRecord
-from scoreboard.addr_match import PartialAddrMatch
-
+from scoreboard.mdm import FUMemMatchMatrix
 from nmutil.latch import SRLatch
 from nmutil.nmoperator import eq
 
@@ -57,20 +55,6 @@ class MemSim:
         self.mem[addr>>self.ddepth] = data & ((1<<self.regwid)-1)
 
 
-class FUMemMatchMatrix(FURegDepMatrix, PartialAddrMatch):
-    """ implement a FU-Regs overload with memory-address matching
-    """
-    def __init__(self, n_fu, addrbitwid):
-        PartialAddrMatch.__init__(self, n_fu, addrbitwid)
-        FURegDepMatrix.__init__(self, n_fu, n_fu, 1, self.addr_match_o)
-
-    def elaborate(self, platform):
-        m = Module()
-        PartialAddrMatch._elaborate(self, m, platform)
-        FURegDepMatrix._elaborate(self, m, platform)
-
-        return m
-
 
 class MemFunctionUnits(Elaboratable):