[FIRRTL] Add RWProbe force/release synthesis to ProbesToSignals#10803
Open
prithayan wants to merge 1 commit into
Open
[FIRRTL] Add RWProbe force/release synthesis to ProbesToSignals#10803prithayan wants to merge 1 commit into
prithayan wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the ProbesToSignals pass to support RWProbes with force/release operations.
ProbesToSignalsnow supports force/release synthesis by creating state machines that track when a signal is being overridden and what value it should hold.High-Level Flow
Phase 0: Gated Clock Handling
If the force/release or the target register is running under a gated clock, perform gated clock conversion. It folds the clock gate enable into the operation and ensures force/release and its target register use the same free running clock.
Phase 1: Discovery and Type Conversion
Convert all probe types to their underlying hardware types and record the corresponding
RWProbeports and operations. Maintain the original program order for all force/release operations, because this defines priority (earlier operations have higher priority)Phase 2: Access Reduction
For each target signal that has force/release operations:
Build priority arbitration logic:
Compute reduced control signals:
forceActive: OR together all force predicates, gated by "force wins"releaseActive: OR together all release predicates, gated by "NOT force wins"forcedValue: mux chain selecting the value from the highest-priority active forceclock: pick any available clock from clocked accesses (null if only initial accesses exist)Phase 3: Categorization
The following 3 kinds of uses exist:
Phase 4: State Machine Materialization
For Local Targets:
Input:
Generated State Machine:
For Exported Targets:
<portName>_force_ctrlcarrying a bundle:forceActive: combined force enables from parent and localreleaseActive: combined release enables from parent and localforcedValue: the value to force (local wins over parent in priority)clock: the clock to use for the state machineFor Instance-Forwarded Targets:
Phase 5: Cross-Module Port Insertion
Mutation of module signatures and instance ports is done sequentially, after the previous in-parallel steps are over:
For each module with exported forceable ports:
_force_ctrlinput ports at the end of the port listFor each instance of such modules:
_force_ctrlinput ports to the parent's forwarding wiresThis PR is stacked on #10660, for the gated clock conversion utility.
Assisted-by: OpenCode:Opus-4.8