m.submodules.wri_l = wri_l = SRLatch(sync=False, name="wri")
m.submodules.upd_l = upd_l = SRLatch(sync=False, name="upd")
m.submodules.rst_l = rst_l = SRLatch(sync=False, name="rst")
+ m.submodules.lsd_l = lsd_l = SRLatch(sync=False, name="lsd") # done
####################
# signals
comb += sto_l.s.eq(addr_ok & op_is_st)
comb += sto_l.r.eq(reset_s | p_st_go)
+ # ld/st done
+ comb += lsd_l.s.eq(issue_i)
+ sync += lsd_l.r.eq(reset_s | p_st_go | ld_ok)
+
# reset latch
comb += rst_l.s.eq(addr_ok) # start when address is ready
comb += rst_l.r.eq(issue_i)
comb += pi.data_len.eq(self.oper_i.data_len) # data_len
# address
comb += pi.addr.data.eq(addr_r) # EA from adder
- comb += pi.addr.ok.eq(alu_ok & (lod_l.q | sto_l.q)
+ comb += pi.addr.ok.eq(alu_ok & (lod_l.q | sto_l.q) & lsd_l.q
) # "do address stuff"
comb += self.addr_exc_o.eq(pi.addr_exc_o) # exception occurred
comb += addr_ok.eq(self.pi.addr_ok_o) # no exc, address fine
yield
else: # LDST CompUnit
# not a lot can be done about this - simply wait a few cycles
- for i in range(10):
+ for i in range(5):
yield
wrmask = yield cu.wrmask
yield cu.rdmaskn.eq(0)
yield
-
# debugging issue with branch
if self.funit == Function.BRANCH:
lr = yield cu.alu.pipe1.n.data_o.lr.data