From: Michael Nolan Date: Sat, 4 Apr 2020 20:33:25 +0000 (-0400) Subject: change @inject to take no parameters X-Git-Tag: div_pipeline~1516 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8dbbb7286065bd147c87c7483776575d4bbc561;p=soc.git change @inject to take no parameters There are issues with using decorators with class variables (see https://stackoverflow.com/questions/11731136/class-method-decorator-with-self-arguments) so it was changed to take no variables and access the class internally --- diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index a9f58acd..049a1f39 100644 --- a/src/soc/decoder/pseudo/pywriter.py +++ b/src/soc/decoder/pseudo/pywriter.py @@ -51,7 +51,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(" @inject(self.namespace)\n") + f.write(" @inject()\n") f.write(" def %s(%s):\n" % (op_fname, args)) pycode = pycode.split("\n") pycode = '\n'.join(map(lambda x: " %s" % x, pycode))