summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-02-01Fix atom -> itself transformation when clauses feature different set of sizesBrian Campbell
2018-02-01Curtail function bodies at known-false assertions during monoBrian Campbell
(preventing non-monomorphised sizes appearing in wildcard cases)
2018-02-01Proper substitution and propagation of size from last commitBrian Campbell
2018-02-01Substitute extra size case splits into body in monomorphisationBrian Campbell
2018-02-01Make mono add case expressions for size tyvars without a corresponding argBrian Campbell
2018-02-01Use the recursive execute for c.addi4spn.Prashanth Mundkur
Conversations with Alexandre/Jon indicate that a BSV generator should be able to deal with this recursion, and Thomas has fixed the Lem generator.
2018-02-01badaddr is a misleading name, since it could contain what the PC points to ↵Prashanth Mundkur
for illegal-instruction exceptions. changed to excinfo.
2018-02-01Comment out special casing of execute function in Lem pretty-printerThomas Bauereiss
It assumes that execute is non-recursive, which is not the case for RISC-V with compressed instructions. Splitting execute into different auxiliary functions for each clause is probably still useful, as Isabelle is likely to parse many small functions faster than one big (potentially recursive) function, but this splitting should be done in the rewriter instead of the pretty-printer, in order to properly deal with recursion.
2018-02-01riscv: avoid name clash with global function 'unsigned'.Robert Norton
2018-02-01Fix a bug where local variables could shadow functionsAlasdair Armstrong
Currently the fix is to disallow this shadowing entirely, because it seems to cause trouble for ocaml.
2018-02-01More work on running sail tests compiled to CAlasdair Armstrong
2018-02-01Remove trace viewer application from repositoryAlasdair Armstrong
2018-02-01Can now compile some simple sail programs to CAlasdair Armstrong
2018-02-01Clean up riscv_duopod sail and add make targets for ocaml and Isabelle.Robert Norton
2018-02-01Add c.addi4spn.Prashanth Mundkur
2018-02-01Fix encoding for compressed ILLEGAL.Prashanth Mundkur
2018-02-01Initial top-level support for compression instructions.Prashanth Mundkur
- introduce the misa register - check the appropriate instruction bits to decide whether it is compressed - check misa.C to decide whether we can execute compressed instructions - add a decodeCompressed function - add two of the most basic RVC instructions: NOP and ILLEGAL
2018-01-31Try to make bitvector pattern rewriting more robustThomas Bauereiss
Look deep into sub-patterns for identifiers and literals instead of relying on assumptions about possible nestings
2018-01-31Fix bug in bitvector pattern rewritingThomas Bauereiss
Make rewriter look into P_typ patterns instead of throwing them away.
2018-01-31More updates to C backend - matching and tuplesAlasdair Armstrong
2018-01-31Added test case for decode patterns that are currently failingAlasdair Armstrong
2018-01-31Find buried set constraints in assertsBrian Campbell
2018-01-31Fix mono continue away optionBrian Campbell
2018-01-31Export arithmetic shift right from Lem libraryThomas Bauereiss
2018-01-31Add Lem operator wrappers for bitlistsThomas Bauereiss
(accidentally committed the wrong file)
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-31add very stripped down 2-instruction RISCV example with add and load.Robert Norton
2018-01-31add some elf files from riscv test suite and run them on riscv model.Robert Norton
2018-01-30Handle 'N == 1 | 'N == 2 | ... style set constraints in monoBrian Campbell
2018-01-30Optionally give *all* monomorphisation errors at onceBrian Campbell
(and stop afterwards unless asked)
2018-01-30Fix monomorphisation analysis to detect type variables which need to beBrian Campbell
concrete but aren't determined by one of the arguments.
2018-01-30Fix failing Lem testsAlasdair Armstrong
2018-01-30Updates to C backendAlasdair Armstrong
2018-01-30riscv prelude: add a to_bits function for converting ints to bits of given ↵Robert Norton
length.
2018-01-30Generate functions from enums to numbers and vice versaAlasdair Armstrong
For an enumeration type T, we can create a function T_of_num and num_of_T which convert from the enum to and from a numeric type. The numeric type is range(0, n) where n is the number of constructors in the enum minus one. This makes sure the conversion is type safe, but maybe this is too much of a hassle. It would be possible to automatically overload all these functions into generic to_enum and from_enum as in Haskell's Enum typeclass, but we don't do this yet. Currently these functions affect a few lem test cases, but I think that is only because they are tested without any prelude functions and pattern rewrites require a few functions to be defined What is really broken is if one tries to generate these functions like enum x = A | B | C function f A = 0 function f B = 1 function f C = 2 the rewriter really doesn't like function clauses like this, and it seems really hard to fix properly (I tried and gave up), this is a shame as the generation code is much more succinct with definitions like above
2018-01-29Fix Lem generation for RISC-VThomas Bauereiss
2018-01-29Add rreg effect to _reg_deref in fix_val_specs rewriteThomas Bauereiss
The internal function _reg_deref is declared as pure, so that bitfield setters can be implemented as read-modify-write, while only having a wreg effect. However, for the Lem shallow embedding, the read step of those setters needs to be embedded into the monad. This could be special-cased in the Lem pretty printer, but then the pretty printer would have to replicate some logic of the letbind_effects rewriting step. It seems simplest to add the effect annotation early in the Lem rewriting pipeline, in the fix_val_specs step. This means that this rewriting step can only be used for other backends if these additional effects are acceptable.
2018-01-29Output a few more type annotations for LemThomas Bauereiss
Allow pretty-printing of existential types, if the existentially quantified variables do not actually appear in the Lem output. This is useful for the bit list representation of bitvectors, as it will print the type annotation "list bitU" for bitvectors whose length depends on an existentially quantified variable.
2018-01-29Add a fixme for unhandled fences but allow them to execute.Prashanth Mundkur
2018-01-29Initial handling of CSR reads/writes.Prashanth Mundkur
2018-01-29Add satp to CSR dummy implemented predicate. Also direct the illegal ↵Prashanth Mundkur
instruction exception through the exception handler.
2018-01-29use check target in makefile when checking riscv spec.Robert Norton
2018-01-29riscv: fix warnings about incomplete patterns. Add a check target in ↵Robert Norton
Makefile which is useful because ocaml generation currently produces some spurious warnings due to running type checker between rewritings.
2018-01-29Sync mono rewrites definitions with libraryBrian Campbell
2018-01-29Look through let expressions when constructing nconstraintsBrian Campbell
(needed for handling guards after atom-to-itself transformation in monomorphisation)
2018-01-29Leave pure if-conditions in place instead of pulling out let-bindingsBrian Campbell
2018-01-29Set maximum split size to work with aarch64 no vectorBrian Campbell
2018-01-29Get typechecking to resolve overriding in remove numeral patterns rewriteBrian Campbell