summaryrefslogtreecommitdiff
path: root/mips
AgeCommit message (Collapse)Author
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
2017-04-27fix cheri128 model referring to wrong registers and not capreg printing.Robert Norton
2017-04-27need brackets around try ... with expression.Robert Norton
2017-04-27add command line argument for setting undef values to all zero or all one. ↵Robert Norton
Some tests intentionally produce undefined values (e.g. divide by zero) and this might be required for them to work.
2017-04-27reverse endianness of data when writing UART. Altera jtag uart is ↵Robert Norton
little-endian and this change allows it to work when writing using store word (as done by FreeBSD driver) or sb (as done by cheri helloworld program).
2017-04-25extend the try around call to select to avoid gprof crashing with EINTR.Robert Norton
2017-04-25replace memory representation with map of 1MB pages rather than map of ↵Robert Norton
bytes. This makes loading binaries much quicker but doesn't seem to make a big difference to execution speed.
2017-04-25Don't die if stdin gets closed (e.g. when running unit tests).Robert Norton
2017-04-25support loading more than one raw file as anonymous arguments so that we can ↵Robert Norton
load simboot + kernel.
2017-04-25Add support for uart terminal. Also add read_bit_reg function for faster and ↵Robert Norton
neater access to registers of single bit.
2017-04-21it turns out zarith has a function for printing big_ints in hex. Remove the ↵Robert Norton
dependency on ocaml uint library by using it.
2017-04-21define some big_int literals in sail_values.ml to avoid lots of calls to ↵Robert Norton
bit_int_of_int. Likely very little performance benefit but slightly more readable.
2017-04-21remove unnecessary cast in incrementCP0Count (run every instruction) for ↵Robert Norton
potential speedup.
2017-04-20add support for cheri128 ocaml shallow embeddingRobert Norton
2017-04-20build a single run_embed.native with mips and cheri models linked and choose ↵Robert Norton
between them using a command line switch.