summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-10-15Ocaml backend: omit function definitions for externsJon French
2018-10-15Interpreter: add new command :bin <addr> <file> to load raw binary into memoryJon French
2018-10-08Interpreter: refactor get/put state into more fine-grained responses in the ↵Jon French
monad
2018-10-08Produce lists of constructors and ast building functions for test generationBrian Campbell
2018-10-05interpreter: Remove boxes (no longer used)Jon French
2018-10-05fix bug in infer_mpat losing types of identifiers inferred from other_envJon French
2018-10-04Merge branch 'ocaml-instruction-generation' into sail2Brian Campbell
2018-10-04Bit of commentary, proper TODO errorBrian Campbell
2018-10-04rename stringappend ids for more readable generated codeJon French
2018-10-03Drop unnecessary thunking; more trouble than it's worthBrian Campbell
2018-10-02Tidy up some whitespaceBrian Campbell
2018-10-02Clean up generator pretty printingBrian Campbell
2018-10-02Remove some old debugging messagesBrian Campbell
2018-10-02Trigger random generator generation with a command line optionBrian Campbell
2018-10-02Rough code to generate random instructions for testingBrian Campbell
(aimed at RISC-V)
2018-10-01Extend Coq pattern match completeness rewrite to let patternsBrian Campbell
2018-10-01New rewriting pass toplevel_string_appendJon French
Handles the common case of a single level string append pattern in a way designed to be friendlier to Coq etc, by generating an auxiliary function for each pattern rather than emitting a massive nested pattern match twice.
2018-09-28Fix optimisation bug for certain if statementsAlasdair Armstrong
When converting to A-normal form I just used the type of the then branch of if statements to get the type of the whole if statement - usually they'd be the same, but with flow typing one of the branches can have a false constraint, which then allows the optimizer to fit any integer into a 64-bit integer causing an overflow. The fix is to correctly use the type the typechecker gives for the whole if statement. Also add decimal_string_of_bits to the C output. Rename is_reftyp to is_ref_typ to be more consistent with other is_X_typ functions in Ast_util.
2018-09-27Add new functions in ast_util.ml for working with locationsAlasdair Armstrong
When constructing expressions, we need to provide locations for the generated expressions to give useful error messages. However adding these at every mk_X function in ast_util would be very verbose, especially for complex expressions. Add new locate_X functions (with the one for expressions simply being called locate), which take a location and recursively apply it to every child node, e.g. locate (gen_loc l) (mk_exp (... (mk_exp ..., mk_exp ...))) would mark every part of the constructed expression as being generated from code at location l.
2018-09-24Coq: avoid variables called tt (the unit constant)Brian Campbell
2018-09-24Coq: add autocasts at monad returnsBrian Campbell
(This leads to more redundant uses, but I'll tackle that later)
2018-09-20Tidy up help text for a few optionsBrian Campbell
2018-09-19Coq: track changes elsewhereBrian Campbell
- more hex_bits functions, add decimal_string_of_bits - extra tuple unfolding in constructors - note that variables can be redundant wildcard clauses - update RISC-V patch
2018-09-19rewrite_defs_pat_string_append: fix bug with guarded SomeJon French
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-09-18Fix issues with tuple Constructors taking multiple argumentsAlasdair Armstrong
This really demonstrates why we should switch to Typ_fn being a typ list * typ constructor because the implementation here feels *really* hacky with dummy Typ_tup constructors being used to enforce single arguments for constructors.
2018-09-18Add string mapping functions to interpreterAlasdair Armstrong
2018-09-17Coq: fix types in aarch64_extras undefined_vector and casts for argumentsBrian Campbell
2018-09-17Coq: solve some constraint/type errors with AArch64Brian Campbell
- hints for dotp - handle exists separately when trying eauto to keep search depth low - more uniform existential handling (i.e., we now handle all existentials in the way we used to only handle existentials around atoms)
2018-09-17Coq: remove an obsolete specialisationBrian Campbell
Broke E_internal_plet on some simple existential types
2018-09-17Rewrites.rewrite_defs_mapping_patterns: emit an explicit type annotation on ↵Jon French
the generated pattern so re-typechecking works
2018-09-14Sail_lib.string_of_bits: print in decimal (properly, with bigints) rather ↵Jon French
than binary
2018-09-14(oops, should have been with "more hex_bits_N monomorphs")Jon French
2018-09-14Sail_lib.int_of_string_opt: use Big_int.of_string rather than OCaml ↵Jon French
int_of_string This fixes e.g. problems with 64-bit bitmask immediates in ARM assembly.
2018-09-14More monomorphisations for hex_bits_N...Jon French
I got bored of this so I wrote a Python script to generate all of them between 1 and 33, plus 48 and 64. It's in a comment. We should really get around to making the typechecker work with polymorphic mappings...
2018-09-14Sail_lib and RISCV prelude: functions for bitwise operations on intsJon French
2018-09-14Type_check: allow mappings to contain escape effectsJon French
2018-09-13C: Fix an issue with assigning to unitialized variables at end of blocksAlasdair Armstrong
Assigning to an uninitialized variable as the last statement in a block is almost certainly a type, and if that occurs then the lift_assign re-write will introduce empty blocks causing this error to occur. Now when we see such an empty block when converting to A-normal form we turn it into unit, and emit a warning stating that an empty block has been found as well as the probable cause (uninitialized variable).
2018-09-13Coq: real built-ins for AArch64Brian Campbell
2018-09-12Jenkins: Fix deprecation warningsAlasdair Armstrong
Now that Jenkins is updated to a newer version of OCaml we can finally fix some warning with more recent versions of OCaml than 4.02.3. Also fix a Lem test case that was failing.
2018-09-12Coq: fix type annotations for early returnBrian Campbell
2018-09-12Coq: avoid some use of pattern binders to help Coq's type checkerBrian Campbell
2018-09-12Coq: print more type information for existentially typed vectorsBrian Campbell
2018-09-11Coq: some basic handling for more existentialsBrian Campbell
2018-09-11Coq: remove a bunch of Lem-ismsBrian Campbell
In particular, the complicated "what nexps are in scope" test can be replaced by a simple "are the nvars in scope" check.
2018-09-10Various fixesAlasdair Armstrong
C: Don't print usage message and quit when called with no arguments, as this is used for testing C output OCaml: Fix generation of datatypes with multiple type arguments OCaml: Generate P_cons pattern correctly C: Fix constant propagation to not propagate letbindings with type annotations. This behaviour could cause type errors due to how type variables are introduced. Now we only propagate letbindings when the type of the propagated variable is guaranteed to be the same as the inferred type of the binding. Tests: Add OCaml tests to the C end-to-end tests (which really shouldn't be in test/c/ any more, something like test/compile might be better). Currently some issues with reals there like interpreter. Tests: Rename list.sail -> list_test.sail because ocaml doesn't want to compile files called list.ml.
2018-09-06C: Fix a bug with shadowing in nested let-bindingsAlasdair
2018-09-06Allow options to be set in the interactive modeAlasdair Armstrong
Also allow options to be set via a pragma in Sail files
2018-09-04C: add an option to control generation of main().Prashanth Mundkur