Skip to content

Commit cd51c6b

Browse files
authored
Merge pull request #1479 from byuccl/parse_check_golden_issue
Vtr_reg_strong Some Regression tests results are not being checked
2 parents a6e2440 + 977c151 commit cd51c6b

File tree

9 files changed

+66
-57
lines changed

9 files changed

+66
-57
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
name: "Code Formatting - C/C++"
8181
script:
8282
- ./dev/check-format.sh
83-
- state: Test
83+
- stage: Test
8484
name: "Code Formatting - Python"
8585
script:
8686
- ./dev/check-format-py.sh

vtr_flow/scripts/parse_vtr_task.pl

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,15 @@
130130
exit $num_golden_failures;
131131

132132
sub parse_single_task {
133+
# This routine can operate in a few different ways":
134+
# Parse a result file and compare it to a golen (prior) result. This is the default functionality
135+
# Parse two result files and check equivelence if a second file is provided in the config file. This option disables the comparison to the golden results.
136+
# Optionally, in conjunction with either of the two above options, a qor_parse_file can be provided in the config file and also be compared to the first parsed result file
137+
138+
133139
my $task_name = shift;
134140
(my $task_path = $task_name) =~ s/\s+$//;
135-
141+
136142
# first see if task_name is the task path
137143
if (! -e "$task_path/config/config.txt") {
138144
($task_path = "$vtr_flow_path/tasks/$task_name") =~ s/\s+$//;
@@ -150,6 +156,10 @@ sub parse_single_task {
150156
my $qor_parse_file;
151157
my $second_parse_file;
152158
my $counter = 0;
159+
160+
#determine if this test individual test is compared to the golden values or not.
161+
my $single_check_golden = $check_golden;
162+
153163
foreach my $line (@config_data) {
154164

155165
# Ignore comments
@@ -173,8 +183,9 @@ sub parse_single_task {
173183
#second time parse file
174184
$second_parse_file = expand_user_path($value);
175185
$counter = 0;
176-
#don't need to check golden, only compare between two files
177-
$check_golden = 0;
186+
#don't need to check golden for this test, only compare between two files
187+
#If we used the check_golden vairable here, any test following this test would also not compare to golden values.
188+
$single_check_golden = 0;
178189
}
179190
else{
180191
$parse_file = expand_user_path($value);
@@ -281,11 +292,10 @@ sub parse_single_task {
281292
return check_two_files ( $task_name, $task_path, $run_path, "$run_path/parse_results.txt", "$run_path/parse_results_2.txt", 0);
282293

283294
}
284-
285-
if ($check_golden) {
295+
if ($single_check_golden) {
286296
#Returns 1 if failed
287297
if ($second_parse_file eq ""){
288-
return check_two_files( $task_name, $task_path, $run_path, "$run_path/parse_results.txt", "$task_path/config/golden_results.txt", $check_golden);
298+
return check_two_files( $task_name, $task_path, $run_path, "$run_path/parse_results.txt", "$task_path/config/golden_results.txt", $single_check_golden);
289299
}
290300
}
291301

vtr_flow/scripts/python_libs/vtr/flow.py

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +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,
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,
5254
):
5355
"""
5456
Runs the VTR CAD flow to map the specified circuit_file onto the target architecture_file
@@ -118,6 +120,11 @@ def run(
118120
check_incremental_sta_consistency :
119121
Do a second-run of the incremental analysis to compare the result files
120122
123+
check_route:
124+
Check first placement and routing by enabling VPR analysis
125+
126+
check_place:
127+
Route existing placement by enabling VPR routing.
121128
"""
122129

123130
#
@@ -236,7 +243,7 @@ def run(
236243
# Copy the input netlist for input to vpr
237244
shutil.copyfile(str(next_stage_netlist), str(pre_vpr_netlist))
238245
route_fixed_w = "route_chan_width" in vpr_args
239-
if ("route" in vpr_args or "place" in vpr_args) and not route_fixed_w:
246+
if (check_route or check_place) and not route_fixed_w:
240247
vpr_args["route_chan_width"] = 300
241248
route_fixed_w = True
242249

@@ -245,16 +252,8 @@ def run(
245252
do_second_run = False
246253
second_run_args = vpr_args
247254

248-
if "write_rr_graph" in vpr_args:
249-
do_second_run = True
250-
251-
if "analysis" in vpr_args:
252-
do_second_run = True
253-
del vpr_args["analysis"]
254-
255-
if "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
257-
del vpr_args["route"]
258257

259258
vtr.vpr.run(
260259
architecture_copy,
@@ -272,6 +271,10 @@ def run(
272271
if "write_rr_graph" in second_run_args
273272
else ".xml"
274273
)
274+
if check_place:
275+
second_run_args["route"] = True
276+
if check_route:
277+
second_run_args["analysis"] = True
275278
vtr.vpr.run_second_time(
276279
architecture_copy,
277280
pre_vpr_netlist,

vtr_flow/scripts/python_libs/vtr/util.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import argparse
1313
import csv
1414
from collections import OrderedDict
15-
16-
from vtr.error import VtrError, InspectError, CommandError
15+
import vtr.error
16+
from vtr.error import VtrError, CommandError
1717

1818
VERBOSITY_CHOICES = range(5)
1919

@@ -462,11 +462,13 @@ def load_config_lines(filepath, allow_includes=True):
462462
include_file_abs, allow_includes=allow_includes
463463
)
464464
else:
465-
raise InspectError("@include not allowed in this file", filepath)
465+
raise vtr.error.InspectError(
466+
"@include not allowed in this file", filepath
467+
)
466468
else:
467469
config_lines.append(line)
468470
except IOError as error:
469-
raise InspectError("Error opening config file ({})".format(error)) from error
471+
raise vtr.error.InspectError("Error opening config file ({})".format(error))
470472

471473
return config_lines
472474

vtr_flow/scripts/python_libs/vtr/vpr/vpr.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def run_relax_w(
5454
Path to the VPR executable
5555
5656
logfile_base:
57-
Base name for log files (e.g. "vpr" produces vpr.min_w.out, vpr.relaxed_w.out)
57+
Base name for log files (e.g. "vpr" produces vpr.out, vpr.crit_path.out)
5858
5959
vpr_args:
6060
Extra arguments for VPR
@@ -79,12 +79,6 @@ def run_relax_w(
7979
if "write_rr_graph" in vpr_args:
8080
del vpr_args["write_rr_graph"]
8181

82-
if "analysis" in vpr_args:
83-
del vpr_args["analysis"]
84-
85-
if "route" in vpr_args:
86-
del vpr_args["route"]
87-
8882
if vpr_exec is None:
8983
vpr_exec = find_vtr_file("vpr", is_executable=True)
9084

@@ -98,8 +92,8 @@ def run_relax_w(
9892
vpr_exec=vpr_exec,
9993
vpr_args=vpr_args,
10094
)
101-
102-
if ("pack" in vpr_args or "place" in vpr_args) and "route" not in vpr_args:
95+
explicit = "pack" in vpr_args or "place" in vpr_args or "analysis" in vpr_args
96+
if explicit and "route" not in vpr_args:
10397
# Don't look for min W if routing was not run
10498
return
10599
if max_router_iterations:

vtr_flow/scripts/run_vtr_flow.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ def vtr_command_main(arg_list, prog=None):
431431
check_incremental_sta_consistency=args.check_incremental_sta_consistency,
432432
use_old_abc_script=args.use_old_abc_script,
433433
relax_w_factor=args.relax_w_factor,
434+
check_route = args.check_route,
435+
check_place = args.check_place,
434436
)
435437
error_status = "OK"
436438
except vtr.VtrError as error:
@@ -572,10 +574,6 @@ def process_vpr_args(args, prog, temp_dir, vpr_args):
572574
if args.verify_rr_graph:
573575
rr_graph_out_file = "rr_graph" + args.rr_graph_ext
574576
vpr_args["write_rr_graph"] = rr_graph_out_file
575-
if args.check_place:
576-
vpr_args["route"] = True
577-
if args.check_route:
578-
vpr_args["analysis"] = True
579577

580578
return vpr_args
581579

@@ -629,7 +627,7 @@ def except_vtr_error(error, expect_fail, verbose):
629627
print("\tfull command: ", " ".join(error.cmd))
630628
print("\treturncode : ", error.returncode)
631629
print("\tlog file : ", error.log)
632-
exit_status = 1
630+
exit_status = error.returncode
633631
elif isinstance(error, vtr.InspectError):
634632
# Something went wrong gathering information
635633
print("\tfile : ", error.filename)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
arch circuit script_params vtr_flow_elapsed_time error odin_synth_time max_odin_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_time placed_wirelength_est 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_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 crit_path_route_time crit_path_total_timing_analysis_time crit_path_total_sta_time
2+
timing/k6_N10_40nm.xml clock_set_delay_aliases.blif common_-sdc_file_sdc/samples/clock_aliases/set_delay.sdc 0.13 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 -1 -1 success v8.0.0-2368-g3c56542c2-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 7.5.0 on Linux-4.15.0-111-generic x86_64 2020-08-07T14:08:33 goeders-ssh0 /home/shadtorrie/git/vtr-verilog-to-routing/vtr_flow/tasks/regression_tests/vtr_reg_strong/strong_clock_aliases_set_delay/run116/timing/k6_N10_40nm.xml/clock_set_delay_aliases.blif/common_-sdc_file_sdc/samples/clock_aliases/set_delay.sdc 8512 2 2 22 24 2 4 6 4 4 16 clb auto 0.01 4 0.01 0.00 1.293 0 0 1.293 1.181e-05 8.064e-06 0.000109995 9.1012e-05 6 20 2 215576 107788 3924.73 245.296 0.01 0.000804665 0.000648399 7 2 3 3 135 78 1.293 1.293 0 0 0 0 5503.53 343.971 0.00 0.000288477 0.000259906

0 commit comments

Comments
 (0)