From 114e2b8d0558b0f333a79df637bf32bf60c401d9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 16 Apr 2021 01:04:07 +0100 Subject: [PATCH] call addrshift and get_pgtable_addr inside while loop for radixmmu --- src/soc/decoder/isa/radixmmu.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/soc/decoder/isa/radixmmu.py b/src/soc/decoder/isa/radixmmu.py index 6fafc63a..71c658d7 100644 --- a/src/soc/decoder/isa/radixmmu.py +++ b/src/soc/decoder/isa/radixmmu.py @@ -464,14 +464,20 @@ class RADIX: if isinstance(shift, str): return shift - addrsh = addrshift(addr, shift) - print("addrsh",addrsh) - - addr_next = self._get_pgtable_addr(mask_size, pgbase, addrsh) - print("DONE addr_next", addr_next) + mask = mask_size # walk tree while True: + addrsh = addrshift(addr, shift) + print("addrsh",addrsh) + + print("calling _get_pgtable_addr") + print(mask) #SelectableInt(value=0x9, bits=4) + print(pgbase) #SelectableInt(value=0x40000, bits=56) + print(shift) #SelectableInt(value=0x4, bits=16) #FIXME + addr_next = self._get_pgtable_addr(mask, pgbase, addrsh) + print("DONE addr_next", addr_next) + print("nextlevel----------------------------") # read an entry swap = False @@ -495,20 +501,12 @@ class RADIX: return ok # return the error code else: newlookup = self._new_lookup(data, shift) - if type(newlookup) == str: + if isinstance(newlookup, str): return newlookup shift, mask, pgbase = newlookup print (" next level", shift, mask, pgbase) - shift = SelectableInt(shift.value,16) #THIS is wrong !!! - print("calling _get_pgtable_addr") - print(mask) #SelectableInt(value=0x9, bits=4) - print(pgbase) #SelectableInt(value=0x40000, bits=56) - print(shift) #SelectableInt(value=0x4, bits=16) #FIXME + shift = SelectableInt(shift.value, 16) # THIS is wrong !!! pgbase = SelectableInt(pgbase.value, 64) - addrsh = addrshift(addr,shift) - addr_next = self._get_pgtable_addr(mask, pgbase, addrsh) - print("addr_next",addr_next) - print("addrsh",addrsh) def _get_pgbase(self, data): """ -- 2.30.2