intregdeps = FURegDepMatrix(n_int_fus, self.n_regs)
m.submodules.intregdeps = intregdeps
- m.d.sync += self.g_int_rd_pend_o.eq(intregdeps.rd_pend_o)
- m.d.sync += self.g_int_wr_pend_o.eq(intregdeps.wr_pend_o)
+ m.d.comb += self.g_int_rd_pend_o.eq(intregdeps.rd_pend_o)
+ m.d.comb += self.g_int_wr_pend_o.eq(intregdeps.wr_pend_o)
- m.d.sync += intfudeps.rd_pend_i.eq(self.g_int_rd_pend_o)
- m.d.sync += intfudeps.wr_pend_i.eq(self.g_int_wr_pend_o)
+ m.d.comb += intfudeps.rd_pend_i.eq(self.g_int_rd_pend_o)
+ m.d.comb += intfudeps.wr_pend_i.eq(self.g_int_wr_pend_o)
- m.d.sync += intfudeps.issue_i.eq(self.fn_issue_i)
- m.d.sync += intfudeps.go_rd_i.eq(self.go_rd_i)
- m.d.sync += intfudeps.go_wr_i.eq(self.go_wr_i)
+ m.d.comb += intfudeps.issue_i.eq(self.fn_issue_i)
+ m.d.comb += intfudeps.go_rd_i.eq(self.go_rd_i)
+ m.d.comb += intfudeps.go_wr_i.eq(self.go_wr_i)
m.d.comb += self.readable_o.eq(intfudeps.readable_o)
m.d.comb += self.writable_o.eq(intfudeps.writable_o)
# Connect Picker
#---------
- m.d.comb += intpick1.go_rd_i[0:2].eq(~go_rd_i[0:2])
+ #m.d.comb += intpick1.go_rd_i[0:2].eq(~go_rd_i[0:2])
+ m.d.comb += intpick1.go_rd_i[0:2].eq(cu.req_rel_o[0:2])
m.d.comb += intpick1.req_rel_i[0:2].eq(cu.req_rel_o[0:2])
int_readable_o = intfus.readable_o
int_writable_o = intfus.writable_o
yield dut.int_store_i.eq(0)
for i in range(1, dut.n_regs):
- yield dut.intregs.regs[i].reg.eq(i*2)
- alusim.setval(i, i*2)
+ yield dut.intregs.regs[i].reg.eq(4+i*2)
+ alusim.setval(i, 4+i*2)
yield
instrs.append((5, 3, 3, 1))
if True:
- instrs.append((7, 2, 6, 1))
+ instrs.append((1, 1, 2, 0))
instrs.append((3, 7, 1, 1))
#instrs.append((2, 2, 3, 1))
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_scoreboard6600.il", "w") as f:
f.write(vl)
src2_rsel = []
for rn in range(self.n_reg_col):
rsv = regrsv[rn]
+ dest_rsel_o = []
+ src1_rsel_o = []
+ src2_rsel_o = []
+ for fu in range(self.n_fu_row):
+ dc = dm[fu]
+ # accumulate cell reg-select outputs dest/src1/src2
+ dest_rsel_o.append(dc.dest_rsel_o[rn])
+ src1_rsel_o.append(dc.src1_rsel_o[rn])
+ src2_rsel_o.append(dc.src2_rsel_o[rn])
# connect cell reg-select outputs to Reg Vector In
- m.d.comb += [rsv.dest_rsel_i.eq(dc.dest_rsel_o),
- rsv.src1_rsel_i.eq(dc.src1_rsel_o),
- rsv.src2_rsel_i.eq(dc.src2_rsel_o),
+ m.d.comb += [rsv.dest_rsel_i.eq(Cat(*dest_rsel_o)),
+ rsv.src1_rsel_i.eq(Cat(*src1_rsel_o)),
+ rsv.src2_rsel_i.eq(Cat(*src2_rsel_o)),
]
# accumulate Reg-Sel Vector outputs
dest_rsel.append(rsv.dest_rsel_o)
self.wid = wid
# inputs
self.i = Signal(wid, reset_less=True)
- self.o = Signal(wid, reset_less=True)
+ self.o = Signal(wid, reset_less=True)
def elaborate(self, platform):
m = Module()
m.d.comb += t.eq(self.i[i])
else:
m.d.comb += t.eq(~Cat(ni[i], *self.i[:i]).bool())
-
+
# we like Cat(*xxx). turn lists into concatenated bits
m.d.comb += self.o.eq(Cat(*res))
def __iter__(self):
yield self.i
yield self.o
-
+
def ports(self):
return list(self)
yield self.req_rel_i
yield self.go_rd_o
yield self.go_wr_o
-
+
def ports(self):
return list(self)