test in SimState for access to RADIX memory, bypass and get contents direct
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Dec 2021 17:46:23 +0000 (17:46 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Dec 2021 17:46:23 +0000 (17:46 +0000)
src/openpower/test/state.py

index 77e881c2a7438c0052085051a82092b0b47edade..ee884f81e4e32d10f0f43137e9c055ba52e8d860 100644 (file)
@@ -23,6 +23,7 @@ methods, the use of yield from/yield is required.
 
 
 from openpower.decoder.power_enums import XER_bits
+from openpower.decoder.isa.radixmmu import RADIX
 from openpower.util import log
 import os
 import sys
@@ -216,12 +217,15 @@ class SimState(State):
     def get_mem(self):
         if False:
             yield
-        keys = list(self.sim.mem.mem.keys())
+        mem = self.sim.mem
+        if isinstance(mem, RADIX):
+            mem = mem.mem
+        keys = list(mem.mem.keys())
         self.mem = {}
         # from each address in the underlying mem-simulated dictionary
         # issue a 64-bit LD (with no byte-swapping)
         for k in keys:
-            data = self.sim.mem.ld(k*8, 8, False)
+            data = mem.ld(k*8, 8, False)
             self.mem[k*8] = data