Skip to content
Merged
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
19 changes: 12 additions & 7 deletions src/dvsim/job/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pprint
import random
import shlex
from collections.abc import Callable, Mapping
from collections.abc import Callable, Iterable, Mapping
from pathlib import Path
from typing import TYPE_CHECKING, ClassVar

Expand Down Expand Up @@ -590,9 +590,9 @@ class RunTest(Deploy):

# Initial seed values when running tests (if available).
target = "run"
seeds = []
seeds: ClassVar[list[int]] = []
fixed_seed = None
cmds_list_vars = ["pre_run_cmds", "post_run_cmds"]
cmds_list_vars: ClassVar[list[str]] = ["pre_run_cmds", "post_run_cmds"]

def __init__(self, index: int, test: Test, build_job: CompileSim, sim_cfg: "SimCfg") -> None:
# Register a copy of sim_cfg which is explicitly the SimCfg type
Expand Down Expand Up @@ -651,7 +651,12 @@ def __init__(self, index: int, test: Test, build_job: CompileSim, sim_cfg: "SimC

# We did something wrong if build_mode is not the same as the build_job
# arg's name.
assert self.build_mode == build_job.name
if self.build_mode != build_job.name:
msg = (
f"Created a build job with name {build_job.name}, when we "
f"expected the name to be {self.build_mode}."
)
raise AssertionError(msg)

def _define_attrs(self) -> None:
super()._define_attrs()
Expand Down Expand Up @@ -757,7 +762,7 @@ def get_seed() -> int:
RunTest.seeds.append(seed)
return RunTest.seeds.pop(0)

def get_timeout_mins(self):
def get_timeout_mins(self) -> float:
"""Return the timeout in minutes.

Limit run jobs to 60 minutes if the timeout is not set.
Expand Down Expand Up @@ -832,7 +837,7 @@ class CovMerge(Deploy):
target = "cov_merge"
weight = 10

def __init__(self, run_items, sim_cfg) -> None:
def __init__(self, run_items: Iterable[RunTest], sim_cfg: FlowCfg) -> None:
"""Initialise a job deployment to merge coverage databases."""
# Construct the cov_db_dirs right away from the run_items. This is a
# special variable used in the HJson. The coverage associated with
Expand Down Expand Up @@ -862,7 +867,7 @@ def __init__(self, run_items, sim_cfg) -> None:
self.cov_db_dirs += [str(item) for item in prev_cov_db_dirs]

super().__init__(sim_cfg)
self.dependencies += run_items
self.dependencies.extend(run_items)
# Run coverage merge even if one test passes.
self.needs_all_dependencies_passing = False

Expand Down
Loading