From: Luke Kenneth Casson Leighton Date: Fri, 9 Oct 2020 10:34:29 +0000 (+0100) Subject: rename undef to undefined (preserving the fact that it is a function) X-Git-Tag: 24jan2021_ls180~172 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=36e2c3e62891f0e9565068f120c1b275f2da510a rename undef to undefined (preserving the fact that it is a function) --- diff --git a/libreriscv b/libreriscv index b283b6c0..d8d58a50 160000 --- a/libreriscv +++ b/libreriscv @@ -1 +1 @@ -Subproject commit b283b6c0439c6dbf2cf6e3b7bbe5381f35da9776 +Subproject commit d8d58a50a16d7f025bb7d18c1b8727c9131c467d diff --git a/src/soc/decoder/helpers.py b/src/soc/decoder/helpers.py index b1d8b87f..6f63cc3d 100644 --- a/src/soc/decoder/helpers.py +++ b/src/soc/decoder/helpers.py @@ -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 diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py index 1466f87c..37bcddea 100644 --- a/src/soc/decoder/pseudo/parser.py +++ b/src/soc/decoder/pseudo/parser.py @@ -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. diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index 5e8c1492..ea69776b 100644 --- a/src/soc/decoder/pseudo/pywriter.py +++ b/src/soc/decoder/pseudo/pywriter.py @@ -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