# INT/FP Issue Unit
regdecode = RegDecode(self.n_regs)
m.submodules.regdecode = regdecode
- aluissue = IssueUnitGroup(n_intfus)
+ aluissue = IssueUnitGroup(4)
brissue = IssueUnitGroup(1)
issueunit = IssueUnitArray([aluissue, brissue])
m.submodules.issueunit = issueunit
seed(0)
- for i in range(1):
+ for i in range(20):
# set random values in the registers
for i in range(1, dut.n_regs):
# create some instructions (some random, some regression tests)
instrs = []
+ if True:
+ instrs = create_random_ops(dut, 10, True, 3)
+
if False:
- instrs = create_random_ops(dut, 10, True, 4)
+ instrs.append( (4, 3, 5, 1, (0, 0)) )
+ instrs.append( (5, 2, 3, 4, (0, 0)) )
- if True:
+ if False:
instrs.append((2, 3, 3, 0, (0, 0)))
- instrs.append((5, 4, 4, 1, (0, 0)))
+ instrs.append((5, 3, 3, 1, (0, 0)))
+ instrs.append((3, 5, 5, 2, (0, 0)))
+ instrs.append((5, 3, 3, 3, (0, 0)))
+ instrs.append((3, 5, 5, 0, (0, 0)))
if False:
instrs.append((5, 6, 2, 1))
# temporaries
allissue = Signal(self.n_insns, reset_less=True)
- all1 = Const(-1, self.n_insns)
m.d.comb += allissue.eq(Repl(self.insn_i, self.n_insns))
# Pick one (and only one) of the units to proceed in this cycle
m.d.comb += pick.i.eq(~self.busy_i & allissue)
# "Safe to issue" condition is basically when all units are not busy
- m.d.comb += self.busy_o.eq((self.busy_i == all1))
+ m.d.comb += self.busy_o.eq(~((~self.busy_i).bool()))
# Picker only raises one signal, therefore it's also the fn_issue
- m.d.comb += self.fn_issue_o.eq(pick.o)
+ m.d.comb += self.fn_issue_o.eq(pick.o & Repl(~self.busy_o, self.n_insns))
return m
fn_issue_o = []
for u in self.units:
busy_i.append(u.busy_i)
- g_issue_o.append(~u.busy_o)
+ g_issue_o.append(u.busy_o)
fn_issue_o.append(u.fn_issue_o)
- m.d.comb += self.issue_o.eq(Cat(*g_issue_o).bool())
+ m.d.comb += self.issue_o.eq(~(Cat(*g_issue_o).bool()))
m.d.comb += self.fn_issue_o.eq(Cat(*fn_issue_o))
m.d.comb += Cat(*busy_i).eq(self.busy_i)