diff options
| author | Alasdair Armstrong | 2018-09-18 14:45:53 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-09-18 14:46:34 +0100 |
| commit | c4da9fa2a17ee965fb465da7943f1665dca4ffec (patch) | |
| tree | d9624d917fbf85cc52cff2bd43efeefc40ea8921 /src/value.ml | |
| parent | 2e5f724930878f69d32c4efaa57c29a8e2bf244c (diff) | |
Add string mapping functions to interpreter
Diffstat (limited to 'src/value.ml')
| -rw-r--r-- | src/value.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/value.ml b/src/value.ml index 76d02850..6c9990a1 100644 --- a/src/value.ml +++ b/src/value.ml @@ -514,6 +514,10 @@ let value_gteq_real = function | [v1; v2] -> V_bool (Sail_lib.gteq_real (coerce_real v1, coerce_real v2)) | _ -> failwith "value gteq_real" +let value_string_append = function + | [v1; v2] -> V_string (Sail_lib.string_append (coerce_string v1, coerce_string v2)) + | _ -> failwith "value string_append" + let primops = List.fold_left (fun r (x, y) -> StringMap.add x y r) @@ -612,4 +616,8 @@ let primops = ("replicate_bits", value_replicate_bits); ("Elf_loader.elf_entry", fun _ -> V_int (!Elf_loader.opt_elf_entry)); ("Elf_loader.elf_tohost", fun _ -> V_int (!Elf_loader.opt_elf_tohost)); + ("string_append", value_string_append); + ("string_length", value_string_length); + ("string_startswith", value_string_startswith); + ("string_drop", value_string_drop); ] |
