add quick test of litex bios IMM64 macro
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 1 Aug 2020 13:00:00 +0000 (14:00 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 1 Aug 2020 13:00:00 +0000 (14:00 +0100)
src/soc/decoder/isa/caller.py
src/soc/simulator/test_sim.py

index 9053d26857e4f96dc2f7fa82dfe5a168a9e08807..7a25bf0bf39330dddfcd57ebead00cc167df6146 100644 (file)
@@ -532,8 +532,9 @@ class ISACaller:
     def get_assembly_name(self):
         # TODO, asmregs is from the spec, e.g. add RT,RA,RB
         # see http://bugs.libre-riscv.org/show_bug.cgi?id=282
+        dec_insn = yield self.dec2.e.do.insn
         asmcode = yield self.dec2.dec.op.asmcode
-        print("get assembly name asmcode", asmcode)
+        print("get assembly name asmcode", asmcode, hex(dec_insn))
         asmop = insns.get(asmcode, None)
         int_op = yield self.dec2.dec.op.internal_op
 
index 16a3237e0fe06af73a940adcf2f137c6c919f93d..f2477a1f9b9df809331c06c1a912bae3c40002ef 100644 (file)
@@ -49,6 +49,33 @@ class GeneralTestCases(FHDLTestCase):
         super().__init__(name)
         self.test_name = name
 
+    def test_0_litex_bios_r1(self):
+        """litex bios IMM64 macro test
+        """
+        lst = [ "addis     1,0,0",
+                 "ori     1,1,0",
+                 "rldicr  1,1,32,31",
+                 "oris    1,1,256",
+                 "ori     1,1,3832",
+               ]
+        with Program(lst, bigendian) as program:
+            self.run_tst_program(program, [1], initial_mem={})
+
+    @unittest.skip("disable")
+    def test_0_litex_trampoline(self):
+        lst = ["tdi   0,0,0x48",
+               "b     0x28",
+               "mfmsr r11",
+               "bcl 20,31,4",
+               "mflr r10",
+               "addi r10,r10,20",
+               "mthsrr0 r10",
+               "mthsrr1 r11",
+               "hrfid",
+               ]
+        with Program(lst, bigendian) as program:
+            self.run_tst_program(program, [], initial_mem={})
+
     @unittest.skip("disable")
     def test_0_cmp(self):
         lst = ["addi 6, 0, 0x10",
@@ -243,20 +270,6 @@ class GeneralTestCases(FHDLTestCase):
         with Program(lst, bigendian) as program:
             self.run_tst_program(program, [9], initial_mem={})
 
-    def test_litex_trampoline(self):
-        lst = ["tdi   0,0,0x48",
-               "b     0x28",
-               "mfmsr r11",
-               "bcl 20,31,4",
-               "mflr r10",
-               "addi r10,r10,20",
-               "mthsrr0 r10",
-               "mthsrr1 r11",
-               "hrfid",
-               ]
-        with Program(lst, bigendian) as program:
-            self.run_tst_program(program, [], initial_mem={})
-
     def test_30_addis(self):
         lst = [  # "addi 0, 0, 5",
             "addis 12, 0, 0",
@@ -310,8 +323,7 @@ class DecoderBase:
                 yield Settle()
 
         sim.add_process(process)
-        with sim.write_vcd("simulator.vcd", "simulator.gtkw",
-                           traces=[]):
+        with sim.write_vcd("pdecode_simulator.vcd"):
             sim.run()
 
         return simulator