From: Luke Kenneth Casson Leighton Date: Mon, 14 Jun 2021 21:46:57 +0000 (+0100) Subject: series of text macro formats to look for: x.v, x.s (x) X-Git-Tag: xlen-bcd~468 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a2dfd830101b063688f83d9d457e39eb863721b;p=openpower-isa.git series of text macro formats to look for: x.v, x.s (x) --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index a20d2840..7d2a7346 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -742,12 +742,33 @@ def macro_subst(macros, txt): while again: again = False for macro, value in macros.items(): - if macro == txt or ('(' in txt and macro in txt) or \ - (txt.endswith('.v') and macro in txt): + if macro == txt: again = True replaced = txt.replace(macro, value) print ("macro", txt, "replaced", replaced, macro, value) txt = replaced + continue + toreplace = '%s.s' % macro + if toreplace == txt: + again = True + replaced = txt.replace(toreplace, 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) + print ("macro", txt, "replaced", replaced, toreplace, value) + txt = replaced + continue + toreplace = '(%s)' % macro + if toreplace == txt: + again = True + replaced = txt.replace(toreplace, value) + print ("macro", txt, "replaced", replaced, toreplace, value) + txt = replaced + continue print (" processed", txt) return txt