self.assertEqual(sim.gpr(1), SelectableInt(0x0, 64))
self.assertEqual(sim.gpr(2), SelectableInt(0x1234, 64))
+ def test_branch_link(self):
+ lst = ["bl 0xc",
+ "addi 2, 1, 0x1234",
+ "ba 0x1000",
+ "addi 1, 0, 0x1234",
+ "bclr 20, 0, 0"]
+ with Program(lst) as program:
+ sim = self.run_tst_program(program)
+
+
@unittest.skip("broken") # FIXME
def test_mtcrf(self):
for i in range(4):
def __getitem__(self, key):
print ("getitem", key, self.br)
+ if isinstance(key, SelectableInt):
+ key = key.value
key = self.br[key] # don't do POWER 1.3.4 bit-inversion
return self.si[key]
def __setitem__(self, key, value):
+ if isinstance(key, SelectableInt):
+ key = key.value
key = self.br[key] # don't do POWER 1.3.4 bit-inversion
return self.si.__setitem__(key, value)