summaryrefslogtreecommitdiff
path: root/src/sail_lib.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-03-12 18:57:57 +0000
committerAlasdair Armstrong2018-03-12 19:01:19 +0000
commitcf8efbe63da569dadbd99eb35c1e4777fa06bc30 (patch)
tree936406a74fb05b55f0f329cc0ee9027806c330b7 /src/sail_lib.ml
parenta6d59b97a4840b81481751e0e05b1da9ed28de86 (diff)
ELF loading for C backend
Add a flag to Sail that allows for an image of an elf file to be dumped in a simple format using linksem, used as sail -elf test.elf -o test.bin This image file can then be used by a compiled C version of a sail spec as with ocaml simply by ./a.out test.bin
Diffstat (limited to 'src/sail_lib.ml')
-rw-r--r--src/sail_lib.ml3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sail_lib.ml b/src/sail_lib.ml
index 252d815d..8b3e2313 100644
--- a/src/sail_lib.ml
+++ b/src/sail_lib.ml
@@ -556,7 +556,6 @@ let zero_extend (vec, n) =
then take m vec
else replicate_bits ([B0], Big_int.of_int (m - List.length vec)) @ vec
-
let sign_extend (vec, n) =
let m = Big_int.to_int n in
match vec with
@@ -576,7 +575,7 @@ let shiftr (x, y) =
let zeros = zeros y in
let rbits = zeros @ x in
take (List.length x) rbits
-
+
let shift_bits_right (x, y) =
shiftr (x, uint(y))