Skip to content

treewide: Make FFs clearable#314

Merged
phsauter merged 4 commits into
v2-devfrom
nw/clr-v2
Jun 29, 2026
Merged

treewide: Make FFs clearable#314
phsauter merged 4 commits into
v2-devfrom
nw/clr-v2

Conversation

@niwis

@niwis niwis commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

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*

@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

@phsauter phsauter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some cleanup to explain the difference between clr and other signals and to unify the comments a bit more. Should be easily doable by LLM.

Additionally the Readme needs updating:

  • cc_stream_arbiter_flushable is removed
  • rst_ni and clr_i need to be mentioned and their purpose explained
  • The use of the FF macros should be mentioned in the Readme.

Comment thread src/cc_counter.sv Outdated
Comment thread src/cc_fifo.sv Outdated
Comment thread src/cc_stream_fifo.sv Outdated
Comment thread src/cc_stream_fifo_optimal_wrap.sv Outdated
Comment thread src/cc_spill_register_flushable.sv Outdated
@niwis niwis force-pushed the nw/clr-v2 branch 2 times, most recently from d15f0f2 to fd34812 Compare June 29, 2026 08:51
@niwis niwis requested a review from phsauter June 29, 2026 09:00
@niwis

niwis commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, should all be addressed now.

niwis and others added 4 commits June 30, 2026 00:50
Add active-high synchronous clear inputs to sequential building-block modules and convert affected state elements to clearable register macros.

Keep tc_sync instantiations on the tech-cell interface without clr_i while preserving clear behavior in the surrounding common cells.

Co-authored-by: Philippe Sauter <phsauter@iis.ee.ethz.ch>
Rename clear_i to restart_i to distinguish the filter restart behavior from clr_i, which clears all state to reset values.

Co-authored-by: Philippe Sauter <phsauter@iis.ee.ethz.ch>
Remove the separate cc_stream_arbiter_flushable source and make the main stream arbiter carry the clearable implementation.

Update the round-robin arbiter clear API, stream crossbar/omega-net users, manifests, waivers, and tests accordingly.

Co-authored-by: Philippe Sauter <phsauter@iis.ee.ethz.ch>
Normalize clk_i, rst_ni, clr_i, and flush_i descriptions across affected modules and document the common sequential ports and macro usage in the README.

Co-authored-by: Philippe Sauter <phsauter@iis.ee.ethz.ch>

@phsauter phsauter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@phsauter phsauter merged commit 19a9d98 into v2-dev Jun 29, 2026
5 of 6 checks passed
@phsauter phsauter deleted the nw/clr-v2 branch June 29, 2026 23:05
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.

2 participants