From 32f45c181bd8e3ce2811484ce69704fdc0458323 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 20 Sep 2021 18:33:38 +0100 Subject: [PATCH] use get_l0_mem in HDLState to get memory data --- src/soc/simple/test/teststate.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/soc/simple/test/teststate.py b/src/soc/simple/test/teststate.py index 7375cfec..37a2ebb9 100644 --- a/src/soc/simple/test/teststate.py +++ b/src/soc/simple/test/teststate.py @@ -9,7 +9,7 @@ from openpower.decoder.power_enums import XER_bits from openpower.util import log from openpower.test.state import (State, state_add, state_factory, TestState,) - +from soc.fu.compunits.test.test_compunit import get_l0_mem class HDLState(State): def __init__(self, core): @@ -50,15 +50,11 @@ class HDLState(State): log("class hdl pc", hex(self.pc)) def get_mem(self): - if hasattr(self.core.l0.pimem, 'lsui'): - hdlmem = self.core.l0.pimem.lsui.mem - else: - hdlmem = self.core.l0.pimem.mem - if not isinstance(hdlmem, Memory): - hdlmem = hdlmem.mem + # get the underlying HDL-simulated memory from the L0CacheBuffer + hdlmem = get_l0_mem(self.core.l0) self.mem = [] for i in range(hdlmem.depth): - value = yield hdlmem._array[i] + value = yield hdlmem._array[i] # should not really do this self.mem.append(((i*8), value)) -- 2.30.2