Skip to content

[rtl] Keep the CHERIoT enable assertions valid across a reset - #2602

Draft
henrikpedersen-oss wants to merge 1 commit into
lowRISC:masterfrom
henrikpedersen-oss:upstream-cheriot-enable-assert-reset
Draft

henrikpedersen-oss wants to merge 1 commit into
lowRISC:masterfrom
henrikpedersen-oss:upstream-cheriot-enable-assert-reset

Conversation

@henrikpedersen-oss

Copy link
Copy Markdown
Contributor

IbexCheriotEnableShadowLag_A and IbexCheriotEnableCmpEqual_A in ibex_top use $past and $stable. If a reset is asserted and released while clk_i is stopped, no clock edge sees it, so at the first edge afterwards $past and $stable still refer to the edge before the reset.

Earl Grey 2 hits this in a chip test that glitches the main power while the core sleeps. The core clock stops at the WFI. The main-domain reset then sets both enables from On to Off. At the first edge after wake-up, the shadow enable (Off) is compared with $past(cheriot_enable_i) (On, from before the sleep), and both assertions fail. Both enables are Off and equal, and the hardware comparison reports no mismatch.

The change compares with the enables registered at the previous edge, and checks only after the first edge since reset. This also keeps the checks quiet in the first cycle for an integrator who ties the enables On from reset. The change is assertion-only: no RTL behaviour changes.

Testing

  • Earl Grey 2 chip test chip_sw_eg2_sleep_reset_68_cheriot, seed 1129 (main power glitch in normal sleep): fails on both assertions at the first clock edge after the glitch (6,541.67 µs) before the change. With the change, neither assertion fires, and the glitch step passes its 18 checks. The run continues to a later, unrelated step.

This PR includes AI-assisted content generated with Claude Code. All changes have been reviewed and are the responsibility of the listed author(s).

IbexCheriotEnableShadowLag_A and IbexCheriotEnableCmpEqual_A compared with
$past and $stable. When a reset comes and goes while clk_i is stopped (a
power glitch in sleep), the first edge after it compares with a value from
before the reset and fails, though both enables are equal. Compare with
flops that start valid only after the first edge since reset.

AI-assisted (Claude Code) — reviewed and approved by author

Co-Authored-By: Claude <claude@anthropic.com>
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