[FIRRTL] Support probe ports in instance_choice operations#9815
Draft
[FIRRTL] Support probe ports in instance_choice operations#9815
Conversation
This commit adds support for read probe ports on instance_choice operations,
enabling XMR lowering through instance choices where different target modules
may have different internal probe paths.
For each ref port in an instance choice, the LowerXMR pass creates an internal
macro (e.g., __targetref_Module_inst_port) and generates ifdef-guarded macro
definitions in ref_<module>.sv header files that select the appropriate XMR
path based on the option value:
`ifdef __option__Platform_FPGA
`define __targetref_Top_inst_probe `__target_Platform_Top_inst.inner.r
`elsif __option__Platform_ASIC
`define __targetref_Top_inst_probe `__target_Platform_Top_inst.deep.r
`else
`define __targetref_Top_inst_probe `__target_Platform_Top_inst.r
`endif
The implementation extends resolveReferencePath() to handle macro-based XMR
paths without hierpaths, and adds VerbatimExprOp creation for these references.
RWProbe on instance choice ref ports are not yet supported.
uenoku
commented
Mar 3, 2026
|
|
||
| // Register the internal macro as the XMR path for this port. | ||
| SmallString<128> macroPath("`"); | ||
| macroPath.append(internalMacroName); |
Member
Author
There was a problem hiding this comment.
This is abusing suffix to embed macroname directly. We could implement slightly nicer by extending XMRDerefOp to allow macro subst (but still need macro so not much difference TBH).
2490c10 to
0f5b6bb
Compare
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 commit adds support for read probe ports on instance_choice operations, enabling XMR lowering through instance choices where different target modules may have different internal probe paths.
For each ref port in an instance choice, the LowerXMR pass creates an internal macro (e.g.,
__targetref_Module_inst_port) and generates ifdef-guarded macro definitions in ref_.sv header files that select the appropriate XMR path based on the option value:The implementation extends resolveReferencePath() to handle macro-based XMR paths without hierpaths, and adds VerbatimExprOp creation for these references.
RWProbe on instance choice ref ports are not yet supported.
AI-assited-by: Sonnet 4.5