summaryrefslogtreecommitdiff
path: root/mips
AgeCommit message (Collapse)Author
2018-05-17changes to for testing FreeBSD boot on MIPS: allowing loading raw file in ↵Robert Norton
ocaml main so that we can have simboot + kernel. Support UART output only.
2018-05-17Refactor main.sailThomas Bauereiss
2018-05-17Remove sequential code againBrian Campbell
2018-05-17Clean up MIPS for HOL4 a littleBrian Campbell
Move mono_rewrites into lib
2018-05-11Add Isabelle code generation for sequential CHERI modelThomas Bauereiss
2018-05-11Merge branch 'sail2' into cheri-monoThomas Bauereiss
In order to use up-to-date sequential CHERI model for test suite
2018-05-11Remove buggy bit list comparison functions from Lem libraryThomas Bauereiss
Found bugs by running CHERI test suite on Isabelle-exported model: signed less-than for bit lists was missing negations for the two's complement, and unsigned less-than compared the reverse lists. Since all other backends implement this in Sail, it seems best to just remove this code. Also add support for infix operators to Lem backend, by z-encoding their identifiers like the other backends do.
2018-05-09remove redundant cloc targets.Robert Norton
2018-05-09Use latex support for generating cheri documentation and remove sed based ↵Robert Norton
hack. Also some minor code cleanups and comments.
2018-05-09Add targets for counting lines in mips, cheri and riscv. Can use either ↵Robert Norton
sloccount or cloc. sloccount seems to be reliable but lacks a way to tell it that sail files can be treated like ocaml without renaming the files. cloc has a nicer interface is lower quality in other regards like broken ocaml support in versions shipped with Ubuntu (e.g. treats {...} as comment, no nested comments support). For sail2 syntax this is OK because we use the C parser instead which gives the same results as sloccount.
2018-05-09Add tests for Isabelle->OCaml generation for CHERI and AArch64Thomas Bauereiss
2018-05-04Add back purely sequential Lem generationThomas Bauereiss
The datatype package of HOL4 does not support the prompt monad, so this patch restores the option to generate a model that only uses the state monad. Also add a Makefile target cheri_sequential.lem in the cheri/ directory.
2018-05-04Bit of hackery to MIPS prelude and Makefiles to get monomorphised CHERIBrian Campbell
2018-04-18Move a few printing functions to sail_values.lemThomas Bauereiss
They are used in various specs and test cases.
2018-04-12Add implementations of CReadHwr and CWriteHwrRobert Norton
2018-04-12Add missing read of UserLocal register using dmtc0 4, sel 2. Write was ↵Robert Norton
present but read was missing except via rdhwr.
2018-04-10Porting some minisail changes to sail2 branchAlasdair Armstrong
This commit primarily changes how existential types are bound in letbindings. Essentially, the constraints on both numeric and existentially quantified types are lifted into the surrounding type context automatically, so in ``` val f : nat -> nat let x = f(3) ``` whereas x would have had type nat by default before, it'll now have type atom('n) with a constraint that 'n >= 0 (where 'n is some fresh type variable). This has several advantages: x can be passed to functions expecting an atom argument, such as a vector indexing operation without any clunky cast functions - ex_int, ex_nat, and ex_range are no longer required. The let 'x = something() syntax is also less needed, and is now only really required when we specifically want a name to refer to x's type. This changes slightly the nature of the type pattern syntax---whereas previously it was used to cause an existential to be destructured, it now just provides names for an automatically destructured binding. Usually however, this just works the same. Also: - Fixed an issue where the rewrite_split_fun_constr_pats rewriting pass didn't add type paramemters for newly added type variables in generated function parameters. - Updated string_of_ functions in ast_util to reflect syntax changes - Fixed a C compilation issue where elements of union type constructors were not being coerced between big integers and 64-bit integers where appropriate - Type annotations in patterns now generalise, rather than restrict the type of the pattern. This should be safer and easier to handle in the various backends. I don't think any code we had was relying on this behaviour anyway. - Add inequality operator to lib/flow.sail - Fix an issue whereby top-level let bindings with annotations were checked incorrectly
2018-04-09remove unused functions from cher/mips prelude (step towards using standard ↵Robert Norton
prelude).
2018-04-04Fix another infinite loop in cast bit_to_bool. Following introduction of ↵Robert Norton
eq_bool this was preferred over eq_bit when compiling the match on bit in bit_to_bool... Fix is to overload == before including flow.sail but feels a bit inelegant.
2018-03-27Fix infinite loop in cheri/mips cast_unit_vec caused by lack of eq_bit in = ↵Robert Norton
operator. Introduced by e33c8546.
2018-03-27print IPS after running cheri model.Robert Norton
2018-03-22Fix C compilation for CHERI and MIPSAlasdair Armstrong
First, the specialisation of option types has been fixed by allowing the specialisation of constructor return types - this essentially means that a constructor, such as Some : 'a -> option('a) can get specialised to int -> option(int), rather than int -> option('a). This means that these constructors are treated like GADTs internally. Since this only happens just before the C translation, I haven't put much effort into making this very robust so far. Second, there was a bug in C compilation for the typing of return expressions in non-unit contexts, which has been fixed. Finally support for vector literals that are non-bitvectors has been added.
2018-03-21Patch AST datatypes in generated Isabelle theoriesThomas Bauereiss
Deactivate plugins of the datatype package except for the size plugin in order to keep processing time reasonable. This is currently only needed for the big AST datatypes, so we just patch this using a sed command.
2018-03-21Fix Lem generation for MIPSThomas Bauereiss
2018-03-14Add and use execute_branch and execute_branch_pcc functions to align code ↵Robert Norton
with existing MIPS and CHERI specs.
2018-03-14rename EXTS and EXTZ to sign_extend and zero_extend because it is more ↵Robert Norton
obviosu and to more closely match existing cheri pseudocode.
2018-03-14Fix Lem generation for CHERI-MIPS and Aarch64Thomas Bauereiss
- Update Lem bindings and extras files - Rewrite Nexp_var's if they are bound to a constant, similar to Nexp_id's (used for cap_size in the CHERI spec) - Add Lem and Isabelle Makefile targets for CHERI
2018-03-14Add address to Write_tag outcomeThomas Bauereiss
The state monad currently assumes that tags are written to and read from properly aligned addresses (since it does not know the capability size used in the Sail model). This change allows the Sail model to pass in the aligned address(es) even if data is written to an unaligned address. There might be better ways to model tag writing, but this approach seems rather general.
2018-03-08rename mips_new_tc to mipsRobert Norton
2018-03-08Remove files in mips directory prior to copying in files from mips_new_tc. ↵Robert Norton
Hopefully thiis will help git to spot the rename and hence preserve history.
2018-03-01Add support for read_tag and write_tag in sail_lib.ml. and support for ↵Robert Norton
intialising and dumping CHERI state. Somewhat working cheri sail2 model.
2018-02-17Merge master branch into sail2 for OCaml 4.06 compatibilityThomas Bauereiss
2018-02-08replaced NIA_LR/CTR/register with NIA_indirect;Shaked Flur
removed IK_cond_branch, and added IK_branch
2017-12-04Merge remote-tracking branch 'origin/master' into experimentsAlasdair Armstrong
2017-12-04renamed hgen to genShaked Flur
2017-11-30Merge branch 'master' into experimentsAlasdair Armstrong
2017-11-30match what rmem (ppcmem2) expects from ISA MakefilesShaked Flur
2017-10-31cheri: throw an exception if there is an attempt to access C26/IDC in the ↵Robert Norton
delay slot of a ccall selector 1 call.
2017-10-24fix default cap value on cheri128 following previous changes -- E stored in ↵Robert Norton
registers is no longer xored with 48 so need to initialise it. Also use E and T values used by CHERI hw and adjust decoding functions appropriately. Fix shift functions for ocaml shallow embedding which failed to handle shifts greater than vector length.
2017-10-12Work around warning in ocaml shallow embedding of mips caused by buggy code ↵Robert Norton
generation for dubious casting enumeration to int.
2017-08-17Merge remote-tracking branch 'origin' into mono-experimentsBrian Campbell
# Conflicts: # src/type_internal.ml
2017-08-15remove unneeded regs_out_in.hgen files.Robert Norton
2017-07-27Merge branch 'master' into sail_new_tcAlasdair Armstrong
2017-07-26mips_extras.lem: fix references to Interp.V_fooJon French
2017-06-21Pretty-print bitvector expressionsThomas Bauereiss
- Add case distinctions between bitvector types and vectors of other element types (e.g. registers) and use the corresponding operations (i.e. "bvslice", "bvaccess", etc for the former, and "slice", "access", etc for the latter) when pretty-printing expressions - Add type annotations to expressions when the type includes bitvectors with concretely known length - Update state.lem to use bitvectors (in the interface, at least; internally, bitvectors are still stored as bit lists for now, since that makes it easier to support storing different registers with different lengths) This has been tested with the CHERI-MIPS model with some success, but some things are still missing: - Bitvector patterns are not handled yet - Some bitvector length monomorphisation is needed in a few places of the model - Some type annotations are missing, because the (old) Sail type checker does not infer bitvector lengths in some instances where one would hope it to do that; this should be checked with the new type checker
2017-06-02Add tag memory to Lem shallow embeddingThomas Bauereiss
2017-05-24fixed missing _tag bitsShaked Flur
2017-05-24Change types of MEMr_tag, MEMval_tag and co. so that tag is separate from ↵Robert Norton
data and invent rmemt and wmvt effects for them. Extend the interpreter context to include lists of tagged memory read and write functions. The memory model must round down the address to the nearest capability aligned address when reading/writing tags. Remove TAGw which is no longer needed as a result.
2017-05-10Add stubs for TAGwThomas Bauereiss
Tagged memory seems to be currently missing in the Lem shallow embedding of (CHERI-)MIPS.
2017-04-27also trace memory writes.Robert Norton