return retval
+
+# see qemu/target/ppc/mmu-radix64.c for reference
+class RADIX:
+ def __init__(self, mem, caller):
+ self.mem = mem
+ self.caller = caller
+
+ def ld(self, address, width=8, swap=True, check_in_mem=False):
+ print("RADIX: ld from addr 0x{:x} width {:d}".format(address, width))
+
+ pte = self._walk_tree()
+ # use pte to caclculate phys address
+ #mem.ld(address,width,swap,check_in_mem)
+
+ # TODO implement
+ # def st(self, addr, v, width=8, swap=True):
+ # def memassign(self, addr, sz, val):
+ def _next_level(self):
+ return True
+ ## DSISR_R_BADCONFIG
+ ## read_entry
+ ## DSISR_NOPTE
+ ## Prepare for next iteration
+
+ def _walk_tree(self):
+ # walk tree starts on prtbl
+ while True:
+ ret = self._next_level()
+ if ret: return ret
+
class Mem:
def __init__(self, row_bytes=8, initial_mem=None):
--- /dev/null
+from nmigen import Module, Signal
+#from nmigen.back.pysim import Simulator, Delay, Settle
+from nmutil.formaltest import FHDLTestCase
+#import unittest
+from soc.decoder.isa.caller import ISACaller
+from soc.decoder.power_decoder import (create_pdecode)
+from soc.decoder.power_decoder2 import (PowerDecode2)
+from soc.simulator.program import Program
+from soc.decoder.isa.caller import ISACaller, inject, RADIX
+from soc.decoder.selectable_int import SelectableInt
+from soc.decoder.orderedset import OrderedSet
+from soc.decoder.isa.all import ISA
+
+if __name__ == "__main__":
+ radix = RADIX(None,None) #first test to avoid syntax errors
+ radix._walk_tree()
+ print("DONE")