Skip to content

Commit 789e7ea

Browse files
committed
Merge branch 'abc_path_fix' of github.com:byuccl/vtr-verilog-to-routing into abc_path_fix
2 parents 1f6f36f + 53f2c87 commit 789e7ea

File tree

3 files changed

+60
-43
lines changed

3 files changed

+60
-43
lines changed

vtr_flow/scripts/python_libs/vtr/abc/abc.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ def run(
114114
)
115115
if abc_flow_type == "blanket_bb":
116116
command_runner.run_system_command(
117-
[blackbox_latches_script, "--input", input_file, "--output", pre_abc_blif.name,],
117+
[
118+
blackbox_latches_script,
119+
"--input",
120+
input_file,
121+
"--output",
122+
pre_abc_blif.name,
123+
],
118124
temp_dir=temp_dir,
119125
log_filename=str(i) + "_blackboxing_latch.out",
120126
indent_depth=1,
@@ -173,7 +179,8 @@ def run(
173179
'echo "Output Netlist"',
174180
'echo "=============="',
175181
"write_hie {pre_abc_blif} {post_abc_raw_blif}".format(
176-
pre_abc_blif=pre_abc_blif.name, post_abc_raw_blif=post_abc_raw_blif.name,
182+
pre_abc_blif=pre_abc_blif.name,
183+
post_abc_raw_blif=post_abc_raw_blif.name,
177184
),
178185
"time;",
179186
]
@@ -189,7 +196,8 @@ def run(
189196
"time",
190197
"scleanup",
191198
"write_hie {pre_abc_blif} {post_abc_raw_blif}".format(
192-
pre_abc_blif=pre_abc_blif.name, post_abc_raw_blif=post_abc_raw_blif.name,
199+
pre_abc_blif=pre_abc_blif.name,
200+
post_abc_raw_blif=post_abc_raw_blif.name,
193201
),
194202
"print_stats",
195203
]
@@ -269,7 +277,7 @@ def run(
269277
# pylint: enable=too-many-arguments, too-many-locals
270278
def parse_abc_args(abc_args):
271279
"""
272-
function to parse abc_args
280+
function to parse abc_args
273281
"""
274282
abc_flow_type = "iterative_bb"
275283
abc_run_args = ""
@@ -303,7 +311,7 @@ def parse_abc_args(abc_args):
303311

304312
def populate_clock_list(circuit_file, blackbox_latches_script, clk_list, command_runner, temp_dir):
305313
"""
306-
function to populate the clock list
314+
function to populate the clock list
307315
"""
308316
clk_list_path = temp_dir / "report_clk.out"
309317
cmd = [
@@ -407,8 +415,8 @@ def run_lec(
407415

408416
def check_abc_lec_status(output):
409417
"""
410-
Reads abc_lec output and determines if the files were equivelent and
411-
if there were errors when preforming lec.
418+
Reads abc_lec output and determines if the files were equivelent and
419+
if there were errors when preforming lec.
412420
"""
413421
equivalent = None
414422
errored = False

vtr_flow/scripts/python_libs/vtr/flow.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ def __ge__(self, other):
3131

3232
# pylint: disable=too-many-arguments, too-many-locals, too-many-branches, too-many-statements
3333
def run(
34-
architecture_file,
35-
circuit_file,
36-
power_tech_file=None,
37-
start_stage=VtrStage.odin,
38-
end_stage=VtrStage.vpr,
39-
command_runner=vtr.CommandRunner(),
40-
temp_dir=Path("./temp"),
41-
odin_args=None,
42-
abc_args=None,
43-
vpr_args=None,
44-
keep_intermediate_files=True,
45-
keep_result_files=True,
46-
min_hard_mult_size=3,
47-
min_hard_adder_size=1,
48-
check_equivalent=False,
49-
check_incremental_sta_consistency=False,
50-
use_old_abc_script=False,
51-
relax_w_factor=1.3,
52-
check_route = False,
53-
check_place = False,
34+
architecture_file,
35+
circuit_file,
36+
power_tech_file=None,
37+
start_stage=VtrStage.odin,
38+
end_stage=VtrStage.vpr,
39+
command_runner=vtr.CommandRunner(),
40+
temp_dir=Path("./temp"),
41+
odin_args=None,
42+
abc_args=None,
43+
vpr_args=None,
44+
keep_intermediate_files=True,
45+
keep_result_files=True,
46+
min_hard_mult_size=3,
47+
min_hard_adder_size=1,
48+
check_equivalent=False,
49+
check_incremental_sta_consistency=False,
50+
use_old_abc_script=False,
51+
relax_w_factor=1.3,
52+
check_route=False,
53+
check_place=False,
5454
):
5555
"""
5656
Runs the VTR CAD flow to map the specified circuit_file onto the target architecture_file
@@ -252,7 +252,7 @@ def run(
252252
do_second_run = False
253253
second_run_args = vpr_args
254254

255-
if "write_rr_graph" in vpr_args or "analysis" in vpr_args or "route" in vpr_args:
255+
if "write_rr_graph" in vpr_args or "analysis" in vpr_args or "route" in vpr_args:
256256
do_second_run = True
257257

258258
vtr.vpr.run(
@@ -337,10 +337,14 @@ def run(
337337

338338

339339
def delete_intermediate_files(
340-
next_stage_netlist, post_ace_activity_file, keep_result_files, temp_dir, power_tech_file,
340+
next_stage_netlist,
341+
post_ace_activity_file,
342+
keep_result_files,
343+
temp_dir,
344+
power_tech_file,
341345
):
342346
"""
343-
delete intermediate files
347+
delete intermediate files
344348
"""
345349
next_stage_netlist.unlink()
346350
exts = (".xml", ".sdf", ".v")

vtr_flow/scripts/run_vtr_flow.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# pylint: disable=too-few-public-methods
2323
class VtrStageArgparseAction(argparse.Action):
2424
"""
25-
Class to parse the VTR stages to begin and end at.
25+
Class to parse the VTR stages to begin and end at.
2626
"""
2727

2828
def __call__(self, parser, namespace, value, option_string=None):
@@ -43,7 +43,7 @@ def __call__(self, parser, namespace, value, option_string=None):
4343

4444
def vtr_command_argparser(prog=None):
4545
"""
46-
The VTR command arg parser
46+
The VTR command arg parser
4747
"""
4848
usage = "%(prog)s circuit_file architecture_file [options]"
4949
description = textwrap.dedent(
@@ -327,7 +327,9 @@ def vtr_command_argparser(prog=None):
327327
help="Tells VPR the amount of iterations allowed to obtain the critical path.",
328328
)
329329
vpr.add_argument(
330-
"-fix_pins", type=str, help="Controls how the placer handles I/O pads during placement.",
330+
"-fix_pins",
331+
type=str,
332+
help="Controls how the placer handles I/O pads during placement.",
331333
)
332334
vpr.add_argument(
333335
"-relax_w_factor",
@@ -354,7 +356,10 @@ def vtr_command_argparser(prog=None):
354356
help="Tells VPR to run final analysis stage.",
355357
)
356358
vpr.add_argument(
357-
"-check_place", default=False, action="store_true", help="Tells VPR to run routing stage",
359+
"-check_place",
360+
default=False,
361+
action="store_true",
362+
help="Tells VPR to run routing stage",
358363
)
359364
vpr.add_argument(
360365
"-sdc_file", default=None, type=str, help="Path to SDC timing constraints file."
@@ -371,14 +376,14 @@ def vtr_command_argparser(prog=None):
371376

372377
def main():
373378
"""
374-
Main function to call vtr_command_main to run VTR
379+
Main function to call vtr_command_main to run VTR
375380
"""
376381
return vtr_command_main(sys.argv[1:], prog=sys.argv[0])
377382

378383

379384
def vtr_command_main(arg_list, prog=None):
380385
"""
381-
Running VTR with the specified arguemnts.
386+
Running VTR with the specified arguemnts.
382387
"""
383388
start = datetime.now()
384389
# Load the arguments
@@ -431,8 +436,8 @@ def vtr_command_main(arg_list, prog=None):
431436
check_incremental_sta_consistency=args.check_incremental_sta_consistency,
432437
use_old_abc_script=args.use_old_abc_script,
433438
relax_w_factor=args.relax_w_factor,
434-
check_route = args.check_route,
435-
check_place = args.check_place,
439+
check_route=args.check_route,
440+
check_place=args.check_place,
436441
)
437442
error_status = "OK"
438443
except vtr.VtrError as error:
@@ -521,7 +526,7 @@ def process_unknown_args(unknown_args):
521526

522527
def process_abc_args(args):
523528
"""
524-
Finds arguments needed in the ABC stage of the flow
529+
Finds arguments needed in the ABC stage of the flow
525530
"""
526531
abc_args = OrderedDict()
527532
if args.iterative_bb:
@@ -543,7 +548,7 @@ def process_abc_args(args):
543548

544549
def process_odin_args(args):
545550
"""
546-
Finds arguments needed in the ODIN stage of the flow
551+
Finds arguments needed in the ODIN stage of the flow
547552
"""
548553
odin_args = OrderedDict()
549554
odin_args["adder_type"] = args.adder_type
@@ -562,7 +567,7 @@ def process_odin_args(args):
562567

563568
def process_vpr_args(args, prog, temp_dir, vpr_args):
564569
"""
565-
Finds arguments needed in the VPR stage of the flow
570+
Finds arguments needed in the VPR stage of the flow
566571
"""
567572
if args.crit_path_router_iterations:
568573
if "max_router_iterations" not in vpr_args:
@@ -580,7 +585,7 @@ def process_vpr_args(args, prog, temp_dir, vpr_args):
580585

581586
def get_sdc_file(sdc_file, prog):
582587
"""
583-
takes in the sdc_file and returns a path to that file if it exists.
588+
takes in the sdc_file and returns a path to that file if it exists.
584589
"""
585590
if not Path(sdc_file).exists():
586591
if sdc_file.startswith("/"):
@@ -593,7 +598,7 @@ def get_sdc_file(sdc_file, prog):
593598

594599
def except_vtr_error(error, expect_fail, verbose):
595600
"""
596-
Handle vtr exceptions
601+
Handle vtr exceptions
597602
"""
598603
error_status = None
599604
actual_error = None

0 commit comments

Comments
 (0)