From: klehman Date: Fri, 10 Sep 2021 20:58:15 +0000 (-0400) Subject: implement base class in state class X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06b8931eb167030bc47a287424ce4b9cadd854ce;p=soc.git implement base class in state class --- 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