rename undef to undefined (preserving the fact that it is a function)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 9 Oct 2020 10:34:29 +0000 (11:34 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 9 Oct 2020 10:34:29 +0000 (11:34 +0100)
libreriscv
src/soc/decoder/helpers.py
src/soc/decoder/pseudo/parser.py
src/soc/decoder/pseudo/pywriter.py

index b283b6c0439c6dbf2cf6e3b7bbe5381f35da9776..d8d58a50a16d7f025bb7d18c1b8727c9131c467d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b283b6c0439c6dbf2cf6e3b7bbe5381f35da9776
+Subproject commit d8d58a50a16d7f025bb7d18c1b8727c9131c467d
index b1d8b87f3298e8cf9366d5cf914bc454716cbd09..6f63cc3d363596c72290123719cacdc8c5d94862 100644 (file)
@@ -130,10 +130,13 @@ def length(a):
     return len(a)
 
 
-def undef(v):
+def undefined(v):
     """ function that, for Power spec purposes, returns undefined bits of
-        the same shape as the input bits, however, for purposes of matching
-        POWER9's behavior returns the input bits unchanged."""
+        the same shape as the input bits.  however, for purposes of matching
+        POWER9's behavior returns the input bits unchanged.  this effectively
+        "marks" (tags) locations in the v3.0B spec that need to be submitted
+        for clarification.
+    """
     return v
 
 # For these tests I tried to find power instructions that would let me
index 1466f87cf1f63a0526e91910f93534e46716675e..37bcddead339a82d17fd4e4d8030daa4b19e8e4a 100644 (file)
@@ -45,11 +45,12 @@ def Assign(autoassign, assignname, left, right, iea_mode):
         return ast.Assign([ast.AssTuple(ass_list)], right)
     elif isinstance(left, ast.Subscript):
         ls = left.slice
-        if (isinstance(ls, ast.Slice) and isinstance(right, ast.Name) and
-                right.id == 'undefined'):
-            # undefined needs to be copied the exact same slice
-            right = ast.Subscript(right, ls, ast.Load())
-            return ast.Assign([left], right)
+        # XXX changing meaning of "undefined" to a function
+        #if (isinstance(ls, ast.Slice) and isinstance(right, ast.Name) and
+        #        right.id == 'undefined'):
+        #    # undefined needs to be copied the exact same slice
+        #    right = ast.Subscript(right, ls, ast.Load())
+        #    return ast.Assign([left], right)
         res = ast.Assign([left], right)
         if autoassign and isinstance(ls, ast.Slice):
             # hack to create a variable pre-declared based on a slice.
index 5e8c1492465ac0900b1ca8b60d86d5a028efab87..ea69776bd8ad7d3998c022af69c04a4e0424022d 100644 (file)
@@ -23,7 +23,7 @@ from soc.decoder.isa.caller import inject, instruction_info
 from soc.decoder.helpers import (EXTS, EXTS64, EXTZ64, ROTL64, ROTL32, MASK,
                                  ne, eq, gt, ge, lt, le, ltu, gtu, length,
                                  trunc_divs, trunc_rems, MULS, DIVS, MODS,
-                                 EXTS128, undef)
+                                 EXTS128, undefined)
 from soc.decoder.selectable_int import SelectableInt
 from soc.decoder.selectable_int import selectconcat as concat
 from soc.decoder.orderedset import OrderedSet