-Subproject commit a0ed154f4604d296ffc77e0489c4c0f2e23c94dc
+Subproject commit 12e9237b896ad233cb18946b34dab17d976f415c
with m.Else():
# Architecture says to leave out bits 3 (HV), 51 (ME)
# and 63 (LE) (IBM bit numbering)
- for stt, end in [(1,12), (13, 60), (61, 64)]:
- comb += msr_o.data[stt:end].eq(a_i[stt:end])
+ with m.If(op.insn_type == MicrOp.OP_MTMSRD):
+ for stt, end in [(1,12), (13, 60), (61, 64)]:
+ comb += msr_o.data[stt:end].eq(a_i[stt:end])
+ with m.Else():
+ # mtmsr - 32-bit, only room for bottom 32 LSB flags
+ for stt, end in [(1,12), (13, 32)]:
+ comb += msr_o.data[stt:end].eq(a_i[stt:end])
msr_check_pr(m, msr_o.data)
comb += msr_o.ok.eq(1)
initial_regs[1] = 0xffffffffffffffff
self.run_tst_program(Program(lst, bigendian), initial_regs)
+ def test_4_mtmsrd_0(self):
+ lst = ["mtmsrd 1,0"]
+ initial_regs = [0] * 32
+ initial_regs[1] = 0xffffffffffffffff
+ self.run_tst_program(Program(lst, bigendian), initial_regs)
+
+ def test_5_mtmsrd_1(self):
+ lst = ["mtmsrd 1,1"]
+ initial_regs = [0] * 32
+ initial_regs[1] = 0xffffffffffffffff
+ self.run_tst_program(Program(lst, bigendian), initial_regs)
+
def test_999_illegal(self):
# ok, um this is a bit of a cheat: use an instruction we know
# is not implemented by either ISACaller or the core
- lst = ["tbegin."]
+ lst = ["tbegin.",
+ "mtmsr 1,1"] # should not get executed
initial_regs = [0] * 32
self.run_tst_program(Program(lst, bigendian), initial_regs)