corrections to lte / gte
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 3 Apr 2020 16:20:23 +0000 (17:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 3 Apr 2020 16:20:23 +0000 (17:20 +0100)
libreriscv
src/soc/decoder/power_pseudo.py
src/soc/decoder/pseudo/parser.py

index df8dbe52a4a201d4e23e50de5ffd84c01b54cb57..9518ccbc93df4c69ae0b715075e8a25fc3c98ef9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit df8dbe52a4a201d4e23e50de5ffd84c01b54cb57
+Subproject commit 9518ccbc93df4c69ae0b715075e8a25fc3c98ef9
index 32479e57b0ca2b92bfc76459d3fbd1dd3a3515a6..ee527f0e5d20f906685fe63f22dd55d3a11f7afd 100644 (file)
@@ -79,6 +79,13 @@ in_range <-  ((x | y) &
 in_range <-  (x + y) - (a + b)
 """
 
+cmpi = """
+(RA)[0:1] <- 1
+src1    <- EXTZ((RA)[56:63])
+CR[4*BF+32] <- 0b0
+in_range <- src21lo  <= src1 & src1 <=  src21hi 
+"""
+
 #code = testreg
 #code = cnttzd
 code = cmpi
index e752aff8207666735ba223ab98d0b5a342c74945..59da968de8f8cdb41adffff3feeaa911d36b4cbb 100644 (file)
@@ -80,10 +80,10 @@ def Assign(left, right):
 
 def make_le_compare(arg):
     (left, right) = arg
-    return ast.Compare(left, [ast.Le()], [right])
+    return ast.Compare(left, [ast.LtE()], [right])
 def make_ge_compare(arg):
     (left, right) = arg
-    return ast.Compare(left, [ast.Ge()], [right])
+    return ast.Compare(left, [ast.GtE()], [right])
 def make_lt_compare(arg):
     (left, right) = arg
     return ast.Compare(left, [ast.Lt()], [right])
@@ -356,7 +356,7 @@ class PowerParser:
             elif p[2] == '||':
                 l = check_concat(p[1]) + check_concat(p[3])
                 p[0] = ast.Call(ast.Name("concat"), l, [])
-            elif p[2] in ['<', '>', '=']:
+            elif p[2] in ['<', '>', '=', '<=', '>=']:
                 p[0] = binary_ops[p[2]]((p[1],p[3]))
             else:
                 p[0] = ast.BinOp(p[1], binary_ops[p[2]], p[3])