From a642433a73ca19062a781d921346538dd1edede3 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Wed, 14 Apr 2021 19:34:13 +0200 Subject: [PATCH] radixmmu: error handling --- src/soc/decoder/isa/radixmmu.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.30.2