whoops forgot format-to-format conversion
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 14 Jun 2021 21:49:59 +0000 (22:49 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 14 Jun 2021 21:49:59 +0000 (22:49 +0100)
src/openpower/sv/trans/svp64.py

index 7d2a7346e9066a0f90bdb6a7daa3a7f6f2ce1ef2..e3aa1d3f3636f217fd984bc6840dae7711414d6f 100644 (file)
@@ -751,21 +751,21 @@ def macro_subst(macros, txt):
             toreplace = '%s.s' % macro
             if toreplace == txt:
                 again = True
-                replaced = txt.replace(toreplace, value)
+                replaced = txt.replace(toreplace, "%s.s" % value)
                 print ("macro", txt, "replaced", replaced, toreplace, value)
                 txt = replaced
                 continue
             toreplace = '%s.v' % macro
             if toreplace == txt:
                 again = True
-                replaced = txt.replace(toreplace, value)
+                replaced = txt.replace(toreplace, "%s.v" % value)
                 print ("macro", txt, "replaced", replaced, toreplace, value)
                 txt = replaced
                 continue
             toreplace = '(%s)' % macro
-            if toreplace == txt:
+            if toreplace in txt:
                 again = True
-                replaced = txt.replace(toreplace, value)
+                replaced = txt.replace(toreplace, '(%s)' % value)
                 print ("macro", txt, "replaced", replaced, toreplace, value)
                 txt = replaced
                 continue