Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dvsim/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
self.scratch_path = ""
self.scratch_base_path = ""

# The command line might specify the tool (with --tool). If not, we
# leave it as None (allowing an hjson file to populate it)
self.tool: str | None = args.tool

# Add exports using 'exports' keyword - these are exported to the child
# process' environment.
self.exports = []
Expand Down
1 change: 0 additions & 1 deletion src/dvsim/flow/one_shot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class OneShotCfg(FlowCfg):

def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
# Options set from command line
self.tool = args.tool
self.verbose = args.verbose
self.flist_gen_cmd = ""
self.flist_gen_opts = []
Expand Down
15 changes: 15 additions & 0 deletions src/dvsim/job/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ def __init__(self, sim_cfg: "FlowCfg") -> None:

def get_job_spec(self) -> "JobSpec":
"""Get the job spec for this deployment."""
# At this point, the configuration should have populated its tool field
# (either from a command line argument or a value in the hjson that was
# loaded. If not, we don't know what to do.
if self.sim_cfg.tool is None:
msg = (
"No tool selected in job configuration. It must either be "
"specified in the hjson or passed with the --tool argument."
)
raise RuntimeError(msg)

return JobSpec(
name=self.name,
job_type=self.__class__.__name__,
Expand Down Expand Up @@ -845,6 +855,11 @@ def callback(status: JobStatus) -> None:
if self.dry_run or status != JobStatus.PASSED:
return

# At this point, we have finished running a tool, so we know that
# self.sim_cfg.tool must have been set.
if self.sim_cfg.tool is None:
raise AssertionError("sim_cfg.tool cannot be None now.")

plugin = get_sim_tool_plugin(tool=self.sim_cfg.tool)

results, self.cov_total = plugin.get_cov_summary_table(
Expand Down
1 change: 0 additions & 1 deletion src/dvsim/sim/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class SimCfg(FlowCfg):

def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
# Options set from command line
self.tool = args.tool
self.build_opts = []
self.build_opts.extend(args.build_opts)
self.en_build_modes = args.build_modes.copy()
Expand Down
Loading