Skip to content

Add stream-contract conformance checkers - #44

Merged
timkpaine merged 1 commit into
mainfrom
tkp/protocol-conformance
Aug 1, 2026
Merged

Add stream-contract conformance checkers#44
timkpaine merged 1 commit into
mainfrom
tkp/protocol-conformance

Conversation

@timkpaine

Copy link
Copy Markdown
Member

A reusable checker for the valid/ready stream contract: valid held and payload stable until ready fires, transfers only when both are high, exactly one last per batch, no transfer after last, and status held until status_ready. Each violation raises naming the RULE and the CYCLE.

Motive: real bugs shipped past hand-written benches in the last few days — a core whose output was combinational off a register that had already advanced (right record counts, wrong contents), a core sustaining 1.25 instead of 1.0 records per cycle, a bench where deleting an entire error branch still passed, and one where hardwiring output_last low still passed. These properties get hand-written per bench today, inconsistently.

Ten tests drive deliberately BROKEN modules — dropping valid, mutating a stalled payload, emitting two lasts, never emitting last — and assert each fails with its rule identified. That is the proof the layer is worth having rather than a claim about it.

The useful conclusion is about tooling, not code. This was scoped as an evaluation of dau-sim's CSP simulator as a second simulation path alongside Verilator. It turns out not to need one: the checker is simulator-NEUTRAL Python that samples signal values, so it attaches to the existing Verilator/cocotb benches directly. The value was never a second simulator — it was that these properties should be enforced generically instead of re-derived per bench. Adopting it costs no new simulation path and no second harness.

Additive only; the existing cocotb integration's behaviour and defaults are untouched. Suite: 10 passed.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine merged commit 43e64c5 into main Aug 1, 2026
1 check failed
@timkpaine
timkpaine deleted the tkp/protocol-conformance branch August 1, 2026 17:54
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