From: Luke Kenneth Casson Leighton Date: Tue, 30 Jun 2020 14:51:09 +0000 (+0100) Subject: add lte ltu for use by twi and other trap functions X-Git-Tag: div_pipeline~193 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4fa64c4221e7de4779bb3c39205fc7c9eeb53b1d;p=soc.git add lte ltu for use by twi and other trap functions --- diff --git a/libreriscv b/libreriscv index 34254f4b..22a93bad 160000 --- a/libreriscv +++ b/libreriscv @@ -1 +1 @@ -Subproject commit 34254f4b3c7c7ceb49fbf806014f0d90eee9011a +Subproject commit 22a93badbd972f3f6009ff1a2d7be2948dcb45d2 diff --git a/src/soc/decoder/helpers.py b/src/soc/decoder/helpers.py index d920b920..53edaca2 100644 --- a/src/soc/decoder/helpers.py +++ b/src/soc/decoder/helpers.py @@ -1,6 +1,8 @@ import unittest -from soc.decoder.selectable_int import SelectableInt +from soc.decoder.selectable_int import SelectableInt, onebit from nmutil.divmod import trunc_div, trunc_rem +from soc.decoder.selectable_int import selectltu as ltu +from soc.decoder.selectable_int import selectgtu as gtu """ Links: @@ -70,22 +72,22 @@ def MASK(x, y): return mask_a ^ mask_b def ne(a, b): - return SelectableInt((a != b), bits=1) + return onebit(a != b) def eq(a, b): - return SelectableInt((a == b), bits=1) + return onebit(a == b) def gt(a, b): - return SelectableInt((a > b), bits=1) + return onebit(a > b) def ge(a, b): - return SelectableInt((a >= b), bits=1) + return onebit(a >= b) def lt(a, b): - return SelectableInt((a < b), bits=1) + return onebit(a < b) def le(a, b): - return SelectableInt((a <= b), bits=1) + return onebit(a <= b) def length(a): return len(a) diff --git a/src/soc/decoder/pseudo/pywriter.py b/src/soc/decoder/pseudo/pywriter.py index c34945ea..61d6860d 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, length, + ne, eq, gt, ge, lt, le, ltu, gtu, length, trunc_div, trunc_rem) from soc.decoder.selectable_int import SelectableInt from soc.decoder.selectable_int import selectconcat as concat