Merge branch 'fix-tests'
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 6 Apr 2020 19:00:27 +0000 (12:00 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 6 Apr 2020 19:00:27 +0000 (12:00 -0700)
1  2 
src/soc/decoder/isa/test_caller.py

index 0e9c113185e53b053b1b6976948b26370e998d1f,55dcc673bf08189ee50d154583709958c77a38c3..0a26c8169883112d431b55828535038066e56633
@@@ -57,7 -57,7 +57,7 @@@ class DecoderTestCase(FHDLTestCase)
          initial_regs[3] = 0x1234
          initial_regs[2] = 0x4321
          with Program(lst) as program:
-             sim = self.run_test_program(program, initial_regs)
+             sim = self.run_tst_program(program, initial_regs)
              self.assertEqual(sim.gpr(1), SelectableInt(0x5555, 64))
  
      def test_addi(self):
@@@ -65,7 -65,7 +65,7 @@@
                 "addi 2, 0, 0x4321",
                 "add  1, 3, 2"]
          with Program(lst) as program:
-             sim = self.run_test_program(program)
+             sim = self.run_tst_program(program)
              print(sim.gpr(1))
              self.assertEqual(sim.gpr(1), SelectableInt(0x5555, 64))
  
                 "stw 2, 0(1)",
                 "lwz 3, 0(1)"]
          with Program(lst) as program:
-             sim = self.run_test_program(program)
+             sim = self.run_tst_program(program)
              print(sim.gpr(1))
              self.assertEqual(sim.gpr(3), SelectableInt(0x1234, 64))
  
-             sim = self.run_test_program(program)
 +    def test_addpcis(self):
 +        lst = ["addpcis 1, 0x1",
 +               "addpcis 2, 0x1",
 +               "addpcis 3, 0x1"]
 +        with Program(lst) as program:
-     def run_test_program(self, prog, initial_regs=[0] * 32):
++            sim = self.run_tst_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_tst_program(self, prog, initial_regs=[0] * 32):
          simulator = self.run_tst(prog, initial_regs)
          simulator.gpr.dump()
          return simulator