@@ -42,6 +42,8 @@ def __init__(
4242 script_params_list_add = None ,
4343 pass_requirements_file = None ,
4444 sdc_dir = None ,
45+ noc_traffic_list_add = None ,
46+ noc_traffics_dir = None ,
4547 place_constr_dir = None ,
4648 qor_parse_file = None ,
4749 cmos_tech_behavior = None ,
@@ -65,6 +67,8 @@ def __init__(
6567 self .script_params_list_add = script_params_list_add
6668 self .pass_requirements_file = pass_requirements_file
6769 self .sdc_dir = sdc_dir
70+ self .noc_traffics = noc_traffic_list_add
71+ self .noc_traffic_dir = noc_traffics_dir
6872 self .place_constr_dir = place_constr_dir
6973 self .qor_parse_file = qor_parse_file
7074 self .cmos_tech_behavior = cmos_tech_behavior
@@ -195,6 +199,7 @@ def load_task_config(config_file):
195199 "script_params_common" ,
196200 "pass_requirements_file" ,
197201 "sdc_dir" ,
202+ "noc_traffics_dir" ,
198203 "place_constr_dir" ,
199204 "qor_parse_file" ,
200205 "cmos_tech_behavior" ,
@@ -328,125 +333,153 @@ def create_jobs(args, configs, after_run=False):
328333 jobs = []
329334 for config in configs :
330335 for arch , circuit in itertools .product (config .archs , config .circuits ):
331- golden_results = load_parse_results (
332- str (PurePath (config .config_dir ).joinpath ("golden_results.txt" ))
333- )
334- abs_arch_filepath = resolve_vtr_source_file (config , arch , config .arch_dir )
335- abs_circuit_filepath = resolve_vtr_source_file (config , circuit , config .circuit_dir )
336- work_dir = str (PurePath (arch ).joinpath (circuit ))
337-
338- run_dir = (
339- str (Path (get_latest_run_dir (find_task_dir (config , args .alt_tasks_dir ))) / work_dir )
340- if after_run
341- else str (
342- Path (get_next_run_dir (find_task_dir (config , args .alt_tasks_dir ))) / work_dir
336+ noc_traffic = []
337+ if config .noc_traffics :
338+ noc_traffics = config .noc_traffics
339+ else :
340+ noc_traffics = [None ]
341+ for noc_traffic in noc_traffics :
342+ golden_results = load_parse_results (
343+ str (PurePath (config .config_dir ).joinpath ("golden_results.txt" ))
343344 )
344- )
345-
346- # Collect any extra script params from the config file
347- cmd = [abs_circuit_filepath , abs_arch_filepath ]
348-
349- # Resolve and collect all include paths in the config file
350- # as -include ["include1", "include2", ..]
351- includes = []
352- if config .includes :
353- cmd += ["-include" ]
354- for include in config .includes :
355- abs_include_filepath = resolve_vtr_source_file (
356- config , include , config .include_dir
345+ abs_arch_filepath = resolve_vtr_source_file (config , arch , config .arch_dir )
346+ abs_circuit_filepath = resolve_vtr_source_file (config , circuit , config .circuit_dir )
347+ work_dir = str (PurePath (arch ).joinpath (circuit ))
348+
349+ run_dir = (
350+ str (Path (get_latest_run_dir (find_task_dir (config , args .alt_tasks_dir ))) / work_dir )
351+ if after_run
352+ else str (
353+ Path (get_next_run_dir (find_task_dir (config , args .alt_tasks_dir ))) / work_dir
357354 )
358- includes .append (abs_include_filepath )
359-
360- cmd += includes
361-
362- # Check if additional architectural data files are present
363- if config .additional_files_list_add :
364- for additional_file in config .additional_files_list_add :
365- flag , file_name = additional_file .split ("," )
366-
367- cmd += [flag ]
368- cmd += [resolve_vtr_source_file (config , file_name , config .arch_dir )]
369-
370- if hasattr (args , "show_failures" ) and args .show_failures :
371- cmd += ["-show_failures" ]
372- cmd += config .script_params if config .script_params else []
373- cmd += config .script_params_common if config .script_params_common else []
374- cmd += (
375- args .shared_script_params
376- if hasattr (args , "shared_script_params" ) and args .shared_script_params
377- else []
378- )
355+ )
379356
380- # Apply any special config based parameters
381- if config .cmos_tech_behavior :
382- cmd += [
383- "-cmos_tech" ,
384- resolve_vtr_source_file (config , config .cmos_tech_behavior , "tech" ),
385- ]
386-
387- cmd += (
388- ["--fix_pins" , resolve_vtr_source_file (config , config .pad_file )]
389- if config .pad_file
390- else []
391- )
357+ # Collect any extra script params from the config file
358+ cmd = [abs_circuit_filepath , abs_arch_filepath ]
359+
360+ # Resolve and collect all include paths in the config file
361+ # as -include ["include1", "include2", ..]
362+ includes = []
363+ if config .includes :
364+ cmd += ["-include" ]
365+ for include in config .includes :
366+ abs_include_filepath = resolve_vtr_source_file (
367+ config , include , config .include_dir
368+ )
369+ includes .append (abs_include_filepath )
370+
371+ cmd += includes
372+
373+ # Check if additional architectural data files are present
374+ if config .additional_files_list_add :
375+ for additional_file in config .additional_files_list_add :
376+ flag , file_name = additional_file .split ("," )
377+
378+ cmd += [flag ]
379+ cmd += [resolve_vtr_source_file (config , file_name , config .arch_dir )]
380+
381+ if hasattr (args , "show_failures" ) and args .show_failures :
382+ cmd += ["-show_failures" ]
383+ cmd += config .script_params if config .script_params else []
384+ cmd += config .script_params_common if config .script_params_common else []
385+ cmd += (
386+ args .shared_script_params
387+ if hasattr (args , "shared_script_params" ) and args .shared_script_params
388+ else []
389+ )
392390
393- if config .sdc_dir :
394- sdc_name = "{}.sdc" .format (Path (circuit ).stem )
395- sdc_file = resolve_vtr_source_file (config , sdc_name , config .sdc_dir )
391+ # Apply any special config based parameters
392+ if config .cmos_tech_behavior :
393+ cmd += [
394+ "-cmos_tech" ,
395+ resolve_vtr_source_file (config , config .cmos_tech_behavior , "tech" ),
396+ ]
397+
398+ cmd += (
399+ ["--fix_pins" , resolve_vtr_source_file (config , config .pad_file )]
400+ if config .pad_file
401+ else []
402+ )
396403
397- cmd += ["-sdc_file" , "{}" .format (sdc_file )]
404+ if config .sdc_dir :
405+ sdc_name = "{}.sdc" .format (Path (circuit ).stem )
406+ sdc_file = resolve_vtr_source_file (config , sdc_name , config .sdc_dir )
398407
399- if config .place_constr_dir :
400- place_constr_name = "{}.place" .format (Path (circuit ).stem )
401- place_constr_file = resolve_vtr_source_file (
402- config , place_constr_name , config .place_constr_dir
403- )
408+ cmd += ["-sdc_file" , "{}" .format (sdc_file )]
404409
405- cmd += ["--fix_clusters" , "{}" .format (place_constr_file )]
406-
407- parse_cmd = None
408- second_parse_cmd = None
409- qor_parse_command = None
410- if config .parse_file :
411- parse_cmd = [
412- resolve_vtr_source_file (
413- config ,
414- config .parse_file ,
415- str (PurePath ("parse" ).joinpath ("parse_config" )),
410+ if config .place_constr_dir :
411+ place_constr_name = "{}.place" .format (Path (circuit ).stem )
412+ place_constr_file = resolve_vtr_source_file (
413+ config , place_constr_name , config .place_constr_dir
416414 )
417- ]
418-
419- if config .second_parse_file :
420- second_parse_cmd = [
421- resolve_vtr_source_file (
422- config ,
423- config .second_parse_file ,
424- str (PurePath ("parse" ).joinpath ("parse_config" )),
425- )
426- ]
427-
428- if config .qor_parse_file :
429- qor_parse_command = [
430- resolve_vtr_source_file (
431- config ,
432- config .qor_parse_file ,
433- str (PurePath ("parse" ).joinpath ("qor_config" )),
434- )
435- ]
436- # We specify less verbosity to the sub-script
437- # This keeps the amount of output reasonable
438- if hasattr (args , "verbosity" ) and max (0 , args .verbosity - 1 ):
439- cmd += ["-verbose" ]
440- if config .script_params_list_add :
441- for value in config .script_params_list_add :
415+
416+ cmd += ["--fix_clusters" , "{}" .format (place_constr_file )]
417+
418+ parse_cmd = None
419+ second_parse_cmd = None
420+ qor_parse_command = None
421+ if config .parse_file :
422+ parse_cmd = [
423+ resolve_vtr_source_file (
424+ config ,
425+ config .parse_file ,
426+ str (PurePath ("parse" ).joinpath ("parse_config" )),
427+ )
428+ ]
429+
430+ if config .second_parse_file :
431+ second_parse_cmd = [
432+ resolve_vtr_source_file (
433+ config ,
434+ config .second_parse_file ,
435+ str (PurePath ("parse" ).joinpath ("parse_config" )),
436+ )
437+ ]
438+
439+ if config .qor_parse_file :
440+ qor_parse_command = [
441+ resolve_vtr_source_file (
442+ config ,
443+ config .qor_parse_file ,
444+ str (PurePath ("parse" ).joinpath ("qor_config" )),
445+ )
446+ ]
447+ # We specify less verbosity to the sub-script
448+ # This keeps the amount of output reasonable
449+ if hasattr (args , "verbosity" ) and max (0 , args .verbosity - 1 ):
450+ cmd += ["-verbose" ]
451+
452+ if noc_traffic :
453+ cmd += ["--noc_flows_file" , resolve_vtr_source_file (config , noc_traffic , config .noc_traffic_dir )]
454+
455+ if config .script_params_list_add :
456+ for value in config .script_params_list_add :
457+ jobs .append (
458+ create_job (
459+ args ,
460+ config ,
461+ circuit ,
462+ includes ,
463+ arch ,
464+ value ,
465+ cmd ,
466+ parse_cmd ,
467+ second_parse_cmd ,
468+ qor_parse_command ,
469+ work_dir ,
470+ run_dir ,
471+ golden_results ,
472+ )
473+ )
474+ else :
442475 jobs .append (
443476 create_job (
444477 args ,
445478 config ,
446479 circuit ,
447480 includes ,
448481 arch ,
449- value ,
482+ None ,
450483 cmd ,
451484 parse_cmd ,
452485 second_parse_cmd ,
@@ -456,24 +489,6 @@ def create_jobs(args, configs, after_run=False):
456489 golden_results ,
457490 )
458491 )
459- else :
460- jobs .append (
461- create_job (
462- args ,
463- config ,
464- circuit ,
465- includes ,
466- arch ,
467- None ,
468- cmd ,
469- parse_cmd ,
470- second_parse_cmd ,
471- qor_parse_command ,
472- work_dir ,
473- run_dir ,
474- golden_results ,
475- )
476- )
477492
478493 return jobs
479494
0 commit comments