summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-24Have some simple sail programs compiling to CAlasdair Armstrong
2018-01-24Fixed riscv ocaml compilationAlasdair Armstrong
2018-01-24More work on C compilationAlasdair Armstrong
2018-01-24More work on experimental C backendAlasdair Armstrong
2018-01-23Merge branch 'sail2' of https://bitbucket.org/Peter_Sewell/sail into sail2Alasdair Armstrong
2018-01-23Started working on C backend for sailAlasdair Armstrong
Also updated some of the documentation in the sail source code
2018-01-23Run tests for Lem shallow embeddingThomas Bauereiss
Uses the typechecker tests for now. Also fix two minor bugs in pretty-printer and rewriter uncovered by the tests.
2018-01-23Added additional tests, and fixed ocaml build of ARM testsAlasdair Armstrong
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-22Added rewriter that specializes all function calls in a specification.Alasdair Armstrong
This removes all type polymorphism, so we can generate optimized bitvector code and compile to languages without parametric polymorphism.
2018-01-22Add regression test for type synonym with constraints inside existential ↵Alasdair Armstrong
typechecking bug
2018-01-22Update and fix test suiteAlasdair Armstrong
2018-01-19Added RISCV test case to test suiteAlasdair Armstrong
2018-01-19Added C-style single line commentsAlasdair Armstrong
// is a comment as well as /* is a comment */
2018-01-19Got riscv spec to typecheck with sail2Alasdair Armstrong
Fix a typechecking bug involving constraints attached to type synonyms within existentials.
2018-01-19riscv sail2 wip.Robert Norton
2018-01-19Merge branch 'sail2' of https://bitbucket.org/Peter_Sewell/sail into sail2Alasdair Armstrong
2018-01-19Start translating riscv to sail2Alasdair Armstrong
2018-01-19Make merlin aware of findlib packagesBrian Campbell
2018-01-19Update monomorphisation for sail2Brian Campbell
(no vector type start position, comment syntax)
2018-01-18Clean up command line options slightlyAlasdair Armstrong
Changed -mono-split to -mono_split to be consistent with other options that use underscores, -mono-split still works but gives a warning message, just so nothing breaks immediately because of this. Removed this sil commands since they really don't do anything right now.
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-18Add elf_loader fileAlasdair Armstrong
2018-01-18Modified unification so Type_check.instantiation_of works after sizeof rewritingAlasdair Armstrong
This change allows the AST to be type-checked after sizeof re-writing. It modifies the unification algorithm to better support checking multiplication in constraints, by using division and modulus SMT operators if they are defined. Also made sure the typechecker doesn't re-introduce E_constraint nodes, otherwise re-checking after sizeof-rewriting will re-introduce constraint nodes.
2018-01-17Use right effect annotations in early return rewritingThomas Bauereiss
Also drop redundant unit expressions when concatenating with an empty block.
2018-01-17Try to remove early returns more aggressivelyThomas Bauereiss
In particular, there is an ASL pattern with single-branch if-expressions containing an early return (and an empty else-branch), e.g. { ... if (error) then return(Fault) else (); ... return(Success); } The rewriting pass now tries to fold the rest of the block into the else-branch, since it is unreachable after the then-branch, e.g. { ... if (error) then return(Fault) else { ... return(Success); } } In combination with other rewriting rules, this allows the rewriting pass to pull out the early returns if *all* branches end in a return statement. If it is possible to pull out the return all the way, i.e., so that the function body is a single return statement, then the return can be removed. If that is not possible, then the function body is left as it was originally.
2018-01-17Rewrite topological sortingThomas Bauereiss
Use Tarjan's algorithm for finding strongly connected components (and finding a topological sorting of components at the same time), in order to properly take into account mutually recursive functions. The sorting is stable, i.e., definitions are only moved when necessary. Exceptions to this are statements that do not have any dependencies: default bitvector order declarations, operator fixity declarations, and top-level comments. These are moved to the beginning (like with the previous sorting implementation). Any dependency cycles that are found are additionally printed to the console in dot-format, for easy visualisation with graphviz.
2018-01-17Add generated ARM spec and test cases for itAlasdair Armstrong
We add the generated ARM no_vector spec from the public v8.3 XML release, mostly so that we can add end-to-end test cases for sail using it. This kind of large example is very useful for thoroughly testing the sail compiler and interpreter.
2018-01-17Fix use of nexps in type annotations when not using machine wordsThomas Bauereiss
2018-01-16Test the ocaml interpreter with the same tests as the ocaml compilationAlasdair Armstrong
2018-01-16Improve formatting of output when running all test suites.Alasdair Armstrong
2018-01-16Created version of typecheck test suite for sail2 branchAlasdair Armstrong
Currently doesn't try to compile to lem or use the MIPS spec All the failing tests have been removed because I intend to handle them differently - they were very fragile before because there was no indication of why they failed, so as sail evolved they tended to start failing for the wrong reasons and not testing what they were supposed to.
2018-01-16Fix problem with let-bindings in pattern guardsThomas Bauereiss
Monomorphisation sometimes produces pattern guard with let-bindings, e.g. | ... if (let regsize = size_itself(regsize) in eq(regsize, 32)) -> ... Previously, the rewriting pass for let-bindings (and pattern guards) pulled these out of the guard condition and into the same scope as the case expression, which potentially clashed with let-bindings for the same variables in that case expression. The rewriter now leaves let-bindings in place within pure if-conditions, solving this problem.
2018-01-16Output more type annotations in Lem backendThomas Bauereiss
Keep track of which type variables have been bound in the function declaration, and allow those to be pretty-printed
2018-01-16Handle for loops correctly when rewriting size parametersBrian Campbell
2018-01-16Another useful monomorphisation rewriteBrian Campbell
2018-01-15Add help to interactive mode, and load files incrementallyAlasdair Armstrong
2018-01-15Check monomorphisation case split size once for each patternBrian Campbell
(rather than for each argument separately)
2018-01-15Refactored and improved ocaml interpreterAlasdair Armstrong
2018-01-15Support non-trivial literal patternsBrian Campbell
Previously we only did top-level literal pattern to guard conversion, this does it throughout any pattern
2018-01-12Interpreter can now pass local values by referenceAlasdair Armstrong
2018-01-12Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-12Try to keep types for undefined around during monomorphisationBrian Campbell
Otherwise the type checker can't figure it out when we substitute
2018-01-12Merge remote-tracking branch 'origin/experiments' into sail2Alasdair Armstrong
2018-01-12OCaml interactive mode can now run full aarch64 examples, and ocaml test cases.Alasdair Armstrong
2018-01-12Remove generic comparisonBrian Campbell
2018-01-12Support constant propagation on casts in monomorphisationBrian Campbell
2018-01-11Ocaml semantics can now run aarch64 hello world example using octapodAlasdair Armstrong
New testcase for bitfield syntax Updated to work with latest lem and linksem
2018-01-10Add an all_split_errors optionBrian Campbell