add function unit picker vector
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 May 2019 06:28:29 +0000 (07:28 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 May 2019 06:28:29 +0000 (07:28 +0100)
src/scoreboard/fu_picker_vec.py [new file with mode: 0644]
src/scoreboard/fu_reg_matrix.py

diff --git a/src/scoreboard/fu_picker_vec.py b/src/scoreboard/fu_picker_vec.py
new file mode 100644 (file)
index 0000000..fd44c45
--- /dev/null
@@ -0,0 +1,21 @@
+from nmigen import Elaboratable, Module, Signal, Cat
+
+
+class FU_Pick_Vec(Elaboratable):
+    """ these are allocated per-FU (horizontally),
+        and are of length fu_row_n
+    """
+    def __init__(self, fu_row_n):
+        self.fu_row_n = fu_row_n
+        self.rd_pend_i = Signal(fu_row_n, reset_less=True)
+        self.wr_pend_i = Signal(fu_row_n, reset_less=True)
+
+        self.readable_o = Signal(reset_less=True)
+        self.writable_o = Signal(reset_less=True)
+
+    def elaborate(self, platform):
+        m = Module()
+        m.d.comb += self.readable_o.eq(self.rd_pend_i.bool())
+        m.d.comb += self.writable_o.eq(self.wr_pend_i.bool())
+        return m
+
index efec9d6a3cbde0e94258e87edd6d722a5fff1f5d..c21cf34e76ff0d2c8f429df4e445c001bd6b42d5 100644 (file)
@@ -159,7 +159,7 @@ class FURegDepMatrix(Elaboratable):
                         ]
 
         # ---
-        # connect Dependency Matrix go_read_i/go_write_i to module gr/gw
+        # connect Dependency Matrix go_read_i/go_write_i to module go_rd/go_wr
         # ---
         for fu in range(self.n_fu_row):
             fup = fupend[fu]