From: Luke Kenneth Casson Leighton Date: Sat, 4 Dec 2021 12:54:22 +0000 (+0000) Subject: fix pi_st which should not be trying to wait for the address X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0417cd320cb4e25fe6366b290df96313f64b5eed;p=soc.git fix pi_st which should not be trying to wait for the address when an exception occurs. TODO: fix wait_addr so that it exits if an exception occurs --- diff --git a/src/soc/config/test/test_pi2ls.py b/src/soc/config/test/test_pi2ls.py index 1009d6f1..c3545af1 100644 --- a/src/soc/config/test/test_pi2ls.py +++ b/src/soc/config/test/test_pi2ls.py @@ -57,8 +57,34 @@ def pi_st(port1, addr, data, datalen, msr_pr=0, is_dcbz=0): yield port1.addr.data.eq(addr) # set address yield port1.addr.ok.eq(1) # set ok yield Settle() + + # must check exception even before waiting for address. + # 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 + 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 + + # yield # not needed, just for checking # yield # not needed, just for checking # assert "ST" for one cycle (required by the API)