fix exception handling in pi_ld
authorTobias Platen <tplaten@posteo.de>
Wed, 24 Nov 2021 18:50:05 +0000 (19:50 +0100)
committerTobias Platen <tplaten@posteo.de>
Wed, 24 Nov 2021 18:50:05 +0000 (19:50 +0100)
src/soc/config/test/test_pi2ls.py

index 486dc5c9c54f6c3e4446289976cfa716e1a12592..48f0e5b38c0b877d9b0dbe445ff0c5c77467b04c 100644 (file)
@@ -104,7 +104,7 @@ def pi_ld(port1, addr, datalen, msr_pr=0):
         print("print fast exception happened")
         yield port1.is_ld_i.eq(0)  # end
         yield port1.addr.ok.eq(0)  # set !ok
-        return 0, "fast"
+        return None, "fast"
 
     yield
     yield from wait_ldok(port1)             # wait until ld ok
@@ -115,10 +115,14 @@ def pi_ld(port1, addr, datalen, msr_pr=0):
     yield port1.is_ld_i.eq(0)  # end
     yield port1.addr.ok.eq(0)  # set !ok
     if exc_happened:
-        return 0, "slow"
+        return None, "slow"
 
     yield from wait_busy(port1,debug="pi_ld_E") # wait while busy
 
+    exc_happened = yield port1.exc_o.happened
+    if exc_happened:
+        return None, "slow"
+
     return data, None