inverted global write pend vector, on creation of readable signal,
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 14 May 2019 09:02:54 +0000 (10:02 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 14 May 2019 09:02:54 +0000 (10:02 +0100)
seems to work

src/experiment/cscore.py
src/scoreboard/fn_unit.py

index 3d73b3b3b8bf04d2285a413787ee1d4ff7bed1e9..0d1fc4d517de9a295161fc85238c9529f90b6c4d 100644 (file)
@@ -305,7 +305,7 @@ def scoreboard_sim(dut, alusim):
 
         yield from alusim.check(dut)
 
-    for i in range(1):
+    for i in range(20):
         src1 = randint(1, dut.n_regs-1)
         src2 = randint(1, dut.n_regs-1)
         while True:
@@ -313,12 +313,12 @@ def scoreboard_sim(dut, alusim):
             break
             if dest not in [src1, src2]:
                 break
-        src1 = 2
-        src2 = 2
-        dest = 2
+        #src1 = 2
+        #src2 = 3
+        #dest = 2 
 
         op = randint(0, 1)
-        op = 0
+        #op = 1
         print ("random %d: %d %d %d %d\n" % (i, op, src1, src2, dest))
         yield from int_instr(dut, alusim, op, src1, src2, dest)
         yield from print_reg(dut, [3,4,5])
@@ -328,7 +328,6 @@ def scoreboard_sim(dut, alusim):
             yield dut.int_insn_i[i].eq(0)
         yield
         yield
-        yield
 
 
     yield
index 26a1519413a5eb5c7ce1d78094ea57d13345c291..1e597cda4dbd44a9830639a386ad05d4bcde21fc 100644 (file)
@@ -161,7 +161,7 @@ class FnUnit(Elaboratable):
 
         # readable output signal
         g_rd = Signal(self.reg_width, reset_less=True)
-        m.d.comb += g_rd.eq(self.g_wr_pend_i & self.rd_pend_o)
+        m.d.comb += g_rd.eq((~self.g_wr_pend_i) & self.rd_pend_o)
         m.d.comb += self.readable_o.eq(g_rd.bool())
 
         # writable output signal