+from openpower.decoder.power_enums import XER_bits
+import copy
+
+
class SimState:
def __init__(self, sim):
self.sim = sim
simregval = self.sim.gpr[i].asint()
self.intregs.append(simregval)
-# HDL class here with same functions
+ def get_crregs(self):
+ self.crregs = []
+ for i in range(8):
+ cri = self.sim.crl[7 - i].get_range().value
+ self.crregs.append(cri)
+
+ def get_xregs(self):
+ self.so = self.sim.spr['XER'][XER_bits['SO']].value
+ self.ov = self.sim.spr['XER'][XER_bits['OV']].value
+ self.ov32 = self.sim.spr['XER'][XER_bits['OV32']].value
+ self.ca = self.sim.spr['XER'][XER_bits['CA']].value
+ self.ca32 = self.sim.spr['XER'][XER_bits['CA32']].value
+ self.ov = self.ov | (self.ov32 << 1)
+ self.ca = self.ca | (self.ca32 << 1)
+
+ def get_pc(self):
+ self.pc = self.sim.pc.CIA.value
+
+# class HDLState: