Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstanceChoice] Add a default override for unspecified options #7955

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

prithayan
Copy link
Contributor

@prithayan prithayan commented Dec 5, 2024

Add an override that, instead of emitting an error, selects the default target to specialize an instance choice when the option is unspecified.
By default a partially specified instance choice is not allowed. But we can override the error and select the default target, by using --specialize-to-default-if-no-override with firtool.
This enables a user to specialize the instance choice for a particular build flow, and fall-back to the default for all others.
Relevant discussion: #7933

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -876,6 +876,10 @@ def SpecializeOption : Pass<"firrtl-specialize-option", "firrtl::CircuitOp"> {
}];
let constructor = "circt::firrtl::createSpecializeOptionPass()";

let options = [
Option<"selectDefault", "specialize-to-default-if-no-override", "bool", "false",
Copy link
Member

Choose a reason for hiding this comment

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

Can the option name (both CLI and variable) be more descriptive than just "specialize"? This is a term that is used also for layers and could mean (roughly) and removal of a parameter. Or: include instance choice in the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed both to be a bit more descriptive. Hopefully its not too long,
select-default-for-unspecified-instance-choice

Copy link
Member

Choose a reason for hiding this comment

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

SGTM. Overly descriptive and obvious is fine-by-me. 💯

@prithayan prithayan merged commit b5141b7 into main Dec 5, 2024
4 checks passed
@prithayan prithayan deleted the dev/pbarua/instance-choice-default branch December 5, 2024 22:40
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.

2 participants