experiment lock out of registers in read vector
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 16 May 2019 06:58:48 +0000 (07:58 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 16 May 2019 06:58:48 +0000 (07:58 +0100)
src/experiment/compalu.py
src/experiment/cscore.py
src/scoreboard/fn_unit.py

index 12e6a92f5f57166268ed3331996a8ae4ccd1b432..d03a8d2cbfdf342065b8d71b508e2bbdc1c18178 100644 (file)
@@ -53,8 +53,8 @@ class ComputationUnitNoDelay(Elaboratable):
         # outputs
         m.d.comb += self.busy_o.eq(opc_l.q) # busy out
 
-        with m.If(src_l.q & (self.counter == 0)):
-            m.d.sync += self.counter.eq(2)
+        with m.If(req_l.qn & opc_l.q & (self.counter == 0)):
+            m.d.sync += self.counter.eq(3)
         with m.If(self.counter > 0):
             m.d.sync += self.counter.eq(self.counter - 1)
         with m.If((self.counter == 1) | (self.counter == 0)):
index ae44fb72476e8ed84671e9c45a2cd6f5d370673d..bdbf8ace407ff2f5f7f5f123f8bb69dd846c23ac 100644 (file)
@@ -131,9 +131,9 @@ class Scoreboard(Elaboratable):
                      regdecode.src1_i.eq(self.int_src1_i),
                      regdecode.src2_i.eq(self.int_src2_i),
                      regdecode.enable_i.eq(1),
-                     issueunit.i.dest_i.eq(regdecode.dest_o),
                      self.issue_o.eq(issueunit.issue_o)
                     ]
+        m.d.sync += issueunit.i.dest_i.eq(regdecode.dest_o),
         self.int_insn_i = issueunit.i.insn_i # enabled by instruction decode
 
         # connect global rd/wr pending vectors
@@ -339,7 +339,7 @@ def scoreboard_sim(dut, alusim):
                 dest = 3
             else:
                 src1 = 5
-                src2 = 4
+                src2 = 3
                 dest = 7
 
             #op = (i+1) % 2
@@ -355,7 +355,6 @@ def scoreboard_sim(dut, alusim):
                 yield from print_reg(dut, [3,4,5])
                 for i in range(len(dut.int_insn_i)):
                     yield dut.int_insn_i[i].eq(0)
-                yield
                 break
             print ("busy",)
             yield from print_reg(dut, [3,4,5])
@@ -395,8 +394,8 @@ def explore_groups(dut):
 
 
 def test_scoreboard():
-    dut = Scoreboard(32, 8)
-    alusim = RegSim(32, 8)
+    dut = Scoreboard(16, 8)
+    alusim = RegSim(16, 8)
     vl = rtlil.convert(dut, ports=dut.ports())
     with open("test_scoreboard.il", "w") as f:
         f.write(vl)
index 3edabbde16eb2c2dc41eb4b5f9e8a4d508835090..fc05a9af3c198583b46ae3dc546c516a91ae9f72 100644 (file)
@@ -171,7 +171,7 @@ class FnUnit(Elaboratable):
         g_wr_v = Signal(self.reg_width, reset_less=True)
         g_wr = Signal(reset_less=True)
         wo = Signal(reset_less=True)
-        m.d.comb += g_wr_v.eq(g_pend_i & xx_pend_o)
+        m.d.comb += g_wr_v.eq(g_pend_i & xx_pend_o & self.rd_pend_o)
         m.d.comb += g_wr.eq(~g_wr_v.bool())
         m.d.comb += wo.eq(g_wr & rd_l.qn & self.req_rel_i & shadown)
         m.d.comb += writable_o.eq(wo)