From: Michael Nolan Date: Wed, 6 May 2020 18:21:40 +0000 (-0400) Subject: Add length helper for getting length of a selectable int X-Git-Tag: div_pipeline~1365 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1188f7894d7a37be82cf7e450d85de1353a841d;p=soc.git Add length helper for getting length of a selectable int --- diff --git a/src/soc/decoder/helpers.py b/src/soc/decoder/helpers.py index ba3ca0a1..c75fa1e9 100644 --- a/src/soc/decoder/helpers.py +++ b/src/soc/decoder/helpers.py @@ -71,6 +71,10 @@ def lt(a, b): def le(a, b): return SelectableInt((a <= b), bits=1) + +def length(a): + return len(a) + # For these tests I tried to find power instructions that would let me # isolate each of these helper operations. So for instance, when I was # testing the MASK() function, I chose rlwinm and rldicl because if I diff --git a/src/soc/decoder/isa/sprset.patch b/src/soc/decoder/isa/sprset.patch deleted file mode 100644 index adae5b1b..00000000 --- a/src/soc/decoder/isa/sprset.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- sprset.py.orig 2020-05-06 14:15:08.236887767 -0400 -+++ sprset.py 2020-05-06 14:15:51.757083567 -0400 -@@ -15,11 +15,11 @@ - if n in [13]: - see(Book_III_p974) - elif n in [808, 809, 810, 811]: -- if eq(length(SPR(n)), 64): -+ if eq(len(SPR(n)), 64): - SPR[n] = RS - else: - SPR[n] = RS[32:64] -- elif eq(length(SPR(n)), 64): -+ elif eq(len(SPR(n)), 64): - SPR[n] = RS - else: - SPR[n] = RS[32:64] diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index e7f2b344..a55b3ffc 100644 --- a/src/soc/decoder/pseudo/pywriter.py +++ b/src/soc/decoder/pseudo/pywriter.py @@ -20,7 +20,7 @@ header = """\ 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) + ne, eq, gt, ge, lt, le, length) from soc.decoder.selectable_int import SelectableInt from soc.decoder.selectable_int import selectconcat as concat from soc.decoder.orderedset import OrderedSet