refactor: Move tool name to FlowCfg#149
Open
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
Open
Conversation
AlexJones0
reviewed
Apr 2, 2026
Contributor
AlexJones0
left a comment
There was a problem hiding this comment.
I agree that this is definitely an easy stop-gap for now, but I checked your strong suspcicion and can confirm that in all the different flows this attribute is defined. SimCfg and OneShotCfg set it directly from args.tool, FormalCfg, LintCfg and SyncCfg inherit it from OneShotCfg, and CdcCfg & RdcCfg inherit it from LintCfg.
So this could be added to FlowCfg.__init__ as self.tool: str | None = args.tool (since the --tool argument can be unspecified), and then this runtime check should instead be that the value is not None. If you don't mind the little extra effort, could you make this change?
This value was always actually supplied (either directly in SimCfg or through OneShotCfg). Move it to the base class and consume it in just one place. A specific type looks like there might be problems where we try to run a job without having decided on the tool. The second instance of this (in CovReport.post_finish) can definitely never happen, but the example in Deploy.get_job_spec is less obvious to me, so I've put in a runtime check. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
c86c43f to
29986b0
Compare
Contributor
Author
|
@AlexJones0: You're completely right! Thanks! I think I've tweaked everything to match now? |
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 value was always actually supplied (either directly in SimCfg or
through OneShotCfg). Move it to the base class and consume it in just
one place.
A specific type looks like there might be problems where we try to run
a job without having decided on the tool. The second instance of
this (in CovReport.post_finish) can definitely never happen, but the
example in Deploy.get_job_spec is less obvious to me, so I've put in a
runtime check.