Skip to content

Commit 5cc8af0

Browse files
authored
Merge pull request #2161 from verilog-to-routing/2089_tight_floorplan_regression_test
2089 tight floorplan regression test
2 parents 87b8586 + ca1941d commit 5cc8af0

File tree

17 files changed

+1011913
-35
lines changed

17 files changed

+1011913
-35
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- {test: "vtr_reg_nightly_test2", cores: "16", options: "", cmake: "" }
3131
- {test: "vtr_reg_nightly_test3", cores: "16", options: "", cmake: "" }
3232
- {test: "vtr_reg_nightly_test4", cores: "16", options: "", cmake: "" }
33+
- {test: "vtr_reg_nightly_test5", cores: "16", options: "", cmake: "" }
3334
- {test: "vtr_reg_strong", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3" }
3435
- {test: "vtr_reg_strong", cores: "16", options: "-skip_qor", cmake: "-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=ON"}
3536
- {test: "vtr_reg_yosys", cores: "16", options: "", cmake: "-DWITH_YOSYS=ON -DYOSYS_SV_UHDM_PLUGIN=ON" }

vtr_flow/scripts/run_vtr_flow.py

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ def vtr_command_argparser(prog=None):
437437
vpr.add_argument(
438438
"-sdc_file", default=None, type=str, help="Path to SDC timing constraints file."
439439
)
440+
vpr.add_argument(
441+
"-read_vpr_constraints", default=None, type=str, help="Path to vpr constraints file."
442+
)
440443
vpr.add_argument(
441444
"-check_incremental_sta_consistency",
442445
default=False,
@@ -534,7 +537,13 @@ def vtr_command_main(arg_list, prog=None):
534537
vpr_args = process_unknown_args(unknown_args)
535538
vpr_args = process_vpr_args(args, prog, temp_dir, vpr_args)
536539
if args.sdc_file:
537-
vpr_args["sdc_file"] = get_sdc_file(args.sdc_file, prog)
540+
sdc_file_copy = get_sdc_file(args.sdc_file, prog, temp_dir)
541+
vpr_args["sdc_file"] = Path(sdc_file_copy).name
542+
if args.read_vpr_constraints:
543+
vpr_constraint_file_copy = get_read_vpr_constraints(
544+
args.read_vpr_constraints, prog, temp_dir
545+
)
546+
vpr_args["read_vpr_constraints"] = Path(vpr_constraint_file_copy).name
538547

539548
print(
540549
args.name
@@ -581,35 +590,43 @@ def vtr_command_main(arg_list, prog=None):
581590
return_status = exit_status
582591

583592
finally:
584-
seconds = datetime.now() - start
593+
write_vtr_summary(start, error_status, exit_status, temp_dir)
585594

586-
print(
587-
"{status} (took {time}, "
588-
"overall memory peak {stage[0]} consumed by {stage[1]} run)".format(
589-
status=error_status,
590-
time=vtr.format_elapsed_time(seconds),
591-
stage=get_max_memory_usage(temp_dir),
592-
)
593-
)
594-
temp_dir.mkdir(parents=True, exist_ok=True)
595-
out = temp_dir / "output.txt"
596-
out.touch()
597-
with out.open("w") as file:
598-
file.write("vpr_status=")
599-
if exit_status == 0:
600-
file.write("success\n")
601-
else:
602-
file.write("exited with return code {}\n".format(exit_status))
603-
file.write(
604-
"vpr_seconds=%d\nrundir=%s\nhostname=%s\nerror="
605-
% (seconds.total_seconds(), str(Path.cwd()), socket.gethostname())
606-
)
607-
file.write("\n")
608595
if __name__ == "__main__":
609596
sys.exit(return_status)
610597
return return_status
611598

612599

600+
def write_vtr_summary(start, error_status, exit_status, temp_dir):
601+
"""
602+
Write the summary of the results in vtr flow.
603+
Keep 15 variable limits of pylint in function vtr_command_main.
604+
"""
605+
seconds = datetime.now() - start
606+
print(
607+
"{status} (took {time}, "
608+
"overall memory peak {stage[0]} consumed by {stage[1]} run)".format(
609+
status=error_status,
610+
time=vtr.format_elapsed_time(seconds),
611+
stage=get_max_memory_usage(temp_dir),
612+
)
613+
)
614+
temp_dir.mkdir(parents=True, exist_ok=True)
615+
out = temp_dir / "output.txt"
616+
out.touch()
617+
with out.open("w") as file:
618+
file.write("vpr_status=")
619+
if exit_status == 0:
620+
file.write("success\n")
621+
else:
622+
file.write("exited with return code {}\n".format(exit_status))
623+
file.write(
624+
"vpr_seconds=%d\nrundir=%s\nhostname=%s\nerror="
625+
% (seconds.total_seconds(), str(Path.cwd()), socket.gethostname())
626+
)
627+
file.write("\n")
628+
629+
613630
def process_unknown_args(unknown_args):
614631
"""
615632
We convert the unknown_args into a dictionary, which is eventually
@@ -738,17 +755,30 @@ def process_vpr_args(args, prog, temp_dir, vpr_args):
738755
return vpr_args
739756

740757

741-
def get_sdc_file(sdc_file, prog):
758+
def get_sdc_file(sdc_file, prog, temp_dir):
742759
"""
743760
takes in the sdc_file and returns a path to that file if it exists.
744761
"""
745-
if not Path(sdc_file).exists():
746-
if sdc_file.startswith("/"):
747-
sdc_file = Path(str(Path(prog).parent.parent) + sdc_file)
748-
else:
749-
sdc_file = Path(prog).parent.parent / sdc_file
762+
if not sdc_file.startswith("/"):
763+
sdc_file = Path(prog).parent.parent / sdc_file
764+
sdc_file_name = Path(sdc_file).name
765+
sdc_file_copy = Path(temp_dir) / Path(sdc_file_name)
766+
shutil.copy(str(sdc_file), str(sdc_file_copy))
767+
768+
return str(vtr.verify_file(sdc_file_copy, "sdc file"))
769+
770+
771+
def get_read_vpr_constraints(read_vpr_constraints, prog, temp_dir):
772+
"""
773+
takes in the read_vpr_constraints and returns a path to that file if it exists.
774+
"""
775+
if not read_vpr_constraints.startswith("/"):
776+
read_vpr_constraints = Path(prog).parent.parent / read_vpr_constraints
777+
vpr_constraint_file_name = Path(read_vpr_constraints).name
778+
vpr_constraint_file_copy = Path(temp_dir) / Path(vpr_constraint_file_name)
779+
shutil.copy(str(read_vpr_constraints), str(vpr_constraint_file_copy))
750780

751-
return str(vtr.verify_file(sdc_file, "sdc file"))
781+
return str(vtr.verify_file(vpr_constraint_file_copy, "vpr constraint file"))
752782

753783

754784
def except_vtr_error(error, expect_fail, verbose):
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#VPR compatible SDC file for benchmark circuit 'neuron'
2+
3+
# Creates an external virtual clock 'virtual_io_clock', and non-virtual clocks for each netlist clock (each with 1ns target clock period).
4+
# Paths between netlist clock domains are not analyzed, but paths to/from the 'virtual_io_clock' and netlist clocks are analyzed.
5+
# Small clocks which drive less than 0.1% of blocks are ignored and not created
6+
7+
#**************************************************************
8+
# Unit Information
9+
#**************************************************************
10+
#VPR assumes time unit is nanoseconds
11+
12+
#**************************************************************
13+
# Create Clock
14+
#**************************************************************
15+
create_clock -period 1.000 -name virtual_io_clock
16+
create_clock -period 1.000 {clk_clk}
17+
18+
#**************************************************************
19+
# Create Generated Clock
20+
#**************************************************************
21+
#None
22+
23+
#**************************************************************
24+
# Set Clock Latency
25+
#**************************************************************
26+
set_clock_latency -source 0.000 [get_clocks {clk_clk}]
27+
28+
#**************************************************************
29+
# Set Clock Uncertainty
30+
#**************************************************************
31+
set_clock_uncertainty -from [get_clocks {clk_clk}] -to [get_clocks {clk_clk}] 0.000
32+
set_clock_uncertainty -from [get_clocks {clk_clk}] -to [get_clocks {virtual_io_clock}] 0.000
33+
set_clock_uncertainty -from [get_clocks {virtual_io_clock}] -to [get_clocks {clk_clk}] 0.000
34+
set_clock_uncertainty -from [get_clocks {virtual_io_clock}] -to [get_clocks {virtual_io_clock}] 0.000
35+
36+
#**************************************************************
37+
# Set Input Delay
38+
#**************************************************************
39+
set_input_delay -clock virtual_io_clock 0.0 [get_ports *]
40+
41+
#**************************************************************
42+
# Set Output Delay
43+
#**************************************************************
44+
set_output_delay -clock virtual_io_clock 0.0 [get_ports *]
45+
46+
#**************************************************************
47+
# Set Clock Groups
48+
#**************************************************************
49+
#None
50+
51+
#**************************************************************
52+
# Set False Path
53+
#**************************************************************
54+
#None
55+
56+
#**************************************************************
57+
# Set Multicycle Path
58+
#**************************************************************
59+
#None
60+
61+
#**************************************************************
62+
# Set Maximum Delay
63+
#**************************************************************
64+
#None
65+
66+
#**************************************************************
67+
# Set Minimum Delay
68+
#**************************************************************
69+
#None
70+
71+
#EOF

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1/task_list.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ regression_tests/vtr_reg_nightly_test1/arithmetic_tasks/open_cores_frac
1414
regression_tests/vtr_reg_nightly_test1/symbiflow
1515
regression_tests/vtr_reg_nightly_test1/power_extended_arch_list
1616
regression_tests/vtr_reg_nightly_test1/power_extended_circuit_list
17-
regression_tests/vtr_reg_nightly_test1/vpr_ispd
1817

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
regression_tests/vtr_reg_nightly_test5/vpr_ispd
2+
regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1/vpr_ispd/config/config.txt renamed to vtr_flow/tasks/regression_tests/vtr_reg_nightly_test5/vpr_ispd/config/config.txt

File renamed without changes.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1/vpr_ispd/config/golden_results.txt renamed to vtr_flow/tasks/regression_tests/vtr_reg_nightly_test5/vpr_ispd/config/golden_results.txt

File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
##############################################
2+
# Configuration file for running experiments
3+
##############################################
4+
5+
# Path to directory of circuits to use
6+
circuits_dir=tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan
7+
8+
# Path to directory of architectures to use
9+
archs_dir=tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan
10+
11+
# Add circuits to list to sweep
12+
circuit_list_add=neuron_stratixiv_arch_timing.blif
13+
14+
# Add architectures to list to sweep
15+
arch_list_add=stratixiv_arch_neuron.timing.xml
16+
17+
# Parse info and how to parse
18+
parse_file=vpr_standard.txt
19+
20+
# How to parse QoR info
21+
qor_parse_file=qor_standard.txt
22+
23+
# Pass requirements
24+
pass_requirements_file=pass_requirements.txt
25+
26+
# Script parameters
27+
script_params_common =-starting_stage vpr --route_chan_width 300 --max_router_iterations 400 --router_lookahead map --initial_pres_fac 1.0 --router_profiler_astar_fac 1.5 --seed 3 --device neuron
28+
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/sixteenth.xml
29+
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/half_blocks_half.xml
30+
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/one_big_partition.xml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
arch circuit script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error odin_synth_time max_odin_mem yosys_synth_time max_yosys_mem abc_depth abc_synth_time abc_cec_time abc_sec_time max_abc_mem ace_time max_ace_mem num_clb num_io num_memories num_mult vpr_status vpr_revision vpr_build_info vpr_compiler vpr_compiled hostname rundir max_vpr_mem num_primary_inputs num_primary_outputs num_pre_packed_nets num_pre_packed_blocks num_netlist_clocks num_post_packed_nets num_post_packed_blocks device_width device_height device_grid_tiles device_limiting_resources device_name pack_mem pack_time placed_wirelength_est place_mem place_time place_quench_time placed_CPD_est placed_setup_TNS_est placed_setup_WNS_est placed_geomean_nonvirtual_intradomain_critical_path_delay_est place_delay_matrix_lookup_time place_quench_timing_analysis_time place_quench_sta_time place_total_timing_analysis_time place_total_sta_time min_chan_width routed_wirelength min_chan_width_route_success_iteration logic_block_area_total logic_block_area_used min_chan_width_routing_area_total min_chan_width_routing_area_per_tile min_chan_width_route_time min_chan_width_total_timing_analysis_time min_chan_width_total_sta_time crit_path_routed_wirelength crit_path_route_success_iteration crit_path_total_nets_routed crit_path_total_connections_routed crit_path_total_heap_pushes crit_path_total_heap_pops critical_path_delay geomean_nonvirtual_intradomain_critical_path_delay setup_TNS setup_WNS hold_TNS hold_WNS crit_path_routing_area_total crit_path_routing_area_per_tile router_lookahead_computation_time crit_path_route_time crit_path_total_timing_analysis_time crit_path_total_sta_time
2+
stratixiv_arch_neuron.timing.xml neuron_stratixiv_arch_timing.blif common_-sdc_file_sdc/samples/neuron_stratixiv_arch_timing.sdc_-read_vpr_constraints_tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/sixteenth.xml 799.39 vpr 2.92 GiB -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 42 -1 -1 success v8.0.0-6558-g07167c26e release IPO VTR_ASSERT_LEVEL=2 GNU 11.2.0 on Linux-5.15.0-50-generic x86_64 2022-10-14T23:49:48 virtual /home/zhaisitong/worksapce/vtr2/vtr-verilog-to-routing/vtr_flow/tasks 3062716 42 35 119888 86875 1 51809 3567 129 96 12384 -1 neuron 2030.2 MiB 224.15 597383 2910.1 MiB 152.46 0.81 7.61685 -74849.5 -6.61685 5.08623 58.44 0.262079 0.232955 50.6768 43.2043 -1 772505 48 0 0 2.28642e+08 18462.7 65.52 80.6627 70.338 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
3+
stratixiv_arch_neuron.timing.xml neuron_stratixiv_arch_timing.blif common_-sdc_file_sdc/samples/neuron_stratixiv_arch_timing.sdc_-read_vpr_constraints_tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/half_blocks_half.xml 674.41 vpr 2.73 GiB -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 42 -1 -1 success v8.0.0-6558-g07167c26e release IPO VTR_ASSERT_LEVEL=2 GNU 11.2.0 on Linux-5.15.0-50-generic x86_64 2022-10-14T23:49:48 virtual /home/zhaisitong/worksapce/vtr2/vtr-verilog-to-routing/vtr_flow/tasks 2864032 42 35 119888 86875 1 51282 3422 129 96 12384 -1 neuron 1830.1 MiB 112.49 596408 2717.5 MiB 158.00 0.72 8.25008 -74642.4 -7.25008 5.56231 59.35 0.274684 0.232207 53.3837 45.3298 -1 773463 30 0 0 2.28642e+08 18462.7 52.31 73.4046 63.5131 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
4+
stratixiv_arch_neuron.timing.xml neuron_stratixiv_arch_timing.blif common_-sdc_file_sdc/samples/neuron_stratixiv_arch_timing.sdc_-read_vpr_constraints_tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan/one_big_partition.xml 651.65 vpr 2.73 GiB -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 42 -1 -1 success v8.0.0-6558-g07167c26e release IPO VTR_ASSERT_LEVEL=2 GNU 11.2.0 on Linux-5.15.0-50-generic x86_64 2022-10-14T23:49:48 virtual /home/zhaisitong/worksapce/vtr2/vtr-verilog-to-routing/vtr_flow/tasks 2866000 42 35 119888 86875 1 51283 3425 129 96 12384 -1 neuron 1832.1 MiB 115.72 596968 2719.5 MiB 121.72 0.80 8.38198 -70951.7 -7.38198 5.24439 61.07 0.276509 0.233816 40.1409 34.0809 -1 770923 29 0 0 2.28642e+08 18462.7 54.69 59.6691 51.82 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

0 commit comments

Comments
 (0)