Skip to content

treewide: Make FFs clearable#314

Open
niwis wants to merge 8 commits into
v2-devfrom
nw/clr-v2
Open

treewide: Make FFs clearable#314
niwis wants to merge 8 commits into
v2-devfrom
nw/clr-v2

Conversation

@niwis
Copy link
Copy Markdown
Collaborator

@niwis niwis commented Jun 4, 2026

Add an active-high synchronous clear clr_i to all modules, clearing all FFS to their reset value (analogous to rst_ni). Streamline the codebase by consistently using register macros for sequential logic.

Design principles:

  • clr_i shall clear all FFs, similar to rst_ni.
  • Every sequential module shall have a clr_i.
  • Consequently, if a module already has a functional clear that clears all FFs, rename that port to clr_i. If a an existing functional clear only clears a subset of FFs, rename that port to something distinctively else and add clr_i.

The previous stream_arbiter wrapper is now redundant and replaced by the previous stream_arbiter_flushable.

Sequential modules where no synchronous clear was added:

  • cdc_*
  • clk_*
  • edge_propagator*
  • isochronous_*
  • rstgen*

Add an active-high synchronous clear `clr_i` to the building-block modules,
clearing all flip-flops to their reset values (a synchronous counterpart to
the asynchronous `rst_ni`). Hand-written reset blocks are converted to the
`FFARNC`/`FFLARNC` clearable register macros.

Re-application of the original treewide change onto the v2-dev naming
(cc_ prefix, renamed parameters/types). Modules that already had a functional
clear which clears all FFs are renamed to `clr_i`; where a functional clear
covers only part of the state (cc_max_counter, cc_exp_backoff,
cc_serial_deglitch) it is kept alongside a separate general `clr_i`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niwis niwis added this to the v2.0 milestone Jun 4, 2026
@niwis niwis added the v2 label Jun 4, 2026
@niwis niwis self-assigned this Jun 4, 2026
@niwis niwis marked this pull request as ready for review June 5, 2026 15:36
@niwis niwis requested a review from phsauter June 5, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant