From cf8efbe63da569dadbd99eb35c1e4777fa06bc30 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 12 Mar 2018 18:57:57 +0000 Subject: 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 --- src/sail_lib.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/sail_lib.ml') 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)) -- cgit v1.2.3