summaryrefslogtreecommitdiff
path: root/mips_new_tc
AgeCommit message (Collapse)Author
2018-03-08rename mips_new_tc to mipsRobert Norton
2018-03-07Fix cheri and mips following 1fe8f33fce5aaaaea82fc54b6d198ffc9d7e1eeb which ↵Robert Norton
requires syntax change for unit constructors of union types.
2018-03-06overload shift operators so they can be used with integer shifts in cheri128 ↵Robert Norton
definitions.
2018-03-06finish port of cheri128 spec. to sail2.Robert Norton
2018-03-06add atom versions of val declaration for min and max.Robert Norton
2018-03-02add a cp2_next_pc function to update cheri state in fde loop and a stub ↵Robert Norton
version for mips.
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-03-01cheri wip.Robert Norton
2018-02-27Get MIPS translated to LemThomas Bauereiss
2018-02-26working sail2 mips spec (passes BERI tests).Robert Norton
2018-02-26ADDU should sign extend 32-bit result.Robert Norton
2018-02-26workaround sail2 not liking type synonyms as arguments to constructors (see #2).Robert Norton
2018-02-26Fix SLTIU: note that immediate must be sign extended before unsigned comparison!Robert Norton
2018-02-22wipRobert Norton
2018-02-08work in progress mips sail2 port.Robert Norton
2017-12-19Support user-defined exceptions in Lem shallow embeddingThomas Bauereiss
The type-checker already supports a user-defined "exception" type that can be used in throw and try-catch expressions. This patch adds support for that to the Lem shallow embedding by adapting the existing exception mechanisms of the state and prompt monads. User-defined exceptions are distinguished from builtin exception cases. For example, the state monad uses type ex 'e = | Exit | Assert of string | Throw of 'e to distinguish between calls to "exit", failed assertions, and user-defined exceptions, respectively. Early return is also handled using the exception mechanism, by lifting to a monad with "either 'r exception" as the exception type, where 'r is the expected return type and "exception" is the user-defined exception type.
2017-11-07Add builtin for reversing endiannessThomas Bauereiss
2017-09-29Some more refactoring of Sail libraryThomas Bauereiss
- Remove start indices and indexing order from bitvector types. Instead add them as arguments to functions accessing/updating bitvectors. These arguments are effectively implicit, thanks to wrappers in prelude_wrappers.sail and a "sizeof" rewriting pass. - Add a typeclass for bitvectors with a few basic functions (converting to/from bitlists, converting to an integer, getting and setting bits). Make both monads use this interface, so that they work with both the bitlist and the machine word representation of bitvectors.
2017-09-29Add MIPS->Isabelle target to MakefileThomas Bauereiss
2017-09-02Remove dependency of state.lem on bitvector operationsThomas Bauereiss
2017-08-29Make Lem export of CHERI(-256) typecheckThomas Bauereiss
Note: The effect annotations of the execute function differ between CHERI and MIPS, so I split out a new file mips_ast_decl.sail for MIPS with just the initial declarations of ast, decode, and execute (with the right effects for MIPS).
2017-08-24Begin refactoring Sail libraryThomas Bauereiss
- Add back support for bit list representation of bit vectors, for backwards compatibility in order to ease integration with the interpreter. For this purpose, split out a file sail_operators.lem from sail_values.lem, and add a variant sail_operators_mwords.lem for the machine word representation of bitvectors. Currently, Sail is hardcoded to use machine words for the sequential state monad, and bit lists for the free monad, but this could be turned into a command line flag. - Add a prelude_wrappers.sail file for glueing the Sail prelude to the Lem library. The wrappers make use of sizeof expressions to extract type information from bitvectors (length, start index) in order to pass it to the Lem functions. - Add early return support to the free monad, using a new constructor "Return of 'r". As with the sequential monad, functions with early return are wrapped into "catch_early_return", which extracts the return value at the end of the function execution.
2017-08-17Add support for register types other than bitvector to state monadThomas Bauereiss
Make state monad parametric in register state, and generate a record with registers from the Sail spec
2017-08-08Fix Lem bindings in test casesThomas Bauereiss
Add a test case with the MIPS spec using the TLB stub. Use the sequential monad for Lem testing for now; the free monad (in "prompt.lem") has not been updated for machine words yet.
2017-08-02Improve pretty-printing of register declaration and assignmentThomas Bauereiss
2017-07-17Fixed multiply for MIPS in prelude so it correctly doubles bitvectorAlasdair Armstrong
length, and removed redundant calls to extension functions.
2017-07-14Correct signedness bugs in mips_new_tc.Brian Campbell
2017-07-13Added some code to check if function return types in function clauses and ↵Alasdair Armstrong
val specs are the same
2017-07-13Modified MIPS model so it typechecks with the new typecheckerAlasdair Armstrong
2017-07-13Improved type inference for let statements and assignments with type ↵Alasdair Armstrong
annotated patterns and lexps Added get_enum to type checker interface
2017-07-12Various small changesAlasdair Armstrong
* Experimented with using list<bit> to clean up manually monomorphised code in MIPS tlb * Added option -dtc_verbose to control verbosity of new typechecker * Allowed functions with val specs to omit their type declarations
2017-07-12Fixed parser to parse 2** nexp expressions properlyAlasdair Armstrong
This introduces some shift/reduce and reduce/reduce conflicts, but I don't think these matter.
2017-07-11Various typechecker improvements:Alasdair Armstrong
* Fixed a bug where non-polymorphic function return types could be incorrect * Added support for LEXP_memory AST node * Flow typing constraint generation for all inequality operators * Better support for increasing vector indices in field access expressions
2017-07-10Bugfixes and testing new checker on the MIPS specAlasdair Armstrong
2017-07-06Testing new typechecker on MIPS specAlasdair Armstrong
Also: - Added support for foreach loops - Started work on type unions - Flow typing can now generate constraints, in addition to restricting range-typed variables - Various bugfixes - Better unification for nexps with multiplication