From: Tobias Platen Date: Wed, 14 Apr 2021 17:34:13 +0000 (+0200) Subject: radixmmu: error handling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a642433a73ca19062a781d921346538dd1edede3;p=soc.git radixmmu: error handling --- diff --git a/src/soc/decoder/isa/radixmmu.py b/src/soc/decoder/isa/radixmmu.py index b127e6f4..22a84a3a 100644 --- a/src/soc/decoder/isa/radixmmu.py +++ b/src/soc/decoder/isa/radixmmu.py @@ -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)