summaryrefslogtreecommitdiff
path: root/src/lem_interp
diff options
context:
space:
mode:
authorThomas Bauereiss2018-01-22 20:56:07 +0000
committerThomas Bauereiss2018-01-22 22:10:44 +0000
commitb3f5dd5bac689bee9770081215bd0b1fe1071084 (patch)
tree1953899ef9810ee5c60640a7b28e3f465a3cba0e /src/lem_interp
parent4cafba567b6610b239ab6b82b89073a1a8a49632 (diff)
Update Lem shallow embedding to Sail2
- Remove vector start indices - Library refactoring: Definitions in sail_operators.lem now use Bitvector type class and work for both bit list and machine word representations - Add Lem bindings to AArch64 and RISC-V preludes TODO: Merge specialised machine word operations from sail_operators_mwords into sail_operators.
Diffstat (limited to 'src/lem_interp')
-rw-r--r--src/lem_interp/sail_impl_base.lem6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lem_interp/sail_impl_base.lem b/src/lem_interp/sail_impl_base.lem
index 368f7505..219677ac 100644
--- a/src/lem_interp/sail_impl_base.lem
+++ b/src/lem_interp/sail_impl_base.lem
@@ -102,6 +102,12 @@ type direction =
| D_increasing
| D_decreasing
+let dir_of_bool is_inc = if is_inc then D_increasing else D_decreasing
+let bool_of_dir = function
+ | D_increasing -> true
+ | D_decreasing -> false
+ end
+
(* at some point this should probably not mention bit_lifted anymore *)
type register_value = <|
rv_bits: list bit_lifted (* MSB first, smallest index number *);