HDL int reg added
authorklehman <klehman9@comcast.net>
Thu, 9 Sep 2021 13:01:50 +0000 (09:01 -0400)
committerklehman <klehman9@comcast.net>
Thu, 9 Sep 2021 13:01:50 +0000 (09:01 -0400)
src/soc/simple/test/teststate.py

index 6266868de4b76e1cc13e732c1872488f30aea295..ad361b401d0cbca89882623b1ec5a692807f806b 100644 (file)
@@ -1,5 +1,4 @@
 from openpower.decoder.power_enums import XER_bits
-import copy
 
 
 class SimState:
@@ -30,4 +29,17 @@ class SimState:
     def get_pc(self):
         self.pc = self.sim.pc.CIA.value
 
-# class HDLState:
+
+class HDLState:
+    def __init__(self, core):
+        self.core = core
+
+    def get_intregs(self):
+        self.intregs = []
+        for i in range(32):
+            if self.core.regs.int.unary:
+                rval = yield self.core.regs.int.regs[i].reg
+            else:
+                rval = yield self.core.regs.int.memory_array[i]
+            self.intregs.append(rval)
+        print("class core int regs", list(map(hex, intregs)))