From: Dmitry Selyutin Date: Wed, 29 Sep 2021 09:47:31 +0000 (+0000) Subject: decoder/parser: self.XLEN instead of XLEN X-Git-Tag: sv_maxu_works-initial~802 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d156529c2a1c7f0a5237f1ccb3212e9780e8f6f;p=openpower-isa.git decoder/parser: self.XLEN instead of XLEN --- diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index b2215d38..e1cfcf40 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -195,7 +195,7 @@ def identify_sint_mul_pattern(p): return False if (not isinstance(p[3], ast.Constant) and # rhs = Num not isinstance(p[3], ast.BinOp) and # rhs = (XLEN-something) - not isinstance(p[3], ast.Name)): # rhs = XLEN + not isinstance(p[3], ast.Attribute)): # rhs = XLEN return False if not isinstance(p[1], ast.List): # lhs is a list return False @@ -751,7 +751,11 @@ class PowerParser: 'SVSHAPE0', 'SVSHAPE1', 'SVSHAPE2', 'SVSHAPE3']: self.special_regs.add(name) self.write_regs.add(name) # and add to list to write - p[0] = ast.Name(id=name, ctx=ast.Load()) + if name in {'XLEN'}: + attr = ast.Name("self", ast.Load()) + p[0] = ast.Attribute(attr, name, ast.Load()) + else: + p[0] = ast.Name(id=name, ctx=ast.Load()) def p_atom_number(self, p): """atom : BINARY