# initial values in GPR regfile
initial_regs = [0] * 32
+ initial_regs[5] = 0x4321
initial_regs[9] = 0x1234
initial_regs[10] = 0x1111
- initial_regs[5] = 0x4321
initial_regs[6] = 0x2223
# SVSTATE (in this case, VL=2)
svstate = SVP64State()
svstate.vl[0:7] = 2 # VL
svstate.maxvl[0:7] = 2 # MAXVL
print ("SVSTATE", bin(svstate.spr.asint()))
- # copy before running
+ # copy before running, then compute answers
expected_regs = deepcopy(initial_regs)
- expected_regs[1] = 0x5555
- expected_regs[2] = 0x3334
+ expected_regs[1] = initial_regs[5] + initial_regs[9] # 0x5555
+ expected_regs[2] = initial_regs[6] + initial_regs[10] # 0x3334
with Program(lst, bigendian=False) as program:
sim = self.run_tst_program(program, initial_regs, svstate)
print ("SVSTATE", bin(svstate.spr.asint()))
# copy before running
expected_regs = deepcopy(initial_regs)
- expected_regs[1] = 0x5555
+ expected_regs[1] = initial_regs[5] + initial_regs[9] # 0x5555
with Program(lst, bigendian=False) as program:
sim = self.run_tst_program(program, initial_regs, svstate)
print ("SVSTATE", bin(svstate.spr.asint()))
# copy before running
expected_regs = deepcopy(initial_regs)
- expected_regs[1] = 0x5555
- expected_regs[2] = 0x5432
+ expected_regs[1] = initial_regs[5] + initial_regs[9] # 0x5555
+ expected_regs[2] = initial_regs[5] + initial_regs[10] # 0x5432
with Program(lst, bigendian=False) as program:
sim = self.run_tst_program(program, initial_regs, svstate)
print ("SVSTATE", bin(svstate.spr.asint()))
# copy before running
expected_regs = deepcopy(initial_regs)
- expected_regs[1] = 0
- expected_regs[2] = 0x3334
+ expected_regs[1] = initial_regs[5] + initial_regs[9] # 0x0
+ expected_regs[2] = initial_regs[6] + initial_regs[10] # 0x3334
with Program(lst, bigendian=False) as program:
sim = self.run_tst_program(program, initial_regs, svstate)