@@ -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
329449def 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 )))
0 commit comments