Skip to content

Commit 70a3510

Browse files
committed
fixed sdc file copy and parmys abs path to temp folder issue
1 parent 15c5340 commit 70a3510

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

vtr_flow/scripts/run_vtr_flow.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def vtr_command_argparser(prog=None):
383383
help="Tells VPR the amount of iterations allowed to obtain the critical path.",
384384
)
385385
vpr.add_argument(
386-
"-fix_pins",
386+
"--fix_pins",
387387
type=str,
388388
help="Controls how the placer handles I/O pads during placement.",
389389
)
@@ -424,7 +424,7 @@ def vtr_command_argparser(prog=None):
424424
help="Tells VPR to run routing stage",
425425
)
426426
vpr.add_argument(
427-
"-sdc_file", default=None, type=str, help="Path to SDC timing constraints file."
427+
"--sdc_file", default=None, type=str, help="Path to SDC timing constraints file."
428428
)
429429
vpr.add_argument(
430430
"-read_vpr_constraints", default=None, type=str, help="Path to vpr constraints file."
@@ -524,7 +524,11 @@ def vtr_command_main(arg_list, prog=None):
524524
error_status = "Error"
525525

526526
assert args.temp_dir
527+
527528
temp_dir = Path(args.temp_dir)
529+
if not str(temp_dir).startswith("/"):
530+
temp_dir = Path(os.getcwd() + "/" + args.temp_dir)
531+
528532
# Specify how command should be run
529533
command_runner = vtr.CommandRunner(
530534
track_memory=args.track_memory_usage,
@@ -538,6 +542,9 @@ def vtr_command_main(arg_list, prog=None):
538542
exit_status = 0
539543
return_status = 0
540544
try:
545+
# Create temp dir
546+
os.makedirs(temp_dir, exist_ok=True)
547+
541548
vpr_args = process_unknown_args(unknown_args)
542549
vpr_args = process_vpr_args(args, prog, temp_dir, vpr_args)
543550
if args.sdc_file:
@@ -765,11 +772,10 @@ def get_sdc_file(sdc_file, prog, temp_dir):
765772
takes in the sdc_file and returns a path to that file if it exists.
766773
"""
767774
if not sdc_file.startswith("/"):
768-
sdc_file = Path(prog).parent.parent / sdc_file
775+
sdc_file = os.getcwd() + "/" + str(sdc_file)
769776
sdc_file_name = Path(sdc_file).name
770777
sdc_file_copy = Path(temp_dir) / Path(sdc_file_name)
771778
shutil.copy(str(sdc_file), str(sdc_file_copy))
772-
773779
return str(vtr.verify_file(sdc_file_copy, "sdc file"))
774780

775781

@@ -778,7 +784,7 @@ def get_read_vpr_constraints(read_vpr_constraints, prog, temp_dir):
778784
takes in the read_vpr_constraints and returns a path to that file if it exists.
779785
"""
780786
if not read_vpr_constraints.startswith("/"):
781-
read_vpr_constraints = Path(prog).parent.parent / read_vpr_constraints
787+
read_vpr_constraints = os.getcwd() + "/" + str(read_vpr_constraints)
782788
vpr_constraint_file_name = Path(read_vpr_constraints).name
783789
vpr_constraint_file_copy = Path(temp_dir) / Path(vpr_constraint_file_name)
784790
shutil.copy(str(read_vpr_constraints), str(vpr_constraint_file_copy))

0 commit comments

Comments
 (0)