bug in isa parser not recognising MSR as declared variable
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 19:44:35 +0000 (20:44 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 19:44:35 +0000 (20:44 +0100)
src/soc/decoder/pseudo/parser.py

index 3d75fbb059af6b31e61cb9fef1eeb22d2cb10068..b2197371838c034e41322c83542a569b1c38f17e 100644 (file)
@@ -395,7 +395,8 @@ class PowerParser:
                     if name in self.gprs:
                         # add to list of uninitialised
                         self.uninit_regs.add(name)
-                    autoassign = name not in self.declared_vars
+                    autoassign = (name not in self.declared_vars and
+                                  name not in self.special_regs)
             elif isinstance(p[1], ast.Call) and p[1].func.id in ['GPR', 'SPR']:
                 print(astor.dump_tree(p[1]))
                 # replace GPR(x) with GPR[x]