From 07cb90089e239af8c2888fd30e19b85443b548c5 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 3 Apr 2020 19:17:20 +0100 Subject: [PATCH] fix concat error --- src/soc/decoder/power_pseudo.py | 7 ++++++- src/soc/decoder/pseudo/parser.py | 6 +++--- src/soc/decoder/pseudo/pywriter.py | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/soc/decoder/power_pseudo.py b/src/soc/decoder/power_pseudo.py index 2be1760a..8a34507c 100644 --- a/src/soc/decoder/power_pseudo.py +++ b/src/soc/decoder/power_pseudo.py @@ -91,10 +91,15 @@ src1 <- GPR[RA] src1 <- src1[0:56] """ +addpcis = """ +D <- d0||d1||d2 +""" + #code = testreg #code = cnttzd #code = cmpi -code = cmpeqb +#code = cmpeqb +code = addpcis #code = bpermd def tolist(num): diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py index ffb8ec0f..02bb2cc1 100644 --- a/src/soc/decoder/pseudo/parser.py +++ b/src/soc/decoder/pseudo/parser.py @@ -113,13 +113,13 @@ unary_ops = { } def check_concat(node): # checks if the comparison is already a concat - print (node) + print ("check concat", node) if not isinstance(node, ast.Call): return [node] - print (node.func.id) + print ("func", node.func.id) if node.func.id != 'concat': return [node] - return node[1] + return node.args ########## Parser (tokens -> AST) ###### diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index 3ecc2f87..af42c15a 100644 --- a/src/soc/decoder/pseudo/pywriter.py +++ b/src/soc/decoder/pseudo/pywriter.py @@ -34,3 +34,4 @@ class PyISAWriter(ISA): if __name__ == '__main__': isa = PyISAWriter() isa.write_pysource('comparefixed') + isa.write_pysource('fixedarith') -- 2.30.2