add imports for helper functions to pywriter
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Apr 2020 12:45:56 +0000 (13:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Apr 2020 12:45:56 +0000 (13:45 +0100)
src/soc/decoder/pseudo/pywriter.py

index 2934ab44082d0273758b77f0d5ae10a37ded4af5..ad0b09e088e9d763b4f0fc87c3f0b76006af365b 100644 (file)
@@ -29,7 +29,11 @@ class PyISAWriter(ISA):
         fname = os.path.join(isadir, "%s.py" % pagename)
         with open(fname, "w") as f:
             iinf = ''
+            f.write("# auto-generated by pywriter.py, do not edit or commit\n")
             f.write("from soc.decoder.isa import ISACaller\n\n")
+            f.write("from soc.decoder.helpers import " + \
+                    "(EXTS64, EXTZ64, ROTL64, ROTL32, MASK,)\n")
+
             f.write("class %s(ISACaller):\n" % pagename)
             for page in instrs:
                 d = self.instr[page]