Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Express device_implements_state_machine using only run1, without runUntilResp #965

Merged
merged 16 commits into from
Dec 6, 2021

Conversation

fshaked
Copy link
Contributor

@fshaked fshaked commented Nov 26, 2021

This PR includes @samuelgruetter's #960 (which should probably be closed without merging).

Fix the problems of runUntilResp, discussed in #960.
Change the IncrWait end2end proof to use the invariant-spec.
Fix TL: save the address of the outstanding request, instead of using the address from the input (which might change).
Fix TL spec.
Split the IncrWait device file to cava+spec, and end2end proof.

@fshaked
Copy link
Contributor Author

fshaked commented Nov 26, 2021

@jadephilipoom, notice that I use the invariant-spec in the big proof in firmware/IncrementWait/CavaIncrementDevice.v, showing that it is indeed very useful (no need to reason about Cava at all). But, (in that file) I never use output_correct_pf. In fact, the postcondition of the incr device is just True, because it is not needed. This is because the device class from InternalMMIOMachine.v includes the function last_d2h, from cava-device-state to cava-output, which is then used instead of the real output. We did this because, in principal, we need to record the device output in order to know if the input of the next step will be accepted (TL protocol), and we didn't want to do that, so instead the device class shifts the responsibility to the cava device, and now the cava device state must record enough information so that the output can be computed from the state alone (i.e., the cava output must be a function of the let/delay bindings, and must not include the input bindings), which happened to be the case anyway in the incr device (and the hmac_top, but that might change soon).

postcondition :=
fun (input : denote_type (input_of inner)) repr
(output : denote_type (output_of inner)) =>
let repr' := inner_spec_step input repr in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how common it is that postcondition contains let repr' := update input repr in ... and whether that would justify making it an argument of postcondition.

firmware/RiscvMachineWithCavaDevice/InternalMMIOMachine.v Outdated Show resolved Hide resolved
firmware/RiscvMachineWithCavaDevice/InternalMMIOMachine.v Outdated Show resolved Hide resolved
@fshaked fshaked merged commit 4427b55 into project-oak:main Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants