Skip to content

Commit 7e35660

Browse files
authored
Merge pull request #2293 from verilog-to-routing/add_directory_noc_flow
Fix VTR Parser - NoC Flow File
2 parents 50a4e67 + 1945a23 commit 7e35660

File tree

7 files changed

+150
-113
lines changed

7 files changed

+150
-113
lines changed

vtr_flow/scripts/python_libs/vtr/parse_vtr_flow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def parse_vtr_flow(arg_list):
6666

6767
for param in extra_params:
6868
key, value = param.split("=", 1)
69+
if value == "None":
70+
continue
6971
extra_params_parsed[key] = value
7072
print(key, end="\t")
7173

vtr_flow/scripts/python_libs/vtr/task.py

Lines changed: 129 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,126 @@ def find_longest_task_description(configs):
325325
return longest
326326

327327

328+
def get_work_dir_addr(arch, circuit, noc_traffic):
329+
""" Get the work directory address under under run_dir """
330+
work_dir = None
331+
if noc_traffic:
332+
work_dir = str(PurePath(arch).joinpath(circuit).joinpath(noc_traffic))
333+
else:
334+
work_dir = str(PurePath(arch).joinpath(circuit))
335+
336+
return work_dir
337+
338+
339+
def create_second_parse_cmd(config):
340+
""" Create the parse command to run the second time """
341+
second_parse_cmd = None
342+
if config.second_parse_file:
343+
second_parse_cmd = [
344+
resolve_vtr_source_file(
345+
config,
346+
config.second_parse_file,
347+
str(PurePath("parse").joinpath("parse_config")),
348+
)
349+
]
350+
351+
return second_parse_cmd
352+
353+
354+
def create_cmd(abs_circuit_filepath, abs_arch_filepath, config, args, circuit, noc_traffic):
355+
""" Create the command to run the task """
356+
# Collect any extra script params from the config file
357+
cmd = [abs_circuit_filepath, abs_arch_filepath]
358+
359+
# Resolve and collect all include paths in the config file
360+
# as -include ["include1", "include2", ..]
361+
includes = []
362+
if config.includes:
363+
cmd += ["-include"]
364+
for include in config.includes:
365+
abs_include_filepath = resolve_vtr_source_file(config, include, config.include_dir)
366+
includes.append(abs_include_filepath)
367+
368+
cmd += includes
369+
370+
# Check if additional architectural data files are present
371+
if config.additional_files_list_add:
372+
for additional_file in config.additional_files_list_add:
373+
flag, file_name = additional_file.split(",")
374+
375+
cmd += [flag]
376+
cmd += [resolve_vtr_source_file(config, file_name, config.arch_dir)]
377+
378+
if hasattr(args, "show_failures") and args.show_failures:
379+
cmd += ["-show_failures"]
380+
cmd += config.script_params if config.script_params else []
381+
cmd += config.script_params_common if config.script_params_common else []
382+
cmd += (
383+
args.shared_script_params
384+
if hasattr(args, "shared_script_params") and args.shared_script_params
385+
else []
386+
)
387+
388+
# Apply any special config based parameters
389+
if config.cmos_tech_behavior:
390+
cmd += [
391+
"-cmos_tech",
392+
resolve_vtr_source_file(config, config.cmos_tech_behavior, "tech"),
393+
]
394+
395+
cmd += (
396+
["--fix_pins", resolve_vtr_source_file(config, config.pad_file)] if config.pad_file else []
397+
)
398+
399+
if config.sdc_dir:
400+
sdc_name = "{}.sdc".format(Path(circuit).stem)
401+
sdc_file = resolve_vtr_source_file(config, sdc_name, config.sdc_dir)
402+
403+
cmd += ["-sdc_file", "{}".format(sdc_file)]
404+
405+
if config.place_constr_dir:
406+
place_constr_name = "{}.place".format(Path(circuit).stem)
407+
place_constr_file = resolve_vtr_source_file(
408+
config, place_constr_name, config.place_constr_dir
409+
)
410+
411+
cmd += ["--fix_clusters", "{}".format(place_constr_file)]
412+
413+
parse_cmd = None
414+
qor_parse_command = None
415+
if config.parse_file:
416+
parse_cmd = [
417+
resolve_vtr_source_file(
418+
config,
419+
config.parse_file,
420+
str(PurePath("parse").joinpath("parse_config")),
421+
)
422+
]
423+
424+
second_parse_cmd = create_second_parse_cmd(config)
425+
426+
if config.qor_parse_file:
427+
qor_parse_command = [
428+
resolve_vtr_source_file(
429+
config,
430+
config.qor_parse_file,
431+
str(PurePath("parse").joinpath("qor_config")),
432+
)
433+
]
434+
# We specify less verbosity to the sub-script
435+
# This keeps the amount of output reasonable
436+
if hasattr(args, "verbosity") and max(0, args.verbosity - 1):
437+
cmd += ["-verbose"]
438+
439+
if noc_traffic:
440+
cmd += [
441+
"--noc_flows_file",
442+
resolve_vtr_source_file(config, noc_traffic, config.noc_traffic_dir),
443+
]
444+
445+
return includes, parse_cmd, second_parse_cmd, qor_parse_command, cmd
446+
447+
328448
# pylint: disable=too-many-branches
329449
def create_jobs(args, configs, after_run=False):
330450
"""
@@ -344,7 +464,7 @@ def create_jobs(args, configs, after_run=False):
344464
)
345465
abs_arch_filepath = resolve_vtr_source_file(config, arch, config.arch_dir)
346466
abs_circuit_filepath = resolve_vtr_source_file(config, circuit, config.circuit_dir)
347-
work_dir = str(PurePath(arch).joinpath(circuit))
467+
work_dir = get_work_dir_addr(arch, circuit, noc_traffic)
348468

349469
run_dir = (
350470
str(
@@ -357,107 +477,10 @@ def create_jobs(args, configs, after_run=False):
357477
)
358478
)
359479

360-
# Collect any extra script params from the config file
361-
cmd = [abs_circuit_filepath, abs_arch_filepath]
362-
363-
# Resolve and collect all include paths in the config file
364-
# as -include ["include1", "include2", ..]
365-
includes = []
366-
if config.includes:
367-
cmd += ["-include"]
368-
for include in config.includes:
369-
abs_include_filepath = resolve_vtr_source_file(
370-
config, include, config.include_dir
371-
)
372-
includes.append(abs_include_filepath)
373-
374-
cmd += includes
375-
376-
# Check if additional architectural data files are present
377-
if config.additional_files_list_add:
378-
for additional_file in config.additional_files_list_add:
379-
flag, file_name = additional_file.split(",")
380-
381-
cmd += [flag]
382-
cmd += [resolve_vtr_source_file(config, file_name, config.arch_dir)]
383-
384-
if hasattr(args, "show_failures") and args.show_failures:
385-
cmd += ["-show_failures"]
386-
cmd += config.script_params if config.script_params else []
387-
cmd += config.script_params_common if config.script_params_common else []
388-
cmd += (
389-
args.shared_script_params
390-
if hasattr(args, "shared_script_params") and args.shared_script_params
391-
else []
392-
)
393-
394-
# Apply any special config based parameters
395-
if config.cmos_tech_behavior:
396-
cmd += [
397-
"-cmos_tech",
398-
resolve_vtr_source_file(config, config.cmos_tech_behavior, "tech"),
399-
]
400-
401-
cmd += (
402-
["--fix_pins", resolve_vtr_source_file(config, config.pad_file)]
403-
if config.pad_file
404-
else []
480+
includes, parse_cmd, second_parse_cmd, qor_parse_command, cmd = create_cmd(
481+
abs_circuit_filepath, abs_arch_filepath, config, args, circuit, noc_traffic
405482
)
406483

407-
if config.sdc_dir:
408-
sdc_name = "{}.sdc".format(Path(circuit).stem)
409-
sdc_file = resolve_vtr_source_file(config, sdc_name, config.sdc_dir)
410-
411-
cmd += ["-sdc_file", "{}".format(sdc_file)]
412-
413-
if config.place_constr_dir:
414-
place_constr_name = "{}.place".format(Path(circuit).stem)
415-
place_constr_file = resolve_vtr_source_file(
416-
config, place_constr_name, config.place_constr_dir
417-
)
418-
419-
cmd += ["--fix_clusters", "{}".format(place_constr_file)]
420-
421-
parse_cmd = None
422-
second_parse_cmd = None
423-
qor_parse_command = None
424-
if config.parse_file:
425-
parse_cmd = [
426-
resolve_vtr_source_file(
427-
config,
428-
config.parse_file,
429-
str(PurePath("parse").joinpath("parse_config")),
430-
)
431-
]
432-
433-
if config.second_parse_file:
434-
second_parse_cmd = [
435-
resolve_vtr_source_file(
436-
config,
437-
config.second_parse_file,
438-
str(PurePath("parse").joinpath("parse_config")),
439-
)
440-
]
441-
442-
if config.qor_parse_file:
443-
qor_parse_command = [
444-
resolve_vtr_source_file(
445-
config,
446-
config.qor_parse_file,
447-
str(PurePath("parse").joinpath("qor_config")),
448-
)
449-
]
450-
# We specify less verbosity to the sub-script
451-
# This keeps the amount of output reasonable
452-
if hasattr(args, "verbosity") and max(0, args.verbosity - 1):
453-
cmd += ["-verbose"]
454-
455-
if noc_traffic:
456-
cmd += [
457-
"--noc_flows_file",
458-
resolve_vtr_source_file(config, noc_traffic, config.noc_traffic_dir),
459-
]
460-
461484
if config.script_params_list_add:
462485
for value in config.script_params_list_add:
463486
jobs.append(
@@ -467,6 +490,7 @@ def create_jobs(args, configs, after_run=False):
467490
circuit,
468491
includes,
469492
arch,
493+
noc_traffic,
470494
value,
471495
cmd,
472496
parse_cmd,
@@ -485,6 +509,7 @@ def create_jobs(args, configs, after_run=False):
485509
circuit,
486510
includes,
487511
arch,
512+
noc_traffic,
488513
None,
489514
cmd,
490515
parse_cmd,
@@ -505,6 +530,7 @@ def create_job(
505530
circuit,
506531
include,
507532
arch,
533+
noc_flow,
508534
param,
509535
cmd,
510536
parse_cmd,
@@ -554,6 +580,7 @@ def create_job(
554580
current_parse_cmd += [
555581
"arch={}".format(arch),
556582
"circuit={}".format(circuit),
583+
"noc_flow={}".format(noc_flow),
557584
"script_params={}".format(load_script_param(param)),
558585
]
559586
current_parse_cmd.insert(0, run_dir + "/{}".format(load_script_param(param)))
@@ -563,6 +590,7 @@ def create_job(
563590
current_second_parse_cmd += [
564591
"arch={}".format(arch),
565592
"circuit={}".format(circuit),
593+
"noc_flow={}".format(noc_flow),
566594
"script_params={}".format(load_script_param(param)),
567595
]
568596
current_second_parse_cmd.insert(0, run_dir + "/{}".format(load_script_param(param)))
@@ -572,6 +600,7 @@ def create_job(
572600
current_qor_parse_command += [
573601
"arch={}".format(arch),
574602
"circuit={}".format(circuit),
603+
"noc_flow={}".format(noc_flow),
575604
"script_params={}".format("common"),
576605
]
577606
current_qor_parse_command.insert(0, run_dir + "/{}".format(load_script_param(param)))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
arch circuit script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error 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 NoC_agg_bandwidth NoC_latency
2-
stratixiv_arch.timing_with_a_embedded_10X10_mesh_noc_topology.xml complex_64_noc_clique.blif common 8722.02 vpr 7.77 GiB -1 2 -1 -1 success v8.0.0-6827-g874e0cb8d-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 7.5.0 on Linux-4.15.0-167-generic x86_64 2023-01-19T13:42:08 betzgrp-wintermute.eecg.utoronto.ca /home/mahmo494/Desktop/add_noc_testcases/vtr-verilog-to-routing/vtr_flow/tasks 8148772 2 64 249332 210540 1 129121 8146 220 162 35640 -1 EP4SE820 2824.5 MiB 402.18 1227222 7957.8 MiB 792.01 4.20 6.60816 -853447 -6.60816 6.60816 2267.92 0.667678 0.54378 90.027 73.7401 154 1426225 49 0 0 3.59543e+08 10088.2 4276.17 411.681 346.038 1425419 20 357462 849967 447693681 43661832 7.19548 7.19548 -1.04483e+06 -7.19548 0 0 4.57197e+08 12828.2 417.73 79.91 33.4499 29.4545 8.4624e+09 8.0592e-05
1+
arch circuit noc_flow script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error 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 NoC_agg_bandwidth NoC_latency
2+
stratixiv_arch.timing_with_a_embedded_10X10_mesh_noc_topology.xml complex_64_noc_clique.blif complex_64_noc_clique.flows common 8722.02 vpr 7.77 GiB -1 2 -1 -1 success v8.0.0-6827-g874e0cb8d-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 7.5.0 on Linux-4.15.0-167-generic x86_64 2023-01-19T13:42:08 betzgrp-wintermute.eecg.utoronto.ca /home/mahmo494/Desktop/add_noc_testcases/vtr-verilog-to-routing/vtr_flow/tasks 8148772 2 64 249332 210540 1 129121 8146 220 162 35640 -1 EP4SE820 2824.5 MiB 402.18 1227222 7957.8 MiB 792.01 4.2 6.60816 -853447 -6.60816 6.60816 2267.92 0.667678 0.54378 90.027 73.7401 154 1426225 49 0 0 359543000 10088.2 4276.17 411.681 346.038 1425419 20 357462 849967 447693681 43661832 7.19548 7.19548 -1044830 -7.19548 0 0 457197000 12828.2 417.73 79.91 33.4499 29.4545 8462400000 8.0592E-05

0 commit comments

Comments
 (0)