Skip to content

Commit b6416fa

Browse files
committed
refactor: use the tool plugins directly
Signed-off-by: James McCorrie <[email protected]>
1 parent 21edab1 commit b6416fa

File tree

3 files changed

+11
-90
lines changed

3 files changed

+11
-90
lines changed

src/dvsim/job/deploy.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from dvsim.job.time import JobTime
1818
from dvsim.launcher.base import Launcher
1919
from dvsim.logging import log
20-
from dvsim.sim_utils import get_cov_summary_table
20+
from dvsim.tool.utils import get_sim_tool_plugin
2121
from dvsim.utils import (
2222
clean_odirs,
2323
find_and_substitute_wildcards,
@@ -813,7 +813,11 @@ def callback(status: str) -> None:
813813
if self.dry_run or status != "P":
814814
return
815815

816-
results, self.cov_total = get_cov_summary_table(self.cov_report_txt, self.sim_cfg.tool)
816+
plugin = get_sim_tool_plugin(tool=self.sim_cfg.tool)
817+
818+
results, self.cov_total = plugin.get_cov_summary_table(
819+
cov_report_path=self.cov_report_txt,
820+
)
817821

818822
colalign = ("center",) * len(results[0])
819823
self.cov_results = tabulate(

src/dvsim/launcher/base.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from dvsim.job.time import JobTime
1919
from dvsim.logging import log
20-
from dvsim.sim_utils import get_job_runtime, get_simulated_time
20+
from dvsim.tool.utils import get_sim_tool_plugin
2121
from dvsim.utils import clean_odirs, mk_symlink, rm_path
2222

2323
if TYPE_CHECKING:
@@ -339,11 +339,10 @@ def _find_patterns(patterns: Sequence[str], line: str) -> Sequence[str] | None:
339339
# since it is devoid of the delays incurred due to infrastructure and
340340
# setup overhead.
341341

342+
plugin = get_sim_tool_plugin(tool=self.job_spec.tool)
343+
342344
try:
343-
time, unit = get_job_runtime(
344-
log_text=lines,
345-
tool=self.job_spec.tool,
346-
)
345+
time, unit = plugin.get_job_runtime(log_text=lines)
347346
self.job_runtime.set(time, unit)
348347

349348
except RuntimeError as e:
@@ -354,10 +353,7 @@ def _find_patterns(patterns: Sequence[str], line: str) -> Sequence[str] | None:
354353

355354
if self.job_spec.job_type == "RunTest":
356355
try:
357-
time, unit = get_simulated_time(
358-
log_text=lines,
359-
tool=self.job_spec.tool,
360-
)
356+
time, unit = plugin.get_simulated_time(log_text=lines)
361357
self.simulated_time.set(time, unit)
362358

363359
except RuntimeError as e:

src/dvsim/sim_utils.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)