summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-02-26work around linksem crashing when trying to print an elf file where ↵Robert Norton
entry_point overflows an ocaml int.
2018-02-26Fix missing case in pattern completeness checkAlasdair Armstrong
Fixes #4
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-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-23Allow guarded patterns rewrite to merge P_var patternsBrian Campbell
2018-02-23Merge branch 'sail2' of github.com:rems-project/sail into sail2Robert Norton
2018-02-23Some tidy up of sail library - use extract_num from Big_int to implement ↵Robert Norton
to_get_slice_int in less confusing way. Add arithmetic shift right.
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-22Curtail at more false assertionsBrian Campbell
(plus some adjustments for the test case)
2018-02-22Merge branch 'sail2' of github.com:rems-project/sail into sail2Robert Norton
2018-02-22wipRobert Norton
2018-02-22Some Lem/OCaml compatibility fixesBrian Campbell
2018-02-22Point merlin at pprint buildBrian Campbell
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-21Implement more builtins in constant propagationBrian Campbell
2018-02-21Cut out dead if branches according to the type environment during monoBrian Campbell
const progagation. Needed to avoid negative bitvector sizes on aarch64 Also propagate values found from "if var = const ...", which is needed in aarch64
2018-02-21Create an update_field function for each field in a bitfield definitionAlasdair Armstrong
2018-02-21Have aarch64/no_vector compiling to CAlasdair Armstrong
Just need to implement builtins, fix-up a few re-write passes, and integrate some kind of elf-loading and it should work.
2018-02-21clean LICENCEPeter Sewell
2018-02-20Remove temporary debugging messageBrian Campbell
2018-02-20Bump up case split limit for nowBrian Campbell
2018-02-20Simplifying nexp division, since the type checker can introduce itBrian Campbell
(otherwise you end up with div(64,8) in output sizes!)
2018-02-20Report unsupported nexps properly in Lem backendBrian Campbell
2018-02-20Rework atom-to-itself transformation to check for equivalent size nexpsBrian Campbell
2018-02-20Look for alternative size annotations when pretty printing LemBrian Campbell
(so that we get enough type annotations for bitvectors)
2018-02-20Allow overlapping bitfield field namesAlasdair Armstrong
Allows bitfields to share field names by generating accessors as _get/set_name_field where name is the type name and field is the field name rather than _get/set_field. They are still accessed and set using just register.field() and register.field() = value. Fixes #1
2018-02-19Have generic vectors working in C backendAlasdair Armstrong
2018-02-17Merge master branch into sail2 for OCaml 4.06 compatibilityThomas Bauereiss
2018-02-16Avoid nested explicit type annotationsThomas Bauereiss
Isabelle does not like nested annotations like "((exp :: typ) :: typ)".
2018-02-16Don't generate undefined functions for generated register typesThomas Bauereiss
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-16Can now compile aarch64/duopod to CAlasdair Armstrong
Goes through the C compiler without any errors, but as we still don't have all the requisite builtins it won't actually produce an executable. There are still a few things that don't work properly, such as vectors of non-bit types - but once those are fixed and the Sail library is implemented fully it should work.
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-15C backend can now handle record literals and record update syntax correctlyAlasdair Armstrong
2018-02-15Update duopod spec so it has no address translationAlasdair Armstrong
Also update the main aarch64 (no_vector) spec with latest asl_parser
2018-02-15List support in C backendAlasdair Armstrong
2018-02-14Another mono rewrite for aarch64Brian Campbell
2018-02-14Support monorphisation analysis of bitvectors inside existentialsBrian Campbell
2018-02-14Pick up more equivalent type variables in monomorphisationBrian Campbell
2018-02-14Handle simple returns in constant propagationBrian Campbell
Useful for feature functions, e.g. HaveFP16Ext
2018-02-13Support for large bitvector literals in C backendAlasdair Armstrong
2018-02-13Try to replace generated kids with user-defined ones from the environmentThomas Bauereiss
Solves a problem where generated kids crept into type annotations during rewriting and caused later typechecking passes to fail.
2018-02-13Some support in mono for extra fresh tyvars generated in the typecheckerBrian Campbell
(still some work to do in AtomToItself rewrite, but should work despite error messages)
2018-02-12Add support for top-level letbindings to C backendAlasdair Armstrong
2018-02-09Improve IR pretty-printing for debuggingAlasdair Armstrong
2018-02-09Formalize C backend intermediate representation in OttAlasdair Armstrong
Describes precisely the intermediate representation used in the C backend in an ott grammar, and also removes several C-isms where raw C code was inserted into the IR, so in theory this IR could be interpreted by a small VM/interpreter or compiled to LLVM bytecode etc. Currently the I_raw constructor for inserting C code is just used for inserting GCC attributes, so it can safely be ignored. Also augment and refactor the instruction type with an aux constructor so location information can be propagated down to this level.
2018-02-08Can now generate control flow graphs with C backendAlasdair Armstrong
Option -ddump_flow_graphs when used with -c will create graphviz files for each function in the specification with control and data dependencies shown.
2018-02-08work in progress mips sail2 port.Robert Norton