Skip to content

Commit

Permalink
Merge pull request #2314 from verilog-to-routing/min_chan_router_iter…
Browse files Browse the repository at this point in the history
…ation

Min Chan W Number of Router Iterations
  • Loading branch information
vaughnbetz committed May 25, 2023
2 parents df19148 + 271eebd commit 857bc94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 8 additions & 6 deletions vtr_flow/scripts/python_libs/vtr/vpr/vpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def run_relax_w(

vpr_min_w_log = ".".join([logfile_base, "out"])
vpr_relaxed_w_log = ".".join([logfile_base, "crit_path", "out"])
max_router_iterations = None
crit_path_router_iterations = None

if "max_router_iterations" in vpr_args:
max_router_iterations = vpr_args["max_router_iterations"]
del vpr_args["max_router_iterations"]
if "crit_path_router_iterations" in vpr_args:
crit_path_router_iterations = vpr_args["crit_path_router_iterations"]
del vpr_args["crit_path_router_iterations"]

if "write_rr_graph" in vpr_args:
del vpr_args["write_rr_graph"]
Expand All @@ -96,8 +96,8 @@ def run_relax_w(
if explicit and "route" not in vpr_args:
# Don't look for min W if routing was not run
return
if max_router_iterations:
vpr_args["max_router_iterations"] = max_router_iterations
if crit_path_router_iterations:
vpr_args["max_router_iterations"] = crit_path_router_iterations
min_w = determine_min_w(str(temp_dir / vpr_min_w_log))

relaxed_w = relax_w(min_w, relax_w_factor)
Expand Down Expand Up @@ -165,6 +165,8 @@ def run(
"""
if "crit_path_router_iterations" in vpr_args:
del vpr_args["crit_path_router_iterations"]

if vpr_args is None:
vpr_args = OrderedDict()
Expand Down
3 changes: 1 addition & 2 deletions vtr_flow/scripts/run_vtr_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,7 @@ def process_vpr_args(args, prog, temp_dir, vpr_args):
Finds arguments needed in the VPR stage of the flow
"""
if args.crit_path_router_iterations:
if "max_router_iterations" not in vpr_args:
vpr_args["max_router_iterations"] = args.crit_path_router_iterations
vpr_args["crit_path_router_iterations"] = args.crit_path_router_iterations
if args.fix_pins:
new_file = str(temp_dir / Path(args.fix_pins).name)
shutil.copyfile(str((Path(prog).parent.parent / args.fix_pins)), new_file)
Expand Down

0 comments on commit 857bc94

Please sign in to comment.