# 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)):
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
dest = 3
else:
src1 = 5
- src2 = 4
+ src2 = 3
dest = 7
#op = (i+1) % 2
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])
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)
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)