@@ -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,159 @@ 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 (
351+ Path (get_latest_run_dir (find_task_dir (config , args .alt_tasks_dir )))
352+ / work_dir
357353 )
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- )
354+ if after_run
355+ else str (
356+ Path (get_next_run_dir (find_task_dir (config , args .alt_tasks_dir ))) / work_dir
357+ )
358+ )
379359
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- )
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+ )
392393
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 )
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 []
405+ )
396406
397- cmd += ["-sdc_file" , "{}" .format (sdc_file )]
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 )
398410
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- )
411+ cmd += ["-sdc_file" , "{}" .format (sdc_file )]
404412
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" )),
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
416417 )
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 :
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+
461+ if config .script_params_list_add :
462+ for value in config .script_params_list_add :
463+ jobs .append (
464+ create_job (
465+ args ,
466+ config ,
467+ circuit ,
468+ includes ,
469+ arch ,
470+ value ,
471+ cmd ,
472+ parse_cmd ,
473+ second_parse_cmd ,
474+ qor_parse_command ,
475+ work_dir ,
476+ run_dir ,
477+ golden_results ,
478+ )
479+ )
480+ else :
442481 jobs .append (
443482 create_job (
444483 args ,
445484 config ,
446485 circuit ,
447486 includes ,
448487 arch ,
449- value ,
488+ None ,
450489 cmd ,
451490 parse_cmd ,
452491 second_parse_cmd ,
@@ -456,24 +495,6 @@ def create_jobs(args, configs, after_run=False):
456495 golden_results ,
457496 )
458497 )
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- )
477498
478499 return jobs
479500
0 commit comments