Move get_job_spec's check that the FlowCfg has "tool" to run-time#149
Draft
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
Draft
Move get_job_spec's check that the FlowCfg has "tool" to run-time#149rswarbrick wants to merge 3 commits intolowRISC:masterfrom
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
Conversation
Note: we can't do this by checking if self.sim_cfg is of type SimCfg, because that would give a circular dependency between job.deploy and sim.flow. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
This wouldn't work at runtime, but postponing the check until then is a reasonable stop-gap that allows us to postpone working out which subclasses of FlowCfg define commit/commit_short until we have tidied up the types in more of those classes. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
I strongly suspect that this field can move to the base class, but the change here will work as an easy stop-gap for now. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
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 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 is in draft because it depends on #146 and #148 (the first two commits in the PR). Merge these first
I strongly suspect that this field can move to the base class, but the change here will work as an easy stop-gap for now.