def get_sim_cia(res, sim, dec2):
res['cia'] = sim.pc.CIA.value
+ # use this *after* the simulation has run a step (it returns CIA)
+ def get_sim_nia(res, sim, dec2):
+ res['nia'] = sim.pc.CIA.value
+
def get_sim_msr(res, sim, dec2):
res['msr'] = sim.msr.value
print(f"expected {expected:x}, actual: {alu_out:x}")
dut.assertEqual(expected, alu_out, msg)
+ def check_nia(dut, res, sim_o, msg):
+ if 'nia' in res:
+ expected = sim_o['nia']
+ alu_out = res['nia']
+ print(f"expected {expected:x}, actual: {alu_out:x}")
+ dut.assertEqual(expected, alu_out, msg)
+
def check_cr_a(dut, res, sim_o, msg):
if 'cr_a' in res:
cr_expected = sim_o['cr_a']
yield from ALUHelpers.get_sim_int_o(sim_o, sim, dec2)
yield from ALUHelpers.get_wr_fast_spr1(sim_o, sim, dec2)
yield from ALUHelpers.get_wr_fast_spr2(sim_o, sim, dec2)
- ALUHelpers.get_sim_cia(sim_o, sim, dec2)
+ ALUHelpers.get_sim_nia(sim_o, sim, dec2)
ALUHelpers.get_sim_msr(sim_o, sim, dec2)
print ("sim output", sim_o)
ALUHelpers.check_int_o(self, res, sim_o, code)
ALUHelpers.check_fast_spr1(self, res, sim_o, code)
ALUHelpers.check_fast_spr2(self, res, sim_o, code)
+ ALUHelpers.check_nia(self, res, sim_o, code)
if __name__ == "__main__":