summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-02-26Rename some Isabelle theoriesThomas Bauereiss
The suffix _lemmas is more descriptive than _extras.
2018-02-26Add/generate Isabelle lemmas about the monad liftingThomas Bauereiss
Architecture-specific lemmas about concrete registers and types are generated and written to a file <prefix>_lemmas.thy, generic lemmas are in the theories *_extras.thy in lib/isabelle. In particular, State_extras contains simplification lemmas about the lifting from prompt to state monad.
2018-02-24Fix C builtinsAlasdair Armstrong
2018-02-23Fix some bugs in C compilationAlasdair Armstrong
Fixed an issue with pattern matching on enums Fixed an issue whereby fix_early_returns would cause memory leaks Added optimizations for some of the builtins used in the decode function. Optimizations are turned on with the -O flag.
2018-02-22More updates to C backendAlasdair Armstrong
Add support for short-ciruiting and/or. I forgot about this in the original ANF specification and not having it causes problems for the ARM spec.
2018-02-21Can now compile aarch64/no_vector into CAlasdair Armstrong
Now compiles to C and builds a working executable. Just need to correctly implement all the library builtins (some are still stubs), and it should work.
2018-02-19Have generic vectors working in C backendAlasdair Armstrong
2018-02-16Add __TakeColdReset function to aarch64_no_vectorAlasdair Armstrong
Turns out the __TakeColdReset function is actually in the v8.3 XML. I went and looked for it, and it's there, it just wasn't being picked up by ASL parser because it's not called from any instructions. I added a new field to the json config files for ASL parser that can tell it about any such special functions that it should guarantee to include. Also fixed a bug in C loop compilation
2018-02-16Add alternative definitions of aarch64 functions for monomorphisationBrian Campbell
2018-02-15Rebase state monad onto prompt monadThomas Bauereiss
Generate only one Lem model based on the prompt monad (instead of two models with different monads), and add a lifting from prompt to state monad. Add some Isabelle lemmas about the monad lifting. Also drop the "_embed" and "_sequential" suffixes from names of generated files.
2018-02-15Re-engineer prompt monad of Lem shallow embeddingThomas Bauereiss
- Use simplified monad type (e.g., without the with_aux constructors that are not needed by the shallow embedding). - Add support for registers with arbitrary types (e.g., records, enumerations, vectors of vectors). Instead of using bit lists as the common representation of register values at the monad interface, use a register_value type that is generated per spec as a union of all register types that occur in the spec. Conversion functions between register_value and concrete types are generated. - Use the same representation of register references as the state monad, in preparation of rebasing the state monad onto the prompt monad. - Split out those types from sail_impl_base.lem that are used by the shallow embedding into a new module sail_instr_kinds.lem, and import that. Removing the dependency on Sail_impl_base from the shallow embedding avoids name clashes between the different monad types. Not yet done: - Support for reading/writing register slices. Currently, a rewriting pass pushes register slices in l-expressions to the right-hand side, turning a write to a register slice into a read-modify-write. For interfacing with the concurreny model, we will want to be more precise than that (in particular since some specs represent register files as big single registers containing a vector of bitvectors). - Lemmas about the conversion functions to/from register_value should be generated automatically.
2018-02-15List support in C backendAlasdair Armstrong
2018-02-14Another mono rewrite for aarch64Brian Campbell
2018-02-13Support for large bitvector literals in C backendAlasdair Armstrong
2018-02-08Add (most of) the bitvector cast insertion transformationBrian Campbell
to help Lem go from a general type `bits('n)` to a specific type `bits(16)` at a case split, and the other way around for a returned value. Doesn't handle function clause patterns yet
2018-02-06Compile union types in C backendAlasdair Armstrong
2018-02-02Add arithmetic shift right for aarch64 monoBrian Campbell
2018-02-01More work on C compilationAlasdair Armstrong
Can now compile things like early returns. The same approach should work for exception handling as well. Once that's in place, just need to work a bit more on getting union types to work + the library of builtins, then we should be able to compile and run some of our specs via C. Also added some documentation in comments for the general approach taken when compiling (need many more though).
2018-01-31More updates to C backend - matching and tuplesAlasdair Armstrong
2018-01-31Add wrappers around Lem operators using bitvector type classThomas Bauereiss
Makes bitvector typeclass instance dictionaries disappear from generated Isabelle output.
2018-01-31Split base definitions of Lem monads and further built-ins (e.g. loop ↵Thomas Bauereiss
combinators) Add Isabelle-specific theories imported directly after monad definitions, but before other combinators. These theories contain lemmas that tell the function package how to deal with monadic binds in function definitions.
2018-01-30Fix failing Lem testsAlasdair Armstrong
2018-01-29Sync mono rewrites definitions with libraryBrian Campbell
2018-01-29Shaked removing generation of now-uncessary uint dependencyPeter Sewell
2018-01-26Fixed loading ARM elf filesAlasdair Armstrong
Also refactored the hand written ARM prelude and pulled out some common functionality into files in sail/lib
2018-01-26One more mono rewriteBrian Campbell
2018-01-22Update Lem shallow embedding to Sail2Thomas Bauereiss
- Remove vector start indices - Library refactoring: Definitions in sail_operators.lem now use Bitvector type class and work for both bit list and machine word representations - Add Lem bindings to AArch64 and RISC-V preludes TODO: Merge specialised machine word operations from sail_operators_mwords into sail_operators.
2018-01-22Update and fix test suiteAlasdair Armstrong
2018-01-19Update monomorphisation for sail2Brian Campbell
(no vector type start position, comment syntax)
2018-01-18Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-18Modified ocaml backend to use ocamlfind for linksem and lemAlasdair Armstrong
Fixed test cases for ocaml backend and interpreter
2018-01-16Another useful monomorphisation rewriteBrian Campbell
2018-01-12Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-09More monomorphisation rewrites for aarch64Brian Campbell
2018-01-09Add some optional experimental rewrites to help with monomorphisationBrian Campbell
2017-12-14An experimental version of sail without bitvector start indexes.Alasdair Armstrong
Works with the vector branch of asl_parser
2017-12-14Merge remote-tracking branch 'origin/experiments' into interactiveAlasdair Armstrong
2017-12-13Cleanup code by fixing compiler warnings, and fix ocaml compilationAlasdair Armstrong
Add the ast.sed script we need to build sail. Currently we just need this to fix up the locations in the AST but it will be removed once we can share locations between ocaml and lem.
2017-12-12Add a few helper functions for bit listsThomas Bauereiss
2017-12-07Support monomorphisation with set constrained integersBrian Campbell
Also, to support this, constant propagation for integer multiply, fix substitution of concrete values for nvars, size parameters in single argument functions, fix kind for itself, add eq_atom to prelude
2017-12-06Merge remote branch 'experiments' into experimentsThomas Bauereiss
2017-12-06Make AST after rewriting for Lem backend type-checkableThomas Bauereiss
- Add support for some internal nodes to type checker - Add more explicit type annotations during rewriting - Remove hardcoded rewrites for E_vector_update etc from Lem pretty-printer; these will be resolved by the type checker during rewriting now
2017-11-28Small update to trivial sizeof rewrites so we can handle all cases inAlasdair Armstrong
aarch64 vector instructions. There's maybe a better more general way to do this but I'm not sure what that would be.
2017-11-27Compile assertions into OCamlAlasdair Armstrong
and_bool and or_bool now are treated specially in the ocaml backend, so that they have the correct short-circuiting behaviour. This is required so that assertions don't fail for the ARM spec for predicates that shouldn't be tested in certain circumstances, for example things like: IsAArch32() && AArch32_specific_predicate Also fixed an issue in the sail library for ocaml where greater than or equal to was being mapped to greater than.
2017-11-21Expose entry point in elf_loader for Sail modelAlasdair Armstrong
2017-11-15Additional test case for OCaml backendAlasdair Armstrong
2017-11-15Simplify flow typing code in typecheckerAlasdair Armstrong
2017-11-10Fixed ocaml backend so it correctly compiles registers passed by name.Alasdair Armstrong
Added a test case for this behavior
2017-11-08Merge branch 'experiments' of https://bitbucket.org/Peter_Sewell/sail into ↵Alasdair Armstrong
experiments
2017-11-07Add builtin for reversing endiannessThomas Bauereiss