Commit Graph

678 Commits

Author SHA1 Message Date
Rafal Kolanski f9ea44ef89 arm-hyp: update spec+proofs for multi-VM support
Highlights:
- new reserved IRQ and associated handler: VPPIEvent
- VPPI events are virtual interrupts we can forward to VMs; currently there is
  only one event: virtual timer interrupt
- VGICMaintenance and VPPIEvent can both receive late interrupts from hardware,
  which are now discarded instead of being delivered to current thread
- given only one possible VPPI event, simplifier tends to mop up more than it
  should, making some proofs fragile w.r.t. adding a new VPPI event
- the order of some lemmas/specs needed shuffling, as now VCPU code needs some
  interrupt code, which uses VCPU code
2020-02-19 10:52:07 +11:00
Rafal Kolanski 504565e57d haskell: translator: handle datatype Enum with one constructor
There is a special case for deriving Enum for datatypes with a single
constructor, but it should only fire when that constructor has exactly
one argument. Previously, one constructor with any other argument count
that one resulted in assertion failed.
2020-02-13 12:29:52 +11:00
Zoltan Kocsis 788b4bd180 refactored irq_t structure (VER-1159) 2020-02-05 17:58:45 +11:00
Gerwin Klein 8356f303b6 haskell-translator: instance proofs for types without 0-arg constructors 2020-02-03 12:56:19 +08:00
Corey Lewis 5120e351b3 lib: improve wp tracing
When tracing wp can now print the instantiated version of the rules being used.
It also says which set each used rule is from.
2020-01-29 09:26:18 +11:00
Edward Pierzchalski 4a222d1189 asmrefine: add arch setup licenses 2019-12-19 17:05:10 +11:00
Edward Pierzchalski c1747628b1 asmrefine: Add support for 64-bit architectures. 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 94513392ac asmrefine: remove unused lemmas. 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 16f02df8b5 asmrefine: be more explicit when reporting results 2019-12-19 17:05:10 +11:00
Edward Pierzchalski 437ae807c2 asmrefine: improve debugging
Splits parts of step 4 of the SimplExport proof process, in order to
expose them to the test theory. Add some instructions on how to use
them.

Tags subgoals so that the user can identify which ones caused the
failure.

Consolidates ML setup code, and demarcates it to let uses ignore it.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski d59ccc3fdf asmrefine: update tests
Includes some formatting changes.

Includes a comment explaining why `global_array_swap_gref` fails and is
commented out.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 708a62795e asmrefine: arch split CFunDump files
Now that asmrefine targets several arches, it's useful to separate out
any intermediate artefacts by L4V_ARCH. For instance, this lets us use
the same directory to test two arches at once.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 9ba1d498df asmrefine: remove globals_swap ref
Using a shared ref for configuration reduces the understandability of
code. It turns out the contents of the `globals_swap` ref:

1. Was always the same.
2. Was only used in one spot.
3. Could be recreated at that one spot.

So we do that instead.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski b4242a3ae8 asmrefine: arch-split for machine word size.
Arch-split memory operations used when translating graph-lang.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 89a53c0818 asmrefine: add field offset rewrite rules.
Currently unused, but these are useful for debugging proofs in SEAR
about struct access updates.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 36a26e23a5 c-parser: handle symbolic names in assembly
Previously the parser rejected symbolic names in assembly specifiers
(the `[foo]` in `[foo]"r"(bar)`). Since the SIMPL semantics ignores the
body content of assembly, and since these specifiers only affect the
meaning of the body, this rejection was overcautious.

Previously, the parser rejected rval `"i"` and `"rK"` specifiers (which
indicate that the expression is to be used in some kind of immediate
mode). Again, this is out of scope for the SIMPL semantics, so we allow
it.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 794dfb2f94 c-parser: fix register type to match ptr type 2019-12-18 12:04:48 +11:00
Edward Pierzchalski 31b779739e c-parser: add aliases for useful types 2019-12-18 12:04:48 +11:00
Victor Phan 79513ae604 riscv: update to HiFive platform from Spike
- Increase maxIRQ to 53
- Change keywords to build HiFive instead of Spike
2019-11-13 16:26:55 +11:00
Victor Phan 8bf03d45a0 riscv haskell/design: add and implement IRQ invocations
setIRQTrigger added but unimplemented because it's a machine op.
irqInvalid added, set to 0, since this is what's defined on the Spike
platform, may need to implement irqInvalid for other platforms if we
want generality for later proofs (Refine).
check, decode, perform IRQ control fully implemented to match the CSpec.
2019-11-12 18:28:40 +11:00
Gerwin Klein 09dbc34a0c riscv haskell/design: fix lookupPTSlotFromLevel and lookupPTFromLevel 2019-11-12 18:28:39 +11:00
Edward Pierzchalski f067068a88 asmrefine: improve initial debugging experience.
Adds a 'debug' configuration type to the main ProveSimplToGraphGoals
functions. Configuration lets the user control which functions will be
tested, and logs which functions fail testing.

Adds a 'single step' debug tactic for use in TestGraphRefine, and
demonstrates a few useful initial ML tactic for e.g. narrowing down
which subgoals are failing, and how to inspect a successful subgoal.
2019-11-12 14:25:58 +11:00
Corey Lewis dd48e0d899 proof: update for wp changes
Updated 'wp_once' to 'wp (once)' and removed several stray uses of 'wp_trace'.
2019-10-14 17:12:18 +11:00
Victor Phan dede199780 haskell-translator: remove PageRemap case conversion 2019-10-10 11:27:07 +11:00
Japheth Lim de9c069473 c-parser: update changelog for license change 2019-10-02 22:19:21 +10:00
Gerwin Klein c43472f1ce c-parser: correct license for shorten_names.ML 2019-10-02 09:16:23 +10:00
Japheth Lim 4f0b0558c3 autocorres: update tools for Isabelle2019 release 2019-09-05 14:18:18 +10:00
Japheth Lim 44bdf90ae8 autocorres, lib: refactor `nat :: bit_operations` instance
This refactors the instances in HaskellLib and AutoCorres into a new
theory, Lib.NatBitwise.
2019-07-24 11:00:02 +10:00
Japheth Lim de97108f14 autocorres: exhaustive testsuite for arithmetic op word abstraction 2019-07-24 10:48:13 +10:00
Japheth Lim 50e79b0fdb autocorres: exhaustive testsuite for bitwise op word abstraction 2019-07-24 10:48:13 +10:00
Japheth Lim 5685af2bcb autocorres: word abs for bitwise operators
This adds translation rules for bitwise operators, along with suitable
guards. Note that the guard for signed `shiftl` follows the C standard,
rather than the incorrect c-parser guard (see VER-509).

There was no standard instance of `nat :: bit_operations` for unsigned
abstraction, so we also add one. It should be merged with the
(incomplete) HaskellLib instance later.

Closes Jira VER-1122.
2019-07-24 10:41:55 +10:00
Japheth Lim fa0b62380a autocorres: solve a bad ":000" var name from L2Opt
Not sure if this breaks the property in the rule's comment, but
we'll probably find out if it does.
2019-07-10 13:59:53 +10:00
Japheth Lim ec74efcb9e autocorres: fix bug between heap abs and signed word abs
Jira VER-1112
2019-07-10 13:59:53 +10:00
Matthew Brecknell 52dae5f25a c-parser standalone: don't delete original source files on Isabelle2019 2019-06-19 14:39:56 +10:00
Japheth Lim 7a99f89ae3 c-parser: don't delete original source files on Isabelle2019
Some code in the parser would incorrectly delete the source file
jiraver337.c, because the `Path` module now normalises the filename to
a different-looking name. This is fixed by adding a boolean flag for
whether the parsed file should be deleted or not.

Fixes Jira VER-1114.
2019-06-19 13:01:30 +10:00
Gerwin Klein 4e12863b0f docs: update README files for Isabelle2019 2019-06-14 11:41:21 +10:00
Gerwin Klein c34840d09b global: isabelle update_cartouches 2019-06-14 11:41:21 +10:00
Gerwin Klein 22433afbb7 c-parser: keep word_neq_0_conv[simp] for now 2019-06-14 11:41:20 +10:00
Gerwin Klein ab0d486eb7 c-parser: update release log 2019-06-14 11:41:20 +10:00
Gerwin Klein c9244ff530 c-parser cleanup: convert README to markup 2019-06-14 11:41:20 +10:00
Gerwin Klein bde3977456 c-parser: proof cleanup in main c-parser 2019-06-14 11:41:20 +10:00
Gerwin Klein aea325ac6a c-parser umm_heap: larger cleanup pass
Mainly proof indentation, elimination of non-terminal auto, and modernizing
ancient proofs.
2019-06-14 11:41:20 +10:00
Michael McInerney 6812e6d0b6 haskell-translator: use new comment syntax 2019-06-13 16:22:33 +10:00
Gerwin Klein c0a2d54c15 asmrefine: update to Isabelle2019; reduce warnings 2019-06-13 16:22:33 +10:00
Gerwin Klein ea831ceb5c autocorres tests: port to Isabelle2019 2019-06-13 16:22:33 +10:00
Gerwin Klein b812c74c00 autocorres SchorrWaite example: clean up and update to Isabelle2019 2019-06-13 16:22:33 +10:00
Gerwin Klein f3db601e35 autocorres: minor cleanup, remove some warnings 2019-06-13 16:22:33 +10:00
Gerwin Klein 1cbefe0eb7 autocorres: update cartouches for Isabelle2019 2019-06-13 16:22:33 +10:00
Gerwin Klein 3b0699b656 autocorres: Isabelle2019 update 2019-06-13 16:22:33 +10:00
Gerwin Klein 0e48f483bf c-parser: expand $USER_HOME in cpp path name; export cpp_path config 2019-06-13 16:22:33 +10:00