Skip to content

Move get_job_spec's check that the FlowCfg has "tool" to run-time#149

Draft
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
rswarbrick:tool-field-at-run-time
Draft

Move get_job_spec's check that the FlowCfg has "tool" to run-time#149
rswarbrick wants to merge 3 commits intolowRISC:masterfrom
rswarbrick:tool-field-at-run-time

Conversation

@rswarbrick
Copy link
Copy Markdown
Contributor

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.

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>
Copy link
Copy Markdown
Contributor

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

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

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?

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