addr.ok/1 probably x_valid_i & ~x_stall_i
addr_ok_o/1 no equivalent. *might* work using x_stall_i
- exception_o/2(?) m_load_err_o and m_store_err_o
+ exc_o/6(?) m_load_err_o and m_store_err_o
ld.data/64 m_ld_data_o
ld.ok/1 probably implicit, when x_busy drops low
self.addr = Data(addrwid, "addr_i") # addr/addr-ok
# addr is valid (TLB, L1 etc.)
self.addr_ok_o = Signal(reset_less=True)
- self.exception_o = LDSTException("exc")
+ self.exc_o = LDSTException("exc")
# LD/ST
self.ld = Data(regwid, "ld_data_o") # ok to be set by L0 Cache/Buf
inport.ld.eq(self.ld),
inport.busy_o.eq(self.busy_o),
inport.addr_ok_o.eq(self.addr_ok_o),
- inport.exception_o.eq(self.exception_o),
+ inport.exc_o.eq(self.exc_o),
inport.mmu_done.eq(self.mmu_done),
inport.ldst_error.eq(self.ldst_error),
inport.cache_paradox.eq(self.cache_paradox)
comb += st_done.r.eq(1) # store done reset
# monitor for an exception or the completion of LD.
- with m.If(self.pi.exception_o.happened):
+ with m.If(self.pi.exc_o.happened):
comb += busy_l.r.eq(1)
# however ST needs one cycle before busy is reset
else:
alus['div'] = DivPipeFunctionUnit
+ # create dictionary of Function Units
self.fus = {}
for name, qty in units.items():
kls = alus[name]
for i in range(qty):
self.fus["%s%d" % (name, i)] = kls(i)
+
+ # debug print for MMU ALU
if microwatt_mmu:
- print("cut here ==============================")
alu = self.fus["mmu0"].alu
- print("alu", alu)
- #pi = alu.pi
- #print("pi", pi)
- #pilist = [pi]
+ print("MMU alu", alu)
+
+ # if any PortInterfaces, we want LDST Units.
if pilist is None:
return
print ("pilist", pilist)
for i, pi in enumerate(pilist):
self.fus["ldst%d" % (i)] = LDSTFunctionUnit(pi, addrwid, i)
+ # extract exceptions from any FunctionUnits for easy access
+ self.excs = {}
+ for name, alu in self.fus.items():
+ if hasattr(alu, "exc_o"):
+ self.excs[name] = alu.exc_o
+
+ def get_exc(self, name):
+ return self.excs.get(name, default=None)
+
def get_fu(self, name):
return self.fus.get(name)
# v.state := MMU_LOOKUP;
# v.stage1_en := '0';
- exc = self.pi.exception_o
+ exc = self.pi.exc_o
#happened, alignment, instr_fault, invalid,
comb += exc.happened.eq(d_out.error | l_out.err)