From 06b8931eb167030bc47a287424ce4b9cadd854ce Mon Sep 17 00:00:00 2001 From: klehman Date: Fri, 10 Sep 2021 16:58:15 -0400 Subject: [PATCH] implement base class in state class --- src/soc/simple/test/teststate.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/soc/simple/test/teststate.py b/src/soc/simple/test/teststate.py index 9d7f8e99..8d6c32bd 100644 --- a/src/soc/simple/test/teststate.py +++ b/src/soc/simple/test/teststate.py @@ -1,7 +1,28 @@ from openpower.decoder.power_enums import XER_bits +class State: + def __init__(self): + pass -class SimState: + def get_intregs(self): + pass + + def get_crregs(self): + pass + + def get_xregs(self): + pass + + def get_pc(self): + pass + + def get_state(self): + yield from self.get_intregs() + yield from self.get_crregs() + yield from self.get_xregs() + yield from self.get_pc() + +class SimState(State): def __init__(self, sim): self.sim = sim @@ -46,7 +67,7 @@ class SimState: print("class sim pc", hex(self.pc)) -class HDLState: +class HDLState(State): def __init__(self, core): self.core = core -- 2.30.2