Skip to content

VED: behaviour after a reset from any power-up state (synchronous reset, unit 1) - #208

Open
junjihashimoto wants to merge 17 commits into
mainfrom
feat/ved-reset
Open

junjihashimoto wants to merge 17 commits into
mainfrom
feat/ved-reset

Conversation

@junjihashimoto

Copy link
Copy Markdown
Contributor

Unit 1 of Issue sparkle-ved-reset. The statement and plan in notes/ved/VED-RESET.md (revision 2, 9590c7d) were approved by the reviewer for this scope.

What it proves. Tools/VedReset.lean:

theorem resetStmt_of_u1 : U1Stmt c m f → ResetStmt c m f
  • Start and reset. From any power-up state in which each register fits its width (every other name arbitrary), the reset is held for cycles 0..r and then released.
  • Conclusion. Every output at every cycle t > r equals the source on the inputs shifted by r+1, at cycle t-r-1. This holds for every well-ordered arrangement of the body, with the same seeding as OutputsOn.
  • Reset cycles. Outputs during the reset cycles are not specified.
  • Scope. Modules without memories or instances. These restrictions come from U1Stmt itself, so the theorem has no extra hypotheses.
  • Per circuit. It is one general theorem, so every accepted #ved_u1 entry gets the reset statement without a new proof.

Lemmas.

  • The reset prefix runs, with arbitrary non-register names and a free clock.
  • The reset step agrees with st0 on the registers only.
  • Non-register state is not observed (an observational agreement: outputs and register next-state, not equality of the trace).
  • Run split, with the short case K ≤ r handled separately.
  • Shift.

Controls (Tests/Ved/VedResetCheck.lean, in ved-pr and ved-full):

  • Positive: resetStmt_of_u1 applied to a delay and a counter entry. Concrete runs start from a state that differs from st0 (also in a non-register name), with r = 0 and r = 2.
  • Witness: an output during reset that differs from the source.
  • Negative: an observable register whose reset is not the contract's reset gives a concrete counterexample.
  • Axioms: #print axioms resetStmt_of_u1 reports the standard three only.

Checks. kjob lake build Tools.VedReset Tests.Ved.VedResetCheck passes on Lean 4.36 and on 4.32.1. ved_paths --check passes. VED CI on all supported versions runs on this PR.

Not in this PR: asynchronous reset (unit 2) and the parser's reset kind (unit 3), which each get their own review.

…eneral theorem from U1Stmt; memories, hierarchy, async, parser as scope questions)
…eedFwd, contract-bound reset and explicit shift; post-reset state agrees with st0 on registers only (non-register independence and prefix evaluation lemmas); trace oldest-first; async limited to edge-observed reset, separate review
…ster in the wrong-reset control, theorem without extra hypotheses

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant