yield from ALUHelpers.get_sim_int_ra(res, sim, dec2) # RA
yield from ALUHelpers.get_sim_int_rb(res, sim, dec2) # RB
- yield from ALUHelpers.get_sim_fast_spr1(res, sim, dec2) # SPR1
+ yield from ALUHelpers.get_sim_slow_spr1(res, sim, dec2) # FAST1
+ yield from ALUHelpers.get_sim_fast_spr1(res, sim, dec2) # FAST1
yield from ALUHelpers.get_rd_sim_xer_ca(res, sim, dec2) # XER.ca
yield from ALUHelpers.get_sim_xer_ov(res, sim, dec2) # XER.ov
yield from ALUHelpers.get_sim_xer_so(res, sim, dec2) # XER.so
yield from ALUHelpers.set_xer_ov(alu, dec2, inp)
yield from ALUHelpers.set_xer_so(alu, dec2, inp)
- # XXX TODO slow spr1
yield from ALUHelpers.set_fast_spr1(alu, dec2, inp)
+ yield from ALUHelpers.set_slow_spr1(alu, dec2, inp)
# This test bench is a bit different than is usual. Initially when I
yield from ALUHelpers.get_int_o(res, alu, dec2)
yield from ALUHelpers.get_fast_spr1(res, alu, dec2)
+ yield from ALUHelpers.get_slow_spr1(res, alu, dec2)
yield from ALUHelpers.get_xer_ov(res, alu, dec2)
yield from ALUHelpers.get_xer_ca(res, alu, dec2)
yield from ALUHelpers.get_xer_so(res, alu, dec2)
yield from ALUHelpers.get_sim_xer_ov(sim_o, sim, dec2)
yield from ALUHelpers.get_wr_sim_xer_ca(sim_o, sim, dec2)
yield from ALUHelpers.get_wr_fast_spr1(sim_o, sim, dec2)
+ yield from ALUHelpers.get_wr_slow_spr1(sim_o, sim, dec2)
ALUHelpers.check_xer_ov(self, res, sim_o, code)
ALUHelpers.check_xer_ca(self, res, sim_o, code)
ALUHelpers.check_int_o(self, res, sim_o, code)
ALUHelpers.check_fast_spr1(self, res, sim_o, code)
+ ALUHelpers.check_slow_spr1(self, res, sim_o, code)
ALUHelpers.check_xer_so(self, res, sim_o, code)
def get_sim_msr(res, sim, dec2):
res['msr'] = sim.msr.value
+ def get_sim_slow_spr1(res, sim, dec2):
+ spr1_en = yield dec2.e.read_spr1.ok
+ if spr1_en:
+ spr1_sel = yield dec2.e.read_spr1.data
+ spr1_data = sim.spr[spr1_sel].value
+ res['spr1'] = spr1_data
+
def get_sim_fast_spr1(res, sim, dec2):
fast1_en = yield dec2.e.read_fast1.ok
if fast1_en:
spr_name = spr_dict[spr_num].SPR
res['fast1'] = sim.spr[spr_name].value
+ def get_wr_slow_spr1(res, sim, dec2):
+ ok = yield dec2.e.write_spr.ok
+ if ok:
+ spr_num = yield dec2.e.write_spr.data
+ spr_name = spr_dict[spr_num].SPR
+ res['spr1'] = sim.spr[spr_name].value
+
def get_wr_sim_xer_ca(res, sim, dec2):
cry_out = yield dec2.e.output_carry
if cry_out:
if oe and oe_ok:
res['xer_so'] = 1 if sim.spr['XER'][XER_bits['SO']] else 0
+ def check_slow_spr1(dut, res, sim_o, msg):
+ if 'spr1' in res:
+ expected = sim_o['spr1']
+ alu_out = res['spr1']
+ print(f"expected {expected:x}, actual: {alu_out:x}")
+ dut.assertEqual(expected, alu_out, msg)
+
def check_fast_spr1(dut, res, sim_o, msg):
if 'fast1' in res:
expected = sim_o['fast1']