enable -mregnames in assembly syntax for unit tests
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 21 Mar 2021 10:55:01 +0000 (10:55 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 21 Mar 2021 10:55:01 +0000 (10:55 +0000)
src/soc/simulator/program.py

index 68c7549d6188b35eaf0716d9e30488ae2fa4d61f..47e873c69306d815e1a69f529fe1f2b8827a795b 100644 (file)
@@ -79,6 +79,7 @@ class Program:
         with tempfile.NamedTemporaryFile(suffix=".o") as outfile:
             args = ["powerpc64-linux-gnu-as",
                     '-mpower9',
+                    '-mregnames',
                     self.obj_fmt,
                     "-o",
                     outfile.name]
@@ -120,9 +121,10 @@ class Program:
         self.binfile.close()
 
 if __name__ == '__main__':
-    lst = ['addi 5, 0, 4660',
-           'mtcrf 255, 5',
+    lst = ['addi 5, 0, 4660/2',
+           'mtcrf 255, 5+3',
            'mfocrf 2, 1',
+           'addi r2, 3, 1',
            'attn',
           ]
     with Program(lst, False) as p: