issueunit = IntFPIssueUnit(self.n_regs, n_int_fus, n_fp_fus)
m.submodules.issueunit = issueunit
+ # FU-FU Dependency Matrices
+ intfudeps = FUFUDepMatrix(n_int_fus, n_int_fus)
+ m.submodules.intfudeps = intfudeps
+
#---------
# ok start wiring things together...
# "now hear de word of de looord... dem bones dem bones dem dryy bones"
regdecode.src1_i.eq(self.int_src1_i),
regdecode.src2_i.eq(self.int_src2_i),
regdecode.enable_i.eq(1),
- self.issue_o.eq(issueunit.issue_o)
+ self.issue_o.eq(issueunit.issue_o),
+ issueunit.i.dest_i.eq(regdecode.dest_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
m.d.sync += if_l[1].go_rd_i.eq(intpick1.go_rd_o[1]) # subtract rd
m.d.sync += if_l[1].go_wr_i.eq(intpick1.go_wr_o[1]) # subtract wr
+ # create read-pending FU-FU vectors
+ intfu_rd_pend_v = Signal(n_int_fus, reset_less = True)
+ intfu_wr_pend_v = Signal(n_int_fus, reset_less = True)
+ for i in range(n_int_fus):
+ m.d.comb += intfu_rd_pend_v[i].eq(if_l[i].int_rd_pend_o.bool())
+ m.d.comb += intfu_wr_pend_v[i].eq(if_l[i].int_wr_pend_o.bool())
+ #m.d.comb += intfu_rd_pend_v[i].eq(if_l[i].int_readable_o)
+ #m.d.comb += intfu_wr_pend_v[i].eq(if_l[i].int_writable_o)
+
# Connect INT Fn Unit global wr/rd pending
for fu in if_l:
- m.d.comb += fu.g_int_wr_pend_i.eq(g_int_wr_pend_v.g_pend_o)
- m.d.comb += fu.g_int_rd_pend_i.eq(g_int_rd_pend_v.g_pend_o)
-
- # Connect Picker
+ m.d.comb += fu.g_int_wr_pend_i.eq(intfu_wr_pend_v)
+ m.d.comb += fu.g_int_rd_pend_i.eq(intfu_rd_pend_v)
+
+ # Connect FU-FU Matrix, NOTE: FN Units readable/writable considered
+ # to be unit "read-pending / write-pending"
+ m.d.comb += intfudeps.rd_pend_i.eq(intfu_rd_pend_v)
+ m.d.comb += intfudeps.wr_pend_i.eq(intfu_wr_pend_v)
+ m.d.sync += intfudeps.issue_i.eq(issueunit.i.fn_issue_o)
+ for i in range(n_int_fus):
+ m.d.comb += intfudeps.go_rd_i[i].eq(intpick1.go_rd_o[i])
+ m.d.comb += intfudeps.go_wr_i[i].eq(intpick1.go_wr_o[i])
+
+ # Connect Picker (note connection to FU-FU)
#---------
+ readable_o = intfudeps.readable_o
+ writable_o = intfudeps.writable_o
m.d.comb += intpick1.go_rd_i[0].eq(~if_l[0].go_rd_i)
m.d.comb += intpick1.go_rd_i[1].eq(~if_l[1].go_rd_i)
m.d.comb += intpick1.req_rel_i[0].eq(int_alus[0].req_rel_o)
m.d.comb += intpick1.req_rel_i[1].eq(int_alus[1].req_rel_o)
- m.d.comb += intpick1.readable_i[0].eq(if_l[0].int_readable_o) # add rd
- m.d.comb += intpick1.writable_i[0].eq(if_l[0].int_writable_o) # add wr
- m.d.comb += intpick1.readable_i[1].eq(if_l[1].int_readable_o) # sub rd
- m.d.comb += intpick1.writable_i[1].eq(if_l[1].int_writable_o) # sub wr
+ m.d.sync += intpick1.readable_i[0].eq(readable_o[0]) # add rd
+ m.d.sync += intpick1.writable_i[0].eq(writable_o[0]) # add wr
+ m.d.sync += intpick1.readable_i[1].eq(readable_o[1]) # sub rd
+ m.d.sync += intpick1.writable_i[1].eq(writable_o[1]) # sub wr
#---------
# Connect Register File(s)
for i, alu in enumerate(int_alus):
m.d.sync += alu.go_rd_i.eq(intpick1.go_rd_o[i])
m.d.sync += alu.go_wr_i.eq(intpick1.go_wr_o[i])
- m.d.comb += alu.issue_i.eq(fn_issue_l[i])
+ m.d.sync += alu.issue_i.eq(fn_issue_l[i])
#m.d.comb += fn_busy_l[i].eq(alu.busy_o) # XXX ignore, use fnissue
m.d.comb += alu.src1_i.eq(int_src1.data_o)
m.d.comb += alu.src2_i.eq(int_src2.data_o)
break
print ("busy",)
yield from print_reg(dut, [3,4,5])
+ yield
+ yield
+ yield
+ yield
yield
intregdeps = FURegDepMatrix(n_int_fus, self.n_regs)
m.submodules.intregdeps = intregdeps
- 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 += 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 += 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.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.sync += intfudeps.issue_i.eq(self.fn_issue_i)
m.d.sync += intfudeps.go_rd_i.eq(self.go_rd_i)
go_wr_o = intpick1.go_wr_o
go_rd_i = intfus.go_rd_i
go_wr_i = intfus.go_wr_i
- m.d.comb += go_rd_i[0:2].eq(go_rd_o[0:2]) # add rd
- m.d.comb += go_wr_i[0:2].eq(go_wr_o[0:2]) # add wr
+ m.d.sync += go_rd_i[0:2].eq(go_rd_o[0:2]) # add rd
+ m.d.sync += go_wr_i[0:2].eq(go_wr_o[0:2]) # add wr
# Connect Picker
#---------
- m.d.sync += 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.req_rel_i[0:2].eq(cu.req_rel_o[0:2])
int_readable_o = intfus.readable_o
int_writable_o = intfus.writable_o
# Connect Register File(s)
#---------
print ("intregdeps wen len", len(intfus.dest_rsel_o))
- m.d.sync += int_dest.wen.eq(intfus.dest_rsel_o)
+ m.d.comb += int_dest.wen.eq(intfus.dest_rsel_o)
m.d.comb += int_src1.ren.eq(intfus.src1_rsel_o)
m.d.comb += int_src2.ren.eq(intfus.src2_rsel_o)
if True:
instrs.append((7, 2, 6, 1))
instrs.append((3, 7, 1, 1))
- instrs.append((2, 2, 3, 1))
+ #instrs.append((2, 2, 3, 1))
for i, (src1, src2, dest, op) in enumerate(instrs):