whoops prefix op_ already added
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Apr 2020 12:54:40 +0000 (13:54 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Apr 2020 12:54:40 +0000 (13:54 +0100)
src/soc/decoder/pseudo/pywriter.py

index 5ab685d3a7504fcfb7bac50ab6152a901bd3e71b..88746e28d9ae1ad045f9f4d6d84cdef4446cdea6 100644 (file)
@@ -54,7 +54,7 @@ class PyISAWriter(ISA):
                 # write out function.  pre-pend "op_" because some instrs are
                 # also python keywords (cmp).  also replace "." with "_"
                 op_fname ="op_%s" % page.replace(".", "_")
-                f.write("    def op_%s(%s):\n" % (op_fname, args))
+                f.write("    def %s(%s):\n" % (op_fname, args))
                 pycode = pycode.split("\n")
                 pycode = '\n'.join(map(lambda x: "        %s" % x, pycode))
                 pycode = pycode.rstrip()
@@ -64,7 +64,7 @@ class PyISAWriter(ISA):
                 else:
                     f.write("\n")
                 # accumulate the instruction info
-                iinfo = "(op_%s, %s, %s, %s)" % \
+                iinfo = "(%s, %s, %s, %s)" % \
                             (op_fname, rused['read_regs'],
                             rused['uninit_regs'], rused['write_regs'])
                 iinf += "    instrs['%s'] = %s\n" % (page, iinfo)