m = Module()
m.submodules.l = l = SRLatch(sync=False) # async latch
+ # record current version of q in a sync'd register
+ cq = Signal() # resets to 0
+ m.d.sync += cq.eq(l.q)
+
# reset on go HI, set on dest and issue
- m.d.comb += dest_l.s.eq(self.issue_i & self.reg_i)
- m.d.comb += dest_l.r.eq(self.go_i)
+ m.d.comb += l.s.eq(self.issue_i & self.reg_i)
+ m.d.comb += l.r.eq(self.go_i)
- # FU "Forward Progress" (read out horizontally)
- m.d.sync += self.fwdl_o.eq(l.q & self.reg_i)
+ # Function Unit "Forward Progress".
+ m.d.comb += self.fwd_o.eq((cq | l.q) & self.reg_i)
- # Register File Select (read out vertically)
- m.d.comb += self.rselo.eq(l.q & self.go_i)
+ # Register Select. Activated on go read/write and *current* latch set
+ m.d.comb += self.rsel_o.eq(cq & self.go_i)
return m
m.d.comb += src2_l.s.eq(self.issue_i & self.src2_i)
m.d.comb += src2_l.r.eq(self.go_rd_i)
- # FU "Forward Progress" (read out horizontally)
+ # FU "Forward Progress" (read out vertically)
m.d.comb += self.dest_fwd_o.eq(dest_l.q & self.dest_i)
m.d.comb += self.src1_fwd_o.eq(src1_l.q & self.src1_i)
m.d.comb += self.src2_fwd_o.eq(src2_l.q & self.src2_i)
- # Register File Select (read out vertically)
+ # Register File Select (read out horizontally)
m.d.sync += self.dest_rsel_o.eq(dest_l.q & ~self.go_wr_i)
m.d.sync += self.src1_rsel_o.eq(src1_l.q & ~self.go_rd_i)
m.d.sync += self.src2_rsel_o.eq(src2_l.q & ~self.go_rd_i)