summaryrefslogtreecommitdiff
path: root/src/Makefile
AgeCommit message (Collapse)Author
2019-12-13move ott pp to different Makefile rulePeter Sewell
2019-12-13experiment in ott-generated ppPeter Sewell
2019-10-28Fix jib.ott and SMT regressionsAlasdair Armstrong
SMT seems sensitive to gensym counter being reset between definitions, but it shouldn't care due to unique_per_function_ids... need to investigate further. Only causes a single test to fail so must be subtle. Diffing between the bad/good versions reveals a few lines of generated SMT go missing when the gensym counter is reset.
2019-10-28Some C backend refactoringAlasdair
Make it so that jib_compile.ml never relies on specific string encodings for various constructs in C. Previously this happened when monomorphisation occured for union constructors and fields, i.e. x.foo -> x.zfoo_bitsz632z7 Now identifiers that can be modified are represented as (id, ctyp list) tuples, so we can keep the types x.foo -> x.foo::<bits(32)> This then enables us to do jib IR -> jib IR rewrites that modify types In particular there is now a rewrite that removes tuples as an IR->IR pass rather than doing it ad-hoc in the C code generation, although this is not on by default Note that this change seems to have triggered an Ott bug so jib.lem is now checked in and not generated from Ott
2019-04-17Build libsail again (removed Bytcode and Share_directory)Shaked Flur
2019-04-16Temporarily remove Makefile part that is making Jenkins failAlasdair Armstrong
Comment out some interpreter tests that go into infinite loops because those will cause issues for Jenkins.
2019-03-14Merge branch 'sail2' into rmem_interpreterJon French
2019-03-13package and install Sail as an ocamlfind libraryJon French
2019-03-08C: Refactor C backendAlasdair Armstrong
Main change is splitting apart the Sail->IR compilation stage and the C code generation and optimization phase. Rather than variously calling the intermediate language either bytecode (when it's not really) or simply IR, we give it a name: Jib (a type of Sail). Most of the types are still prefixed by c/C, and I don't think it's worth changing this. The various parts of the C backend are now in the src/jib/ subdirectory src/jib/anf.ml - Sail->ANF translation src/jib/jib_util.ml - various Jib AST processing and helper functions (formerly bytecode_util) src/jib/jib_compile.ml - Sail->Jib translation (using Sail->ANF) src/jib/c_backend.ml - Jib->C code generator and optimizations Further, bytecode.ott is now jib.ott and generates jib.ml (which still lives in src/ for now) The optimizations in c_backend.ml should eventually be moved in a separate jib_optimization file. The Sail->Jib compilation can be parameterised by two functions - one is a custom ANF->ANF optimization pass that can be specified on a per Jib backend basis, and the other is the rule for translating Sail types in Jib types. This can be more or less precise depending on how precise we want to be about bit-widths etc, i.e. we only care about <64 and >64 for C, but for SMT generation we would want to be as precise as possible. Additional improvements: The Jib IR is now agnostic about whether arguments are allocated on the heap vs the stack and this is handled by the C code generator. jib.ott now has some more comments explaining various parts of the Jib AST. A Set module and comparison function for ctyps is defined, and some functions now return ctyp sets rather than lists to avoid repeated work.
2019-02-25Merge branch 'sail2' into rmem_interpreterJon French
2019-02-13Attempt to parse sail version from opam file for manifest.ml. Update version ↵Robert Norton
in opam file in anticipation of release and add yojson dependency.
2019-02-13Merge branch 'sail2' into rmem_interpreterJon French
2019-02-08Cleanup src MakefileAlasdair
When we are building from git, we put the git version info in manifest.ml, so we'll get the following from sail -v Sail $last_git_tag ($branch @ $commit_sha) If we are be built from opam we can't assume we are in a git repository as opam downloads specific tags as tarballs, so instead we check for the precense of SHARE_DIR which is set by our opam build script, and instead output Sail 0.8 (sail2 @ opam) which is the next git tag (current is 0.7.1, this must be updated by hand), the branch name from which opam releases are generated and then opam rather than the commit SHA. I also removed the Makefile-non-opam file as it's bitrotted and unused
2018-12-26Add makefile target for building with Bisect coverageAlasdair Armstrong
2018-12-20Make sure sail -v prints useful version infoAlasdair Armstrong
2018-10-24src/Makefile: add isail.byte target for debugging interpreterJon French
2018-06-08Correct dependencies of bytecode sailBrian Campbell
2018-04-26Add a new SHARE_DIR argument to use when doing opam build. For non-opam ↵Robert Norton
builds this defaults to git root.
2018-04-26Opam packaging: add install and uninstall targets and code to find various ↵Robert Norton
files in installed location.
2018-04-26Remove obsolete mips/cheri rules from sail makefile. These are now built in ↵Robert Norton
their respective subdirectories.
2018-04-18Fix build on linuxAlasdair Armstrong
Turns out that BSD sed is not a subset of GNU sed, GNU sed doesn't allow a space after the -i option.
2018-04-18Port to Mac: BSD sed != GNU sedAlastair Reid
For GNU sed, the extension is optional in sed -i ... But in BSD sed, the extension is mandatory sed -i .bak ...
2018-04-05Cleanup repository by removing old and generated filesAlasdair Armstrong
Rename l2.ott to sail.ott
2018-03-08rename mips_new_tc to mipsRobert Norton
2018-03-02Use sail_lib.lem values in C backendAlasdair Armstrong
Rather than just using strings to represent literals, now use value types from sail_lib.lem to represent them. This allows for expressions to be evaluated at compile time, which will be useful for future optimisations involving constant folding and propagation, and allows the intermediate bytecode to be interpreted using the same lem builtins that the shallow embedding uses. To get this to work I had to tweak the build process slightly to allow ml files to import lem files from gen_lib/. Hopefully this doesn't break anything!
2018-02-22wipRobert Norton
2018-02-17Merge master branch into sail2 for OCaml 4.06 compatibilityThomas Bauereiss
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-08work in progress mips sail2 port.Robert Norton
2018-01-31minor renameShaked Flur
2018-01-26Missing -ocamlfindBrian Campbell
2018-01-25Fix building bytecode sailBrian Campbell
2018-01-23Started working on C backend for sailAlasdair Armstrong
Also updated some of the documentation in the sail source code
2017-12-30use linksem as a packageShaked Flur
2017-12-28use ocamlfind to locate lem and zarithShaked Flur
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-13Merge remote-tracking branch 'origin/master' into interactiveAlasdair Armstrong
2017-12-13Use big_nums from LemAlasdair Armstrong
2017-12-13find zarith using ocamlfind instead of using the one in ocaml-lib which is ↵Shaked Flur
no longer there
2017-12-11Prototype interactive mode for sail.Alasdair Armstrong
Requires linenoise library (opam install linenoise) for readline support. Use 'make isail' to build sail with interactive support. Plain 'make sail' should work as before with no additional dependencies. Use 'sail -i <commands>' to run sail interactively, e.g. sail -new_parser -i test/ocaml/prelude.sail test/ocaml/trycatch/tc.sail then try some commands for typechecking and evaluation sail> :t main sail> main () Doesn't use the lem interpreter right now, instead has a small operational semantics in src/interpreter.ml, but this is not very complete and will be changed/removed.
2017-12-05Update header files on masterAlasdair Armstrong
2017-12-05Update license headers for Sail sourceAlasdair Armstrong
2017-11-29Switched to bytecode compiler for executing interpreter to avoid stack overflowAlasdair Armstrong
2017-11-17Fix Makefile for interpreter and update instruction_extractorAlasdair Armstrong
Instruction extractor code that I commented out in this commit seems buggy anyway - it will claim that the length of all bitvectors is 64?!
2017-11-17Fix interpreter to work with new typecheckerAlasdair Armstrong
Need to map sail type annotations to interpreter type annotations in lem_ast ouput. This doesn't seem too hard.
2017-10-25Point sail/src makefile at ott file in language/Alasdair Armstrong
2017-10-25Generate ast.ml from ott file and update makefile.Alasdair Armstrong
Fix until loop not being counted as sugar
2017-09-29Add MIPS->Isabelle target to MakefileThomas Bauereiss
2017-09-14Fix a regression when writing to a register via a reference in a vector such ↵Thomas Bauereiss
as GPR This was wrongly translated as an update of the vector of references.
2017-09-02Add command line flags to toggle sequential monad and native machine wordsThomas Bauereiss