From f8dbbb7286065bd147c87c7483776575d4bbc561 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Sat, 4 Apr 2020 16:33:25 -0400 Subject: [PATCH] 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 --- src/soc/decoder/pseudo/pywriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- 2.30.2