@@ -552,46 +552,48 @@ def process_constraints_template(config):
552552 """
553553 # Define output directory
554554 output_folder = os .path .join (os .getcwd (), "objects" , "xdc" )
555- window_constraints_path = os .path .join (
556- config .the_window_folder_input , "TheWindowConstraints.xdc"
557- )
558-
559- # Create output directory if it doesn't exist
560- os .makedirs (output_folder , exist_ok = True )
561-
562- # Check if the window constraints file exists
563- if os .path .exists (window_constraints_path ):
564- with open (window_constraints_path , "r" , encoding = "utf-8" ) as f :
565- # Read the window constraints file
566- constraints_content = f .read ()
567-
568- # Extract content between markers
569- period_pattern = (
570- r"# BEGIN_LV_FPGA_PERIOD_CONSTRAINTS(.*?)# END_LV_FPGA_PERIOD_CONSTRAINTS"
571- )
572- clip_pattern = r"# BEGIN_LV_FPGA_CLIP_CONSTRAINTS(.*?)# END_LV_FPGA_CLIP_CONSTRAINTS"
573- from_to_pattern = (
574- r"# BEGIN_LV_FPGA_FROM_TO_CONSTRAINTS(.*?)# END_LV_FPGA_FROM_TO_CONSTRAINTS"
575- )
555+ if config .the_window_folder_input is None :
556+ print ("TheWindowFolder input is not specified in the configuration." )
557+ else :
558+ window_constraints_path = os .path .join (
559+ config .the_window_folder_input , "TheWindowConstraints.xdc"
560+ )
561+ # Create output directory if it doesn't exist
562+ os .makedirs (output_folder , exist_ok = True )
563+
564+ # Check if the window constraints file exists
565+ if os .path .exists (window_constraints_path ):
566+ with open (window_constraints_path , "r" , encoding = "utf-8" ) as f :
567+ # Read the window constraints file
568+ constraints_content = f .read ()
569+
570+ # Extract content between markers
571+ period_pattern = (
572+ r"# BEGIN_LV_FPGA_PERIOD_CONSTRAINTS(.*?)# END_LV_FPGA_PERIOD_CONSTRAINTS"
573+ )
574+ clip_pattern = r"# BEGIN_LV_FPGA_CLIP_CONSTRAINTS(.*?)# END_LV_FPGA_CLIP_CONSTRAINTS"
575+ from_to_pattern = (
576+ r"# BEGIN_LV_FPGA_FROM_TO_CONSTRAINTS(.*?)# END_LV_FPGA_FROM_TO_CONSTRAINTS"
577+ )
576578
577- period_match = re .search (period_pattern , constraints_content , re .DOTALL )
578- clip_match = re .search (clip_pattern , constraints_content , re .DOTALL )
579- from_to_match = re .search (from_to_pattern , constraints_content , re .DOTALL )
579+ period_match = re .search (period_pattern , constraints_content , re .DOTALL )
580+ clip_match = re .search (clip_pattern , constraints_content , re .DOTALL )
581+ from_to_match = re .search (from_to_pattern , constraints_content , re .DOTALL )
580582
581- if not period_match or not clip_match or not from_to_match :
582- print (
583- "Error: Could not find one or more marker sections in TheWindowConstraints.xdc"
584- )
585- return
583+ if not period_match or not clip_match or not from_to_match :
584+ print (
585+ "Error: Could not find one or more marker sections in TheWindowConstraints.xdc"
586+ )
587+ return
586588
587- period_content = period_match .group (1 )
588- clip_content = clip_match .group (1 )
589- from_to_content = from_to_match .group (1 )
590- else :
591- print (f"TheWindowConstraints.xdc file not found at { window_constraints_path } " )
592- period_content = ""
593- clip_content = ""
594- from_to_content = ""
589+ period_content = period_match .group (1 )
590+ clip_content = clip_match .group (1 )
591+ from_to_content = from_to_match .group (1 )
592+ else :
593+ print (f"TheWindowConstraints.xdc file not found at { window_constraints_path } " )
594+ period_content = ""
595+ clip_content = ""
596+ from_to_content = ""
595597
596598 # Read custom constraints file if specified
597599 custom_constraints_content = ""
0 commit comments