# XXX TODO: wait_addr should check for exception
exc_info = yield from get_exception_info(port1.exc_o)
exc_happened = exc_info.happened
- dar_o = yield port1.dar_o
if exc_happened:
print("print fast ST exception happened")
yield # MUST wait for one clock cycle before de-asserting these
yield port1.is_st_i.eq(0) # end
yield port1.addr.ok.eq(0) # set !ok
yield port1.is_dcbz_i.eq(0) # reset dcbz too
- return "fast", exc_info, dar_o
+ return "fast", exc_info
yield from wait_addr(port1) # wait until addr ok
exc_info = yield from get_exception_info(port1.exc_o)
exc_happened = exc_info.happened
- dar_o = yield port1.dar_o
if exc_happened:
print("print fast ST exception happened")
yield # MUST wait for one clock cycle before de-asserting these
yield port1.is_st_i.eq(0) # end
yield port1.addr.ok.eq(0) # set !ok
yield port1.is_dcbz_i.eq(0) # reset dcbz too
- return "fast", exc_info, dar_o
+ return "fast", exc_info
# yield # not needed, just for checking
yield
yield port1.st.ok.eq(0)
exc_info = yield from get_exception_info(port1.exc_o)
- dar_o = yield port1.dar_o
exc_happened = exc_info.happened
if exc_happened:
print("print fast ST exception happened")
yield port1.is_st_i.eq(0) # end
yield port1.addr.ok.eq(0) # set !ok
yield port1.is_dcbz_i.eq(0) # reset dcbz too
- return "fast", exc_info, dar_o
+ return "fast", exc_info
yield from wait_busy(port1,debug="pi_st_E") # wait while busy
exc_info = yield from get_exception_info(port1.exc_o)
- dar_o = yield port1.dar_o
exc_happened = exc_info.happened
if exc_happened:
yield # needed if mmu/dache is used
yield port1.addr.ok.eq(0) # set !ok
yield port1.is_dcbz_i.eq(0) # reset dcbz too
yield # needed if mmu/dache is used
- return "slow", exc_info, dar_o
+ return "slow", exc_info
# can go straight to reset.
yield port1.is_st_i.eq(0) # end
yield port1.is_dcbz_i.eq(0) # reset dcbz too
yield # needed if mmu/dache is used
- return None, None, None
+ return None, None
def get_exception_info(exc_o):
attrs = []
yield Settle()
yield from wait_addr(port1) # wait until addr ok
exc_info = yield from get_exception_info(port1.exc_o)
- dar_o = yield port1.dar_o
exc_happened = exc_info.happened
if exc_happened:
print("print fast LD exception happened")
yield # MUST wait for one clock cycle before de-asserting these
yield port1.is_ld_i.eq(0) # end
yield port1.addr.ok.eq(0) # set !ok
- return None, "fast", exc_info, dar_o
+ return None, "fast", exc_info
yield
yield from wait_ldok(port1) # wait until ld ok
data = yield port1.ld.data
exc_info = yield from get_exception_info(port1.exc_o)
- dar_o = yield port1.dar_o
exc_happened = yield port1.exc_o.happened
exc_happened = exc_info.happened
yield port1.is_ld_i.eq(0) # end
yield port1.addr.ok.eq(0) # set !ok
if exc_happened:
- return None, "slow", exc_info, dar_o
+ return None, "slow", exc_info
yield from wait_busy(port1, debug="pi_ld_E") # wait while busy
exc_info = yield from get_exception_info(port1.exc_o)
- dar_o = yield port1.dar_o
exc_happened = exc_info.happened
if exc_happened:
- return None, "slow", exc_info, dar_o
+ return None, "slow", exc_info
- return data, None, None, None
+ return data, None, None
def pi_ldst(arg, dut, msr_pr=0):
# addr is valid (TLB, L1 etc.)
self.addr_ok_o = Signal(reset_less=True)
self.exc_o = LDSTException("exc")
- self.dar_o = Signal(64, reset_less=True)
# LD/ST
self.ld = Data(regwid, "ld_data_o") # ok to be set by L0 Cache/Buf
inport.busy_o.eq(self.busy_o),
inport.addr_ok_o.eq(self.addr_ok_o),
inport.exc_o.eq(self.exc_o),
- inport.dar_o.eq(self.dar_o),
inport.mmu_done.eq(self.mmu_done),
inport.ldst_error.eq(self.ldst_error),
inport.cache_paradox.eq(self.cache_paradox)
print("=== test invalid ===")
addr = 0
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
print("ld_data", ld_data, exctype, exc)
assert (exctype == "slow")
invalid = exc.invalid
yield from pi_st(pi, addr, data, 8, msr_pr=1)
yield
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
assert ld_data == 0xf553b658ba7e1f51
assert exctype is None
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
assert ld_data == 0xf553b658ba7e1f51
assert exctype is None
print("done_dcbz ===============")
yield
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
print("ld_data after dcbz")
print(ld_data)
assert ld_data == 0
if test_exceptions:
print("=== alignment error (ld) ===")
addr = 0xFF100e0FF
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
if exc:
alignment = exc.alignment
happened = exc.happened
print("=== alignment error (st) ===")
addr = 0xFF100e0FF
- exctype, exc, _ = yield from pi_st(pi, addr,0, 8, msr_pr=1)
+ exctype, exc = yield from pi_st(pi, addr,0, 8, msr_pr=1)
if exc:
alignment = exc.alignment
happened = exc.happened
if True:
print("=== no alignment error (ld) ===")
addr = 0x100e0
- ld_data, exctype, exc, _ = yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
print("ld_data", ld_data, exctype, exc)
if exc:
alignment = exc.alignment
for addr in addrs:
print("== RANDOM addr ==",hex(addr))
- ld_data, exctype, exc, _ = \
- yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
print("ld_data[RANDOM]",ld_data,exc,addr)
assert (exctype == None)
# readback written data and compare
for addr in addrs:
print("== RANDOM addr ==",hex(addr))
- ld_data, exctype, exc, _ = \
- yield from pi_ld(pi, addr, 8, msr_pr=1)
+ ld_data, exctype, exc = yield from pi_ld(pi, addr, 8, msr_pr=1)
print("ld_data[RANDOM_READBACK]",ld_data,exc,addr)
assert (exctype == None)
assert (ld_data == 0xFF*addr)