summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-09-27latex: Refactor category name prefixingJessica Clarke
Rather than having the caller prefix latex and refcode strings with the category, push that down into common functions to both abstract away the details and avoid duplication. No functional change intended, and verified by regenerating the LaTeX for sail-cheri-mips and sail-cheri-riscv.
2020-09-27latex: Remove unused latex_label functionJessica Clarke
2020-09-25Saildoc: do not mangle links targets enclosed in <>Alex Richardson
This can be useful to reference things that aren't defined by sail.
2020-09-24Wrap saildoc LaTeX in \saildoclabelled macroJessica Clarke
This takes two arguments: the label name and the \saildocfoo macro use itself. This allows cunning definitions of \saildoclabelled and \saildocfoo to tease apart the various bits and reconstruct them in a different order without having to redefine \phantomsection and \label temporarily and hard-code knowledge of the implementation of these documentation commands. I intend to use these in cheri-architecture in combination with sail-cheri-riscv. Unlike the other macros, this is considered a bit more niche, so we include a default definition of it that expands to what was previously hard-coded. This also makes this a non-breaking change.
2020-09-24Merge pull request #93 from jrtc27/saildoc-improvementsAlasdair Armstrong
Saildoc improvements
2020-09-24Merge pull request #91 from julienfreche/remove_extra_staticAlasdair Armstrong
C codegen: remove an unnecessary declaration in the header file
2020-09-23Allow more access to parts of Env (needed by minisail)Mark Wassell
2020-09-21latex: Handle Ulp, Ol and Olp markdown constructsJessica Clarke
2020-09-21latex: Dump out S-Expr of any unhandled markdownJessica Clarke
Printing the text is only so helpful; the most important thing to know is what kind of element it actually is, which is lost when extracting the text. Instead, print the whole S-Expr.
2020-09-21Strip leading *'s from saildocJessica Clarke
We now parse /*! * Paragraph */ and /*! *Paragraph */ the same as /*! Paragraph */ since the first form is prettier, and similar to what Doxygen, Javadoc and other such tools allow. This can cause mild confusion, as if the start of a line in the final form happens to have a * then it will unexpectedly remove it, but this is a problem shared by those tools too and the intent is that everyone just use the first form and never need to worry about it.
2020-09-20Improve parsing of saildoc commentsJessica Clarke
These were only parsed for val specs and scattered clauses, but many other constructs can be meaningfully documented. Moreover, attaching the documentation to the SD_aux rather than the FCL_aux etc inside it is unhelpful since the latter is what the LaTeX backend sees. Instead, push the documentation down into the non-scattered entity within the SD_aux (i.e. the FCL_aux / Tu_aux / MCL_aux) when possible, only leaving it on the SD_aux when they are more like a val spec. This means that the saildoc for scattered function clauses is now emitted, without any changes needed to the LaTeX backend. Also support saildoc on a wider variety of non-scattered constructs, and slightly simplify aspects of the grammar whilst here.
2020-09-16C codegen: remove an unnecessary declaration in the header fileJulien Freche
2020-09-07Fix typo a mono_rewrites definitionBrian Campbell
- add tests for a couple of related rewrites - accept same range of constants for sign extension in the rewrite as for the zero extension version (to make the test simpler)
2020-09-02Consider case expressions in early return rewriteThomas Bauereiss
2020-08-27Ignore file start/end pragmas in spliceBrian Campbell
2020-08-27Perform truncation of hex literals for C backend (really for isla)Brian Campbell
For example, if a 129-bit capability is given as a 132-bit hex literal and truncated, this produces a 129-bit binary literal. In isla, this will keep all of the computation concrete because 129-bit concrete values are supported.
2020-08-25Add function sail_set_coverage_file to sail_coverage headerAlasdair
Can be set by C emulator to control where coverage information is written
2020-08-24Reformat tweaksAlasdair
2020-08-24Merge pull request #83 from julienfreche/configure_get_setAlasdair Armstrong
c2: make the global state API configurable for externally defined get/set functions
2020-08-21Add reformat option to SailAlasdair
Reformats input source code using the pretty printer preserving the file structure. Probably not useable as an ocamlformat or rustfmt like tool, but good enough to take generated code without formatting and make it readable.
2020-08-21C generation tweaksAlasdair
2020-08-21c2: make the global state API configurable for externally defined get/set ↵Julien Freche
functions
2020-08-18Move sail_state declaration into it's own fileAlasdair
Useful for RISC-V with it's custom C emulator
2020-08-13Preserve file structure through initial checkAlasdair
Insert $file_start and $file_end pragmas in the AST, as well as $include_start and $include_end pragmas so we can reconstruct the original file structure later if needed, provided nothing like topological sorting has been done. Have the Lexer produce a list of comments whenever it parses a file, which can the be attached to the nearest nodes in the abstract syntax tree.
2020-08-10Fix a C backend bug with letbindings in guards shadowing body definitionsAlasdair
2020-08-07Merge branch 'monads' into sail2Brian Campbell
2020-08-07Allow C/IR builds to use mono_rewrites without the rest of monomorphisationBrian Campbell
- also tie following type check to the mono_rewrites flag
2020-08-06Fix for last commitAlasdair
2020-08-06Forbid duplicate top-level letbindingsAlasdair
2020-08-06Fix a small bug with nested structs test in -c2 state apiAlasdair
2020-08-05Generate accessors for scalar types, array of scalars and scalars in struct ↵Julien Freche
in the sail state
2020-07-15Update duplicate ctor warningAlasdair
2020-07-15Merge pull request #77 from julienfreche/fix_name_instead_of_global_c2Alasdair Armstrong
c2: primop: -O: make sure to pick global or name correctly
2020-07-15Prevent creation of variant with existing type id and constructors that ↵Mark Wassell
exist as constructor or function
2020-07-14c2: primop: -O: make sure to pick global or name correctlyJulien Freche
2020-06-24Add slice.ml to libsailThomas Bauereiss
2020-06-23Fix bug with duplicate enum identifiers in patternsAlasdair
2020-06-18Report locations for "default order" errorsBrian Campbell
2020-06-17Coq: fix rich loop variablesBrian Campbell
Accidentally broken by e1a2b0d2 because the Coq backend looks at the wrong type to decide when a proof is needed.
2020-06-17Make `if cond { ... return() };` assert cond in the type environmentBrian Campbell
Avoids generating an assert expression with an escape effect. Mirrors existing case for `if cond { throw(...); };`. No longer requires `-non_lexical_flow`.
2020-06-14Coq: tidy up scope in libraryBrian Campbell
Helps with Coq 8.11. Also fix BBVDIR default in test script.
2020-06-12Use output file for generated branch information.Prashanth Mundkur
2020-06-10Prepare Coq library for packagingBrian Campbell
- rename files to get rid of prefix - use -Q to get package name right - add Base.v to make package imports simpler - add opam file for coq package
2020-06-09Add splice.ml to libsailThomas Bauereiss
2020-06-05Generate nice error messages for patterns woth duplicate bindingsAlasdair
2020-05-27Update base64 and yojson dependenciesThomas Bauereiss
2020-05-22Fix atomicity of register field writesAlasdair
Previous merge commit caused some code that was generating register.field = value to instead generate temp = register temp.field = value register = temp This was caused by rewriter changes affecting the ANF form, and the Jib compilation was sensitive to small changes in the ANF form when compiling l-expressions. Rather than applying a band-aid fix in the rewriter this commit re-factors the ANF translation of l-expressions to ensure that the jib compilation is more robust and able to consistently generate the correct l-expressions without introducing additional read-modify-write expressions in the code.
2020-05-21Merge branch 'mono-tweaks' of github.com:rems-project/sail into mono-tweaksAlasdair
2020-05-21Merge branch 'sail2' into mono-tweaksAlasdair
2020-05-15C backend: Only add static to model_{init,fini} if -static is passedAlex Richardson
Otherwise the C emulator doesn't build.