implement base class in state class
authorklehman <klehman9@comcast.net>
Fri, 10 Sep 2021 20:58:15 +0000 (16:58 -0400)
committerklehman <klehman9@comcast.net>
Fri, 10 Sep 2021 20:58:15 +0000 (16:58 -0400)
src/soc/simple/test/teststate.py

index 9d7f8e994dff9359f199bf4a70459d25dff5d042..8d6c32bd8ec2ce1f9e9170a685947a05eef85004 100644 (file)
@@ -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