summaryrefslogtreecommitdiff
path: root/src/gen_lib/state.lem
AgeCommit message (Collapse)Author
2017-09-28Merge branch 'experiments' into mono-experimentsBrian Campbell
2017-09-27Add while-loops to Lem backendThomas Bauereiss
2017-09-04Merge branch 'experiments' of bitbucket.org:Peter_Sewell/sail into ↵Brian Campbell
mono-experiments
2017-09-02Remove dependency of state.lem on bitvector operationsThomas Bauereiss
2017-08-28Merge branch 'experiments' of bitbucket.org:Peter_Sewell/sail into ↵Brian Campbell
mono-experiments # Conflicts: # src/gen_lib/sail_values.lem
2017-08-24Improve and simplify handling of mutable local variablesThomas Bauereiss
2017-08-24Begin refactoring Sail libraryThomas Bauereiss
- Add back support for bit list representation of bit vectors, for backwards compatibility in order to ease integration with the interpreter. For this purpose, split out a file sail_operators.lem from sail_values.lem, and add a variant sail_operators_mwords.lem for the machine word representation of bitvectors. Currently, Sail is hardcoded to use machine words for the sequential state monad, and bit lists for the free monad, but this could be turned into a command line flag. - Add a prelude_wrappers.sail file for glueing the Sail prelude to the Lem library. The wrappers make use of sizeof expressions to extract type information from bitvectors (length, start index) in order to pass it to the Lem functions. - Add early return support to the free monad, using a new constructor "Return of 'r". As with the sequential monad, functions with early return are wrapped into "catch_early_return", which extracts the return value at the end of the function execution.
2017-08-23Update monomorphisation test scriptBrian Campbell
2017-08-17Add support for register types other than bitvector to state monadThomas Bauereiss
Make state monad parametric in register state, and generate a record with registers from the Sail spec
2017-08-15Improve and simplify handling of mutable local variablesThomas Bauereiss
2017-08-10Add support for early return to Lem backendThomas Bauereiss
Implemented using the exception monad, by throwing and catching the return value
2017-08-08Glue together Sail prelude and Lem libraryThomas Bauereiss
2017-06-21Pretty-print bitvector expressionsThomas Bauereiss
- Add case distinctions between bitvector types and vectors of other element types (e.g. registers) and use the corresponding operations (i.e. "bvslice", "bvaccess", etc for the former, and "slice", "access", etc for the latter) when pretty-printing expressions - Add type annotations to expressions when the type includes bitvectors with concretely known length - Update state.lem to use bitvectors (in the interface, at least; internally, bitvectors are still stored as bit lists for now, since that makes it easier to support storing different registers with different lengths) This has been tested with the CHERI-MIPS model with some success, but some things are still missing: - Bitvector patterns are not handled yet - Some bitvector length monomorphisation is needed in a few places of the model - Some type annotations are missing, because the (old) Sail type checker does not infer bitvector lengths in some instances where one would hope it to do that; this should be checked with the new type checker
2017-06-02Add tag memory to Lem shallow embeddingThomas Bauereiss
2017-05-24fixed missing _tag bitsShaked Flur
2017-05-24added the exmem effect for AArch64 store-exclusiveShaked Flur
2017-03-23the interpreter/shallow expects little-endian memory-valuesShaked Flur
2016-11-15wrap state monad into list monoad for non-deterministic write exclusive ↵Christopher Pulte
operations
2016-11-14add option -lem_sequential for producing shallow embedding that refers to ↵Christopher Pulte
state monad, library fixes
2016-11-10rewrite state.lemChristopher Pulte
2016-10-06move type definitions that both interpreter and shallow embedding use to ↵Christopher Pulte
sail_impl_base, add sail_impl_base.outcome, add interp_inter_imp auxiliary functions, make prompt use sail_impl_base.outcome
2016-09-25nicer lem output: no more unecessary 'unit' returns if if-expressions, ↵Christopher Pulte
for-loops or case-expressions also return updated variables
2016-09-23sail-to-lem progressChristopher Pulte
2016-09-19sail-to-lem progressChristopher Pulte
2016-09-07push some lem pp changesChristopher Pulte
2016-07-12sail-to-lem and lem library fixesChristopher
2015-12-21fixes, pp progressChristopher
2015-12-09adapted for Kathy's lexp effect typing changes: register writes should be ↵Christopher
correct now, fixes, pp
2015-12-07adapted pp for Kathy's effect type changesChristopher
2015-12-03added prompt.lem for connecting to concurrency model and ↵Christopher Pulte
{power,armv8}_extras.lem; fixes
2015-11-19fixes for cumulative effect anotationsChristopher Pulte
2015-11-13fixes, more ppChristopher Pulte
2015-11-10rewriting fixes, syntactically correct lem syntax, number type errors remainingChristopher Pulte
2015-11-06progress on generating function for read/writing register fieldsChristopher Pulte
2015-11-05some progress on lem backend: rewrite away mutable variable assignments, ↵Christopher Pulte
rewrite for-loops, if/case-expressions to return updated variables
2015-10-28progress on lem backend: auto-generate read_register and write_register ↵Christopher Pulte
functions, and state definition