From: Michael Nolan Date: Mon, 6 Apr 2020 13:15:33 +0000 (-0400) Subject: Add test for addpcis X-Git-Tag: div_pipeline~1442 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7e241c504144c63013e495bae6c9966dcde4004;p=soc.git Add test for addpcis --- diff --git a/src/soc/decoder/isa/test_caller.py b/src/soc/decoder/isa/test_caller.py index bcc9a551..0e9c1131 100644 --- a/src/soc/decoder/isa/test_caller.py +++ b/src/soc/decoder/isa/test_caller.py @@ -79,6 +79,16 @@ class DecoderTestCase(FHDLTestCase): print(sim.gpr(1)) self.assertEqual(sim.gpr(3), SelectableInt(0x1234, 64)) + def test_addpcis(self): + lst = ["addpcis 1, 0x1", + "addpcis 2, 0x1", + "addpcis 3, 0x1"] + with Program(lst) as program: + sim = self.run_test_program(program) + self.assertEqual(sim.gpr(1), SelectableInt(0x10004, 64)) + self.assertEqual(sim.gpr(2), SelectableInt(0x10008, 64)) + self.assertEqual(sim.gpr(3), SelectableInt(0x1000c, 64)) + def run_test_program(self, prog, initial_regs=[0] * 32): simulator = self.run_tst(prog, initial_regs) simulator.gpr.dump() diff --git a/src/soc/simulator/program.py b/src/soc/simulator/program.py index b3c1e87f..9857f037 100644 --- a/src/soc/simulator/program.py +++ b/src/soc/simulator/program.py @@ -45,6 +45,7 @@ class Program: def _assemble(self): with tempfile.NamedTemporaryFile(suffix=".o") as outfile: args = ["powerpc64-linux-gnu-as", + '-mpower9', obj_fmt, "-o", outfile.name]