radixmmu: error handling
authorTobias Platen <tplaten@posteo.de>
Wed, 14 Apr 2021 17:34:13 +0000 (19:34 +0200)
committerTobias Platen <tplaten@posteo.de>
Wed, 14 Apr 2021 17:34:13 +0000 (19:34 +0200)
src/soc/decoder/isa/radixmmu.py

index b127e6f424c5b6fd29e087912a4127d73e422380..22a84a3a8f3eab22f798bfb4326567cec71bfdc9 100644 (file)
@@ -296,6 +296,10 @@ class RADIX:
 
         pte = self._walk_tree(addr, pgbase, mode, mbits, shift, priv)
 
+        if type(pte)==str:
+            print("error on load",pte)
+            return 0
+
         # use pte to load from phys address
         return self.mem.ld(pte.value, width, swap, check_in_mem)
 
@@ -462,6 +466,11 @@ class RADIX:
         print("pgbase",pgbase)
         #assert(pgbase.value==0x30000)
 
+        if type(addr) == str:
+            return addr
+        if type(shift) == str:
+            return shift
+
         addrsh = addrshift(addr,shift)
         print("addrsh",addrsh)