Skip to content

Commit 6ef3a85

Browse files
committed
Update vtr_task python files for new paths.py
1 parent 915297a commit 6ef3a85

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

vtr_flow/scripts/python_libs/vtr/parse_vtr_flow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
# pylint: disable=wrong-import-position
1111
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
1212
import vtr
13+
from vtr import paths
1314

1415
# pylint: enable=wrong-import-position
16+
17+
1518
def parse_vtr_flow(arg_list):
1619
"""
1720
parse vtr flow output
@@ -22,7 +25,7 @@ def parse_vtr_flow(arg_list):
2225

2326
extra_params = arg_list[2:]
2427
if parse_config_file is None:
25-
parse_config_file = vtr.find_vtr_file("vtr_benchmarks.txt")
28+
parse_config_file = str(paths.vtr_benchmarks_parse_path)
2629

2730
parse_patterns = vtr.load_parse_patterns(str(parse_config_file))
2831

vtr_flow/scripts/python_libs/vtr/parse_vtr_task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
InspectError,
3131
VtrError,
3232
create_jobs,
33-
find_vtr_file,
3433
)
3534

3635
# pylint: enable=wrong-import-position

vtr_flow/scripts/python_libs/vtr/paths.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@
3535
restore_multiclock_latch_script_path = scripts_path / "restore_multiclock_latch.pl"
3636
valgrind_supp = vpr_path / "valgrind.supp"
3737
lsan_supp = vpr_path / "lsan.supp"
38+
39+
# Task files
40+
vtr_benchmarks_parse_path = (
41+
vtr_flow_path / "parse" / "parse_config" / "common" / "vtr_benchmarks.txt"
42+
)

vtr_flow/scripts/python_libs/vtr/task.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from vtr import (
1010
VtrError,
1111
InspectError,
12-
find_vtr_root,
1312
load_list_file,
1413
load_parse_results,
1514
get_next_run_dir,
1615
find_task_dir,
1716
load_script_param,
1817
get_latest_run_dir,
18+
paths,
1919
)
2020

2121
# pylint: disable=too-many-instance-attributes, too-many-arguments, too-many-locals,too-few-public-methods
@@ -559,7 +559,7 @@ def resolve_vtr_source_file(config, filename, base_dir=""):
559559
return str(joined_path)
560560
else:
561561
# Relative base under the VTR flow directory
562-
joined_path = Path(find_vtr_root()) / "vtr_flow" / base_dir / filename
562+
joined_path = paths.vtr_flow_path / base_dir / filename
563563
if joined_path.exists():
564564
return str(joined_path)
565565

@@ -581,8 +581,7 @@ def find_task_config_file(task_name):
581581
# Not absolute path, so check from the current directory first
582582
base_dirs.append(".")
583583

584-
vtr_root = find_vtr_root()
585-
vtr_flow_tasks_dir = str(PurePath(vtr_root) / "vtr_flow" / "tasks")
584+
vtr_flow_tasks_dir = str(paths.vtr_flow_path / "tasks")
586585

587586
# Then the VTR tasks directory
588587
base_dirs.append(vtr_flow_tasks_dir)

0 commit comments

Comments
 (0)