summaryrefslogtreecommitdiff
path: root/src/gen_lib
AgeCommit message (Collapse)Author
2020-04-10Add Lem builtins for operations on realsThomas Bauereiss
... that match the names in lib/real.sail. Also fix the lem mapping for abs_int_atom and a Lem syntax error with nested record updates.
2020-04-10Implement hex_str for LemThomas Bauereiss
2019-11-07Fix Jenkins buildAlasdair Armstrong
sail2_instr_kinds was in the folder with the old lem interpreter for some reason, rather than with all the other sail2*.lem files
2019-11-07Backport fixes to SMT generation from poly_mapping branchAlasdair Armstrong
2019-08-14Inline reg_deref in Lem outputThomas Bauereiss
2019-07-31Revert "Need to separate out the 0.10 lem library from upcoming 0.11"Alasdair Armstrong
This reverts commit 3fb4cf236c0d4b15831576faa45c763853632568.
2019-07-18Need to separate out the 0.10 lem library from upcoming 0.11Alasdair Armstrong
Unlike the prompt-monad change I don't see a way to do this easily purely on the model side Make sure a64_barrier_type and domain aren't visible for RISC-V isabelle build
2019-07-18Support DMB/DSB domainsShaked Flur
2019-06-18Implement count_leading_zeros in LemThomas Bauereiss
2019-06-06Fix tdiv_int and tmod_int bindings for LemThomas Bauereiss
Also rename them for uniformity with other backends.
2019-04-25More read/write function updatesBrian Campbell
2019-04-25lem gen_lib: update read/write functions to take (dummy) addrsize argument ↵Jon French
as in other places
2019-03-15Lem: Add missing implementations of vector_truncateLSBThomas Bauereiss
2019-02-04Add dec_str builtin to lemAlasdair Armstrong
2019-02-04Test lem output by running end-to-end tests using ocaml via lemAlasdair Armstrong
2019-01-09Merge sail2 into monadsThomas Bauereiss
2019-01-04Add a few helper lemmasThomas Bauereiss
2018-12-23Remove a comment that breaks Isabelle buildThomas Bauereiss
With the new comment syntax, Isabelle seems to barf on that comment, apparently due to the backslashes.
2018-12-18Merge branch 'sail2' into monadsThomas Bauereiss
2018-12-03Add Write_mem event/outcome without tagThomas Bauereiss
The inter-instruction semantics is responsible for correctly handling memory writes without tags; the lifting to the state monad handles it as writing a value with a zero tag bit.
2018-12-03Make names of memory r/w events more consistentThomas Bauereiss
Use E_read_memt for reading tagged memory, as in sail2_impl_base.lem, and rename E_write_mem to E_write_memt, since it always writes a tag.
2018-11-30Rename Undefined outcome to ChooseThomas Bauereiss
It is used for nondeterministic choice, so Undefined might be misleading.
2018-11-29Add separate outcome/event for tagged memory loadsThomas Bauereiss
Lets one distinguish in a trace whether an instruction tried to read tagged memory or just read data without caring about the tag; this is useful for formulating predicates on traces.
2018-11-29Add some helper lemmas to Isabelle libThomas Bauereiss
2018-11-20Use nat instead of (list bitU) for addresses in monad outcomesThomas Bauereiss
Removes some friction by back-and-forth conversion when handling events
2018-10-31Add helper functions in Sail Lem libraryThomas Bauereiss
Running traces, directly accessing memory state
2018-10-31Monad refactoring in Lem shallow embeddingThomas Bauereiss
- Merge tag reading/writing outcomes into memory value reading/writing outcomes - Add effective address to Write_mem; this duplicates information in the Write_ea outcome that should come before, but it makes the effective address more conveniently available in events and traces, and it allows the following simplification in the state monad: - Remove write_ea field from state record; the effective address is now expected as a parameter to the write_memS function - Remove last_exclusive_operation_was_load field from state record; this was used to keep track of exclusive loads, but this was a a relatively coarse approximation anyway, so it might make more sense to track this in (architecture-specific) Sail code. Overall, the state record now simply contains the fields regstate, memstate, tagstate.
2018-10-16Re-implement space-related mapping functions in Sail rather than backendsJon French
Uses new primop 'string_take' which is much easier to implement in e.g. C
2018-09-19separate decimal_string_of_bits from string_of_bitsJon French
2018-09-19src/gen_lib/sail2_string.lem: more Lem monomorphisations for ↵Jon French
hex_bits_N_matches_prefix
2018-07-12Minor fix to support OCaml 4.02.3Shaked Flur
2018-07-11Partially revert change to add_vec_int et alThomas Bauereiss
On second thought, this change should not really make a difference; the CHERI test suite still passes without it. Moreover, using unsigned conversion of the vector argument leads to more convenient lemmas for the provers.
2018-07-11Fix some signedness bugsThomas Bauereiss
add_vec_int and similar functions in the Lem library used unsigned instead of signed conversion.
2018-07-10disable printing when compiling to Lem to keep rmem happyJon French
2018-07-10Aarch64 mono script updateBrian Campbell
2018-07-09Simplify treating of undefined_bool in Lem libraryThomas Bauereiss
Use nondeterministic choice by default instead of a deterministic bitstream generator in the state, which is slightly awkward to reason about, because every use of undefined_boolS changes the state. The previous behaviour can be implemented as Sail code, if desired. Also add a default implementation of internal_pick that nondeterministically chooses an element from a list.
2018-06-25Support bitlist representation in Sail2_stringThomas Bauereiss
2018-06-21Follow Sail2 renaming in Isabelle libraryThomas Bauereiss
2018-06-21changes to riscv model to support rmemJon French
2018-06-14rename all lem support files to sail2_foo to avoid conflict with sail1 in rmemJon French
2018-06-11Merge branch 'sail2' into mappingsJon French
(involved some manual tinkering with gitignore, type_check, riscv)
2018-05-31Fixes to get ARM u-boot working in Sail.Alasdair Armstrong
Also fixes to C backend for compiling MIPS spec to C - Fix an issue with const correctness in internal_vector_update functions generated by C backend - Add builtins for MIPS to sail.h - Fix an issue where reg_deref didn't work when called on pointers to large bitvectors, i.e. vectors containing references to large bitfields as in the MIPS TLB code - Various bug fixes and changes for running U-boot on ARM model, including for interpreter and OCaml compilation. - Fix memory leak issues and incorrect shadowing for foreach loops - Update C header file. Fixes memory leak in memory read/write builtins. - Add aux constructor to ANF representation to hold environment information. - Fix undefined behavior caused by optimisation left shifting uint64_t vectors 64 or more times. Unfortunately there's more issues because the same happens for X >> 64 right shifts. It would make sense for this to be zero, because that would guarantee the property that ((X >> n) >> m) == (X >> (n + m)) but we probably need to do (X >> (n - 1) >> 1) in the optimisation to ensure that we don't cause UB. Shifting by 63 and then by 1 is well-defined, but shifting by 64 in one go isn't according to the C standard. This issue with right-shifts only occurs for zero-length vectors, so it's not a huge deal, but it's still annoying. - Add versions of print_bits and print_int that print to stderr. Follows OCaml convention of print/prerr. Should make things more explicit. Different backends had different ideas about where print should output to, not every backend needs to have this (e.g. theorem prover backends don't need to print) but having both stderr and stdout seperate and clear is useful for executable models (UART needs to be stdout, debug messages should be stderr).
2018-05-23riscv decode now uses mapping-decode and passes testsJon French
2018-05-21further RISCV mapping: all extant non-compressed instructions doneJon French
2018-05-18more riscv mappings; riscv now builds successfully to lem which builds to ↵Jon French
isabelle (but isabelle almost certainly broken)
2018-05-17Use an intermediate base_monad type alias in Lem,Brian Campbell
resolving the difference in type parameters between the prompt and state monads, and allowing a single output file to be used with either. Normally, the type alias is to the prompt monad, but for HOL4 we use the state monad.
2018-05-16Declare hol automatic termination in sail_valuesRamana Kumar
2018-05-11Add Boolean short-circuiting to state monadThomas Bauereiss
2018-05-11Merge branch 'sail2' into cheri-monoThomas Bauereiss
In order to use up-to-date sequential CHERI model for test suite
2018-05-11Remove buggy bit list comparison functions from Lem libraryThomas Bauereiss
Found bugs by running CHERI test suite on Isabelle-exported model: signed less-than for bit lists was missing negations for the two's complement, and unsigned less-than compared the reverse lists. Since all other backends implement this in Sail, it seems best to just remove this code. Also add support for infix operators to Lem backend, by z-encoding their identifiers like the other backends do.