diff --git a/scripts/write_project_tcl_git.tcl b/scripts/write_project_tcl_git.tcl index 66e8c09..26a872c 100644 --- a/scripts/write_project_tcl_git.tcl +++ b/scripts/write_project_tcl_git.tcl @@ -49,14 +49,17 @@ proc write_project_tcl_git {args} { # Summary: # Export Tcl script for re-creating the current project - # Argument Usage: + # Argument Usage: # [-paths_relative_to = Script output directory path]: Override the reference directory variable for source file relative paths + # [-origin_dir_override ]: Set 'origin_dir' directory variable to the specified value (Default is value specified with the -paths_relative_to switch) # [-target_proj_dir = Current project directory path]: Directory where the project needs to be restored # [-force]: Overwrite existing tcl script file # [-all_properties]: Write all properties (default & non-default) for the project object(s) # [-no_copy_sources]: Do not import sources even if they were local in the original project # [-absolute_path]: Make all file paths absolute wrt the original project directory # [-dump_project_info]: Write object values + # [-use_bd_files ]: Use BD sources directly instead of writing out procs to create them + # [-internal]: Print basic header information in the generated tcl script # file: Name of the tcl script file to generate # Return Value: @@ -66,20 +69,39 @@ proc write_project_tcl_git {args} { # reset global variables variable a_global_vars - + reset_global_vars - + # process options for {set i 0} {$i < [llength $args]} {incr i} { set option [string trim [lindex $args $i]] switch -regexp -- $option { - "-paths_relative_to" { incr i;set a_global_vars(s_relative_to) [file normalize [lindex $args $i]] } - "-target_proj_dir" { incr i;set a_global_vars(s_target_proj_dir) [lindex $args $i] } + "-paths_relative_to" { + incr i; + if { [regexp {^-} [lindex $args $i]] } { + send_msg_id Vivado-projutils-021 ERROR "Missing value for the $option option.\ + Please provide a valid path/directory name immediately following '$option'" + return + } + set a_global_vars(s_relative_to) [file normalize [lindex $args $i]] + } + "-target_proj_dir" { + incr i; + if { [regexp {^-} [lindex $args $i]] } { + send_msg_id Vivado-projutils-021 ERROR "Missing value for the $option option.\ + Please provide a valid path/directory name immediately following '$option'" + return + } + set a_global_vars(s_target_proj_dir) [lindex $args $i] + } + "-origin_dir_override" { incr i;set a_global_vars(s_origin_dir_override) [lindex $args $i] } "-force" { set a_global_vars(b_arg_force) 1 } "-all_properties" { set a_global_vars(b_arg_all_props) 1 } "-no_copy_sources" { set a_global_vars(b_arg_no_copy_srcs) 1 } "-absolute_path" { set a_global_vars(b_absolute_path) 1 } "-dump_project_info" { set a_global_vars(b_arg_dump_proj_info) 1 } + "-use_bd_files" { set a_global_vars(b_arg_use_bd_files) 1 } + "-internal" { set a_global_vars(b_internal) 1 } default { # is incorrect switch specified? if { [regexp {^-} $option] } { @@ -90,25 +112,25 @@ proc write_project_tcl_git {args} { } } } - + # script file is a must if { [string equal $a_global_vars(script_file) ""] } { send_msg_id Vivado-projutils-002 ERROR "Missing value for option 'file', please type 'write_project_tcl -help' for usage info.\n" return } - + # should not be a directory if { [file isdirectory $a_global_vars(script_file)] } { send_msg_id Vivado-projutils-003 ERROR "The specified filename is a directory ($a_global_vars(script_file)), please type 'write_project_tcl -help' for usage info.\n" return } - + # check extension if { [file extension $a_global_vars(script_file)] != ".tcl" } { set a_global_vars(script_file) $a_global_vars(script_file).tcl } set a_global_vars(script_file) [file normalize $a_global_vars(script_file)] - + # error if file directory path does not exist set file_path [file dirname $a_global_vars(script_file)] if { ! [file exists $file_path] } { @@ -116,16 +138,26 @@ proc write_project_tcl_git {args} { send_msg_id Vivado-projutils-013 ERROR "Directory in which file ${script_filename} is to be written does not exist \[$a_global_vars(script_file)\]\n" return } - + # recommend -force if file exists if { [file exists $a_global_vars(script_file)] && !$a_global_vars(b_arg_force) } { send_msg_id Vivado-projutils-004 ERROR "Tcl Script '$a_global_vars(script_file)' already exist. Use -force option to overwrite.\n" return } + + if { [get_files -quiet *.bd] eq "" } { set a_global_vars(b_arg_use_bd_files) 1 } + + # -no_copy_sources cannot be used without -use_bd_files + if { $a_global_vars(b_arg_no_copy_srcs) && !$a_global_vars(b_arg_use_bd_files) } { + send_msg_id Vivado-projutils-019 ERROR "This design contains BD sources. The option -no_copy_sources cannot be used without -use_bd_files.\ + Please remove -no_copy_sources if you wish to write out BD's as procs in the project tcl, otherwise add the option -use_bd_files to directly\ + include the *.bd files to the new project \n" + return + } # set script file directory path set a_global_vars(s_path_to_script_dir) [file normalize $file_path] - + # now write if {[write_project_tcl_script]} { return @@ -145,7 +177,7 @@ variable b_project_board_set 0 # set file types to filter variable l_filetype_filter [list] - + # Setup filter for non-user-settable filetypes set l_filetype_filter [list "ip" "ipx" "embedded design sources" "elf" "coefficient files" "configuration files" \ "block diagrams" "block designs" "dsp design sources" "text" \ @@ -164,9 +196,9 @@ set a_fileset_types { } proc reset_global_vars {} { - # Summary: initializes global namespace vars + # Summary: initializes global namespace vars # This helper command is used to reset the variables used in the script. - # Argument Usage: + # Argument Usage: # none # Return Value: # None @@ -175,10 +207,12 @@ proc reset_global_vars {} { set a_global_vars(s_relative_to) {.} set a_global_vars(s_path_to_script_dir) "" + set a_global_vars(s_origin_dir_override) "" set a_global_vars(s_target_proj_dir) "" set a_global_vars(b_arg_force) 0 set a_global_vars(b_arg_no_copy_srcs) 0 set a_global_vars(b_absolute_path) 0 + set a_global_vars(b_internal) 0 set a_global_vars(b_arg_all_props) 0 set a_global_vars(b_arg_dump_proj_info) 0 set a_global_vars(b_local_sources) 0 @@ -187,6 +221,12 @@ proc reset_global_vars {} { set a_global_vars(dp_fh) 0 set a_global_vars(def_val_fh) 0 set a_global_vars(script_file) "" + + if { [get_param project.enableMergedProjTcl] } { + set a_global_vars(b_arg_use_bd_files) 0 + } else { + set a_global_vars(b_arg_use_bd_files) 1 + } set l_script_data [list] set l_local_files [list] @@ -194,9 +234,9 @@ proc reset_global_vars {} { } proc write_project_tcl_script {} { - # Summary: write project script + # Summary: write project script # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # none # Return Value: # true (0) if success, false (1) otherwise @@ -205,10 +245,26 @@ proc write_project_tcl_script {} { variable l_script_data variable l_remote_files variable l_local_files + variable temp_dir + variable temp_offset 1 + variable clean_temp + variable l_open_bds [list] + variable l_added_bds set l_script_data [list] set l_local_files [list] set l_remote_files [list] + set l_open_bds [list] + set l_added_bds [list] + + # Create temp directory (if required) for BD procs + set temp_dir [ file join [file dirname $a_global_vars(script_file)] .Xiltemp ] + set clean_temp 1 + if { [file isdirectory $temp_dir] || $a_global_vars(b_arg_use_bd_files) } { + set clean_temp 0 + } else { + file mkdir $temp_dir + } # get the project name set tcl_obj [current_project] @@ -246,12 +302,12 @@ proc write_project_tcl_script {} { # re-parse source fileset compile order for the current top - if {[llength [get_files -compile_order sources -used_in synthesis]] > 1} { + if {[llength [get_files -quiet -compile_order sources -used_in synthesis]] > 1} { update_compile_order -fileset [current_fileset] -quiet } # re-parse simlulation fileset compile order for the current top - if {[llength [get_files -compile_order sources -used_in simulation]] > 1} { + if {[llength [get_files -quiet -compile_order sources -used_in simulation]] > 1} { update_compile_order -fileset [current_fileset -simset] -quiet } } @@ -260,6 +316,10 @@ proc write_project_tcl_script {} { wr_create_project $proj_dir $proj_name $part_name wr_project_properties $proj_dir $proj_name wr_filesets $proj_dir $proj_name + wr_prflow $proj_dir $proj_name + if { !$a_global_vars(b_arg_use_bd_files) } { + wr_bd + } wr_runs $proj_dir $proj_name wr_proj_info $proj_name @@ -287,8 +347,13 @@ proc write_project_tcl_script {} { absolute path only, in the generated script. As such, the generated script will only work in the same filesystem where those absolute paths are accessible." } else { if { "." != $a_global_vars(s_relative_to) } { - send_msg_id Vivado-projutils-017 INFO "Please note that the -paths_relative_to switch was specified, hence the project source files will be referenced\n\ - wrt the path that was specified with this switch. The 'origin_dir' variable is set to this path in the generated script." + if { {} == $a_global_vars(s_origin_dir_override) } { + send_msg_id Vivado-projutils-017 INFO "Please note that the -paths_relative_to switch was specified, hence the project source files will be referenced\n\ + wrt the path that was specified with this switch. The 'origin_dir' variable is set to this path in the generated script." + } else { + send_msg_id Vivado-projutils-017 INFO "Please note that the -paths_relative_to switch was specified, hence the project source files will be referenced wrt the\n\ + path that was specified with this switch. The 'origin_dir' variable is set to '$a_global_vars(s_origin_dir_override)' in the generated script." + } } else { send_msg_id Vivado-projutils-015 INFO "Please note that by default, the file path for the project source files were set wrt the 'origin_dir' variable in the\n\ generated script. When this script is executed from the output directory, these source files will be referenced wrt this 'origin_dir' path value.\n\ @@ -312,9 +377,9 @@ proc write_project_tcl_script {} { } proc wr_create_project { proj_dir name part_name } { - # Summary: write create project command + # Summary: write create project command # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_dir: project directory path # name: project name # Return Value: @@ -332,7 +397,13 @@ proc wr_create_project { proj_dir name part_name } { lappend l_script_data " set origin_dir \$::$var_name" lappend l_script_data "\}" - lappend l_script_data "" + lappend l_script_data "" + set var_name "user_project_name" + lappend l_script_data "# Set the project name\nset project_name \"$name\"\n" + lappend l_script_data "# Use project name variable, if specified in the tcl shell" + lappend l_script_data "if \{ \[info exists ::$var_name\] \} \{" + lappend l_script_data " set project_name \$::$var_name" + lappend l_script_data "\}\n" lappend l_script_data "variable script_file" lappend l_script_data "set script_file \"[file tail $a_global_vars(script_file)]\"\n" @@ -347,14 +418,25 @@ proc wr_create_project { proj_dir name part_name } { lappend l_script_data " puts \"Syntax:\"" lappend l_script_data " puts \"\$script_file\"" lappend l_script_data " puts \"\$script_file -tclargs \\\[--origin_dir \\\]\"" + lappend l_script_data " puts \"\$script_file -tclargs \\\[--project_name \\\]\"" lappend l_script_data " puts \"\$script_file -tclargs \\\[--help\\\]\\n\"" lappend l_script_data " puts \"Usage:\"" lappend l_script_data " puts \"Name Description\"" lappend l_script_data " puts \"-------------------------------------------------------------------------\"" - lappend l_script_data " puts \"\\\[--origin_dir \\\] Determine source file paths wrt this path. Default\"" - lappend l_script_data " puts \" origin_dir path value is \\\".\\\", otherwise, the value\"" - lappend l_script_data " puts \" that was set with the \\\"-paths_relative_to\\\" switch\"" - lappend l_script_data " puts \" when this script was generated.\\n\"" + if { {} == $a_global_vars(s_origin_dir_override) } { + lappend l_script_data " puts \"\\\[--origin_dir \\\] Determine source file paths wrt this path. Default\"" + lappend l_script_data " puts \" origin_dir path value is \\\".\\\", otherwise, the value\"" + lappend l_script_data " puts \" that was set with the \\\"-paths_relative_to\\\" switch\"" + lappend l_script_data " puts \" when this script was generated.\\n\"" + } else { + lappend l_script_data " puts \"\\\[--origin_dir \\\] Determine source file paths wrt this path. Default\"" + lappend l_script_data " puts \" origin_dir path value is \\\".\\\", otherwise, the value\"" + lappend l_script_data " puts \" that was set with the \\\"-origin_dir_override\\\" switch\"" + lappend l_script_data " puts \" when this script was generated.\\n\"" + } + lappend l_script_data " puts \"\\\[--project_name \\\] Create project with the specified name. Default\"" + lappend l_script_data " puts \" name is the name of the project from where this\"" + lappend l_script_data " puts \" script was generated.\\n\"" lappend l_script_data " puts \"\\\[--help\\\] Print help information for this script\"" lappend l_script_data " puts \"-------------------------------------------------------------------------\\n\"" lappend l_script_data " exit 0" @@ -363,8 +445,9 @@ proc wr_create_project { proj_dir name part_name } { lappend l_script_data " for \{set i 0\} \{\$i < \[llength \$::argc\]\} \{incr i\} \{" lappend l_script_data " set option \[string trim \[lindex \$::argv \$i\]\]" lappend l_script_data " switch -regexp -- \$option \{" - lappend l_script_data " \"--origin_dir\" \{ incr i; set origin_dir \[lindex \$::argv \$i\] \}" - lappend l_script_data " \"--help\" \{ help \}" + lappend l_script_data " \"--origin_dir\" \{ incr i; set origin_dir \[lindex \$::argv \$i\] \}" + lappend l_script_data " \"--project_name\" \{ incr i; set project_name \[lindex \$::argv \$i\] \}" + lappend l_script_data " \"--help\" \{ help \}" lappend l_script_data " default \{" lappend l_script_data " if \{ \[regexp \{^-\} \$option\] \} \{" lappend l_script_data " puts \"ERROR: Unknown option '\$option' specified, please type '\$script_file -tclargs --help' for usage info.\\n\"" @@ -387,30 +470,30 @@ proc wr_create_project { proj_dir name part_name } { # create project lappend l_script_data "# Create project" - + set tcl_cmd "" # set target project directory path if specified. If not, create project dir in current dir. set target_dir $a_global_vars(s_target_proj_dir) if { {} == $target_dir } { - set tcl_cmd "create_project $name \$origin_dir/vivado_proj -part $part_name -quiet -force" + set tcl_cmd "create_project \$\{project_name\} \$origin_dir/vivado_proj -part $part_name -quiet -force" } else { - # is specified target proj dir == current dir? + # is specified target proj dir == current dir? set cwd [file normalize [string map {\\ /} [pwd]]] set dir [file normalize [string map {\\ /} $target_dir]] if { [string equal $cwd $dir] } { - set tcl_cmd "create_project $name -part $part_name" + set tcl_cmd "create_project \$project_name -part $part_name" } else { - set tcl_cmd "create_project $name \"$target_dir\" -part $part_name" + set tcl_cmd "create_project \$project_name \"$target_dir\" -part $part_name" } } - + if { [get_property managed_ip [current_project]] } { set tcl_cmd "$tcl_cmd -ip" } lappend l_script_data $tcl_cmd if { $a_global_vars(b_arg_dump_proj_info) } { - puts $a_global_vars(dp_fh) "project_name=$name" + puts $a_global_vars(dp_fh) "project_name=\$\{project_name\}" } lappend l_script_data "" @@ -432,7 +515,7 @@ proc wr_create_project { proj_dir name part_name } { proc wr_project_properties { proj_dir proj_name } { # Summary: write project properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_name: project name # Return Value: # None @@ -445,7 +528,7 @@ proc wr_project_properties { proj_dir proj_name } { set get_what "get_projects" lappend l_script_data "# Set project properties" - lappend l_script_data "set obj \[$get_what $tcl_obj\]" + lappend l_script_data "set obj \[current_project\]" # is project "board_part" set already? if { [string length [get_property "board_part" $tcl_obj]] > 0 } { @@ -455,10 +538,191 @@ proc wr_project_properties { proj_dir proj_name } { write_props $proj_dir $proj_name $get_what $tcl_obj "project" } +proc write_bd_as_proc { bd_file } { + # Summary: writes out BD creation steps as a proc + # Argument: BD file + # Return Value: None + + variable l_added_bds + variable l_bd_proc_calls + variable l_script_data + variable temp_offset + variable l_open_bds + variable temp_dir + variable bd_prop_steps + + if { [lsearch $l_added_bds $bd_file] != -1 } { return } + + set to_close 1 + + # Add sources referenced in the BD + add_references $bd_file + + + # Open BD in stealth mode, if not already open + set bd_filename [file tail $bd_file] + if { [lsearch $l_open_bds $bd_filename] != -1 } { + set to_close 0 + } else { + open_bd_design -stealth [ get_files $bd_file ] + } + current_bd_design [get_bd_designs [file rootname $bd_filename]] + + # write the BD as a proc to a temp file + while { [file exists [file join $temp_dir "temp_$temp_offset.tcl"]] } { + incr temp_offset + } + set temp_bd_file [file join $temp_dir "temp_$temp_offset.tcl"] + write_bd_tcl -no_project_wrapper -make_local $temp_bd_file + + # Set non default properties for the BD + wr_bd_properties $bd_file + + # Close BD if opened in stealth mode + if {$to_close == 1 } { + #close_bd_design -stealth [ get_files $bd_file ] +#close_bd_design [get_bd_designs [file rootname $bd_filename]] + close_bd_design [get_bd_designs [file rootname $bd_filename]] + } + + # Get proc call + if {[catch {open $temp_bd_file r} fp]} { + send_msg_id Vivado-projutils-020 ERROR "failed to write out proc for $bd_file \n" + return 1 + } + # TODO no need to read whole file, just second line will do + set file_data [read $fp ] + set split_proc [split $file_data] + set proc_index 7 + set str [lindex $split_proc $proc_index] + close $fp + + # Add the BD proc, call to the proc and BD property steps + if { [string equal [lindex $split_proc [expr {$proc_index-1}] ] "proc"] + && [regexp {^cr_bd_.*} $str] + } then { + append str " \"\"" + lappend l_script_data "\n" + lappend l_script_data $file_data + lappend l_added_bds $bd_file + lappend l_script_data $str + lappend l_script_data $bd_prop_steps + } + + # delete temp file + file delete $temp_bd_file + incr temp_offset +} + +proc wr_bd_properties { file } { + # Summary: writes non default BD properties + # Argument: the .BD file + # Return Value: none + variable bd_prop_steps + variable a_global_vars + + set bd_prop_steps "" + set bd_name [get_property FILE_NAME [current_bd_design]] + set bd_props [list_property [ get_files $file ] ] + set read_only_props [rdi::get_attr_specs -object [get_files $file] -filter {is_readonly}] + + foreach prop $bd_props { + if { [lsearch $read_only_props $prop] != -1 + || [string equal -nocase $prop "file_type" ] + } then { continue } + set def_val [list_property_value -default $prop [ get_files $file ] ] + set cur_val [get_property $prop [get_files $file ] ] + + set def_val \"$def_val\" + set cur_val \"$cur_val\" + + if { $a_global_vars(b_arg_all_props) } { + append bd_prop_steps "set_property $prop $cur_val \[get_files $bd_name \] \n" + } else { + if { $def_val ne $cur_val } { + append bd_prop_steps "set_property $prop $cur_val \[get_files $bd_name \] \n" + } + } + } +} + +proc add_references { sub_design } { + # Summary: Looks for sources referenced in the block design and adds them + # Argument: sub_design file + # Return Value: None + + variable l_script_data + variable l_added_bds + + # Getting references, if any + + set refs [ get_files -quiet -references -of_objects [ get_files $sub_design ] ] + foreach file $refs { + if { [file extension $file ] ==".bd" } { + if { [lsearch $l_added_bds $file] != -1 } { continue } + + # Write out referred bd as a proc + write_bd_as_proc $file + } else { + # Skip adding file if it's already part of the project + lappend l_script_data "if { \[get_files [file tail $file]\] == \"\" } {" + lappend l_script_data " import_files -quiet -fileset [current_fileset -srcset] $file\n}" + } + } +} + +proc wr_bd {} { + # Summary: write procs to create BD's + # Return Value: None + + variable a_global_vars + variable l_script_data + variable l_added_bds + variable l_bd_proc_calls + variable l_open_bds [list] + variable temp_dir + variable clean_temp + + + # String that will hold commands to set BD properties + variable bd_prop_steps "\n# Setting BD properties \n" + + # Get already opened BD designs + set open_bd_names [get_bd_designs] + foreach bd_name $open_bd_names { + lappend l_open_bds [get_property FILE_NAME [get_bd_designs $bd_name]] + } + + # Get all BD files in the design + set bd_files [get_files -norecurse *.bd] + lappend l_script_data "\n# Adding sources referenced in BDs, if not already added" + + + foreach bd_file $bd_files { + # Making sure BD is not locked + set is_locked [get_property IS_LOCKED [get_files $bd_file ] ] + if { $is_locked == 1 } { + file delete $a_global_vars(script_file) + send_msg_id Vivado-projutils-018 ERROR "Project tcl cannot be written as the design contains one or more \ + locked/out-of-date design(s). Please run report_ip_status and update the design.\n" + return 1 + } + + # Write out bd as a proc + write_bd_as_proc $bd_file + } + + + # Delete temp directory + if { $clean_temp == 1} { + file delete -force $temp_dir + } +} + proc wr_filesets { proj_dir proj_name } { - # Summary: write fileset object properties + # Summary: write fileset object properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_name: project name # Return Value: # None @@ -473,9 +737,9 @@ proc wr_filesets { proj_dir proj_name } { } proc write_specified_fileset { proj_dir proj_name filesets } { - # Summary: write fileset properties and sources + # Summary: write fileset properties and sources # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_name: project name # filesets: list of filesets # Return Value: @@ -506,7 +770,7 @@ proc write_specified_fileset { proj_dir proj_name filesets } { set fs_sw_type [get_fileset_type_switch $fs_type] lappend l_script_data " create_fileset $fs_sw_type $tcl_obj" - lappend l_script_data "\}\n" + lappend l_script_data "\}\n" } set get_what_fs "get_filesets" @@ -517,7 +781,7 @@ proc write_specified_fileset { proj_dir proj_name filesets } { # This means that we should not write these properties, they are read-only set blockset_is_ooc1 false if { {BlockSrcs} == $fs_type } { - set current_fs_files [get_files -of_objects [get_filesets $tcl_obj] -norecurse] + set current_fs_files [get_files -quiet -of_objects [get_filesets $tcl_obj] -norecurse] if { [llength $current_fs_files] == 1 } { set only_file_in_fs [lindex $current_fs_files 0] set file_type [get_property FILE_TYPE $only_file_in_fs] @@ -525,7 +789,7 @@ proc write_specified_fileset { proj_dir proj_name filesets } { } } if { $blockset_is_ooc1} { - # We do not write properties for OOC1 + # We do not write properties for OOC1 } elseif { ({RTL} == [get_property design_mode [get_filesets $tcl_obj]]) } { set repo_paths [get_ip_repo_paths $tcl_obj] if { [llength $repo_paths] > 0 } { @@ -542,8 +806,8 @@ proc write_specified_fileset { proj_dir proj_name filesets } { } } set repo_path_str [join $path_list " "] - lappend l_script_data "set_property \"ip_repo_paths\" \"${repo_path_str}\" \$obj" - lappend l_script_data "" + lappend l_script_data "set_property \"ip_repo_paths\" \"${repo_path_str}\" \$obj" + lappend l_script_data "" lappend l_script_data "# Rebuild user ip_repo's index before adding any source files" lappend l_script_data "update_ip_catalog -rebuild" lappend l_script_data "" @@ -566,7 +830,7 @@ proc write_specified_fileset { proj_dir proj_name filesets } { } else { write_files $proj_dir $proj_name $tcl_obj $type } - + # is this a IP block fileset? if yes, do not write block fileset properties (block fileset doesnot exist in new project) if { [is_ip_fileset $tcl_obj] } { # do not write ip fileset properties @@ -579,9 +843,9 @@ proc write_specified_fileset { proj_dir proj_name filesets } { } proc wr_runs { proj_dir proj_name } { - # Summary: write runs and properties + # Summary: write runs and properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_name: project name # Return Value: # None @@ -608,22 +872,22 @@ proc wr_runs { proj_dir proj_name } { } proc wr_proj_info { proj_name } { - # Summary: write generated project status message + # Summary: write generated project status message # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # proj_name: project name # Return Value: # None variable l_script_data - lappend l_script_data "\nputs \"INFO: Project created:$proj_name\"" + lappend l_script_data "\nputs \"INFO: Project created:\$project_name\"" } proc write_header { proj_dir proj_name file } { - # Summary: write script header + # Summary: write script header # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # None @@ -638,7 +902,8 @@ proc write_header { proj_dir proj_name file } { set version_id [join [lrange $version 1 end] " "] set tcl_file [file tail $file] - puts $a_global_vars(fh) "#\n# $product (TM) $version_id" + puts $a_global_vars(fh) "#*****************************************************************************************" + puts $a_global_vars(fh) "# $product (TM) $version_id" puts $a_global_vars(fh) "#\n# $tcl_file: Tcl script for re-creating project '$proj_name'\n#" puts $a_global_vars(fh) "# $copyright" puts $a_global_vars(fh) "#\n# This file contains the $product Tcl commands for re-creating the project to the state*" @@ -652,9 +917,9 @@ proc write_header { proj_dir proj_name file } { } proc print_local_file_msg { msg_type } { - # Summary: print warning on finding local sources + # Summary: print warning on finding local sources # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # None @@ -673,11 +938,11 @@ proc print_local_file_msg { msg_type } { proc get_ip_repo_paths { tcl_obj } { # Summary: # Iterate over the fileset properties and get the ip_repo_paths (if set) - # Argument Usage: + # Argument Usage: # tcl_obj : fileset # Return Value: # List of repo paths - + set repo_path_list [list] foreach path [get_property ip_repo_paths [get_filesets $tcl_obj]] { lappend repo_path_list $path @@ -685,23 +950,10 @@ proc get_ip_repo_paths { tcl_obj } { return $repo_path_list } -proc is_deprecated { prop } { - # Summary: filter deprecated properties - # Argument Usage: - # Return Value: - # true (1) if found, false (1) otherwise - - set prop [string toupper $prop] - if { $prop == "BOARD" } { - return 1 - } - return 0 -} - proc filter { prop val { file {} } } { # Summary: filter special properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # true (1) if found, false (1) otherwise @@ -747,13 +999,15 @@ proc filter { prop val { file {} } } { } proc is_local_to_project { file } { - # Summary: check if file is local to the project directory structure + # Summary: check if file is local to the project directory structure # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # true (1), if file is local to the project (inside project directory structure) # false (0), if file is outside the project directory structure + # Remove quotes for proper normalize output + set file [string trim $file "\""] set dir [get_property directory [current_project]] set proj_comps [split [string trim [file normalize [string map {\\ /} $dir]]] "/"] set file_comps [split [string trim [file normalize [string map {\\ /} $file]]] "/"] @@ -786,7 +1040,7 @@ proc is_ip_readonly_prop { name } { proc write_properties { prop_info_list get_what tcl_obj } { # Summary: write object properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # None @@ -799,15 +1053,13 @@ proc write_properties { prop_info_list get_what tcl_obj } { set elem [split $x "#"] set name [lindex $elem 0] set value [lindex $elem 1] - if { [regexp "more options" $name] } { - set cmd_str "set_property -name {$name} -value {$value} -objects" - } elseif { ([is_ip_readonly_prop $name]) && ([string equal $get_what "get_files"]) } { + if { ([is_ip_readonly_prop $name]) && ([string equal $get_what "get_files"]) } { set cmd_str "if \{ !\[get_property \"is_locked\" \$file_obj\] \} \{" lappend l_script_data "$cmd_str" - set cmd_str " set_property \"$name\" \"$value\"" + set cmd_str " set_property -name \"$name\" -value \"$value\" -objects" set b_add_closing_brace 1 } else { - set cmd_str "set_property \"$name\" \"$value\"" + set cmd_str "set_property -name \"$name\" -value \"$value\" -objects" } if { [string equal $get_what "get_files"] } { lappend l_script_data "$cmd_str \$file_obj" @@ -826,14 +1078,53 @@ proc write_properties { prop_info_list get_what tcl_obj } { lappend l_script_data "$cmd_str \$obj" } } - } + } lappend l_script_data "" } +proc align_project_properties { prop proj_name proj_file_path } { + # Summary: + # Argument Usage: + # Return Value: + + variable a_global_vars + + set dir_suffix {} + if { {} == $prop } { + return $proj_file_path + } + + # align project properties to have project name variable + if {[string equal -nocase $prop "ip_output_repo"] || + [string equal -nocase $prop "sim.ipstatic.compiled_library_dir"] } { + set dir_suffix "cache" + } else { + if {[string equal -nocase $prop "sim.central_dir"] || + [string equal -nocase $prop "ip.user_files_dir"] || + [string equal -nocase $prop "sim.ipstatic.source_dir"] } { + set dir_suffix "ip_user_files" + }} + + # skip other properties + if { {} == $dir_suffix } { + return $proj_file_path + } + + set match_str "${proj_name}/${proj_name}.${dir_suffix}" + set proj_file_path [string map {\\ /} $proj_file_path] + if { [regexp $match_str $proj_file_path] } { + set proj_file_path [regsub -all "${proj_name}" $proj_file_path "\$\{project_name\}"] + } else { + set match_str "${proj_name}.${dir_suffix}" + set proj_file_path [regsub "${proj_name}\.${dir_suffix}" $proj_file_path "\$\{project_name\}\.${dir_suffix}"] + } + return $proj_file_path +} + proc write_props { proj_dir proj_name get_what tcl_obj type } { # Summary: write first class object properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none @@ -847,18 +1138,24 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { set properties [list_property [$get_what $tcl_obj]] foreach prop $properties { - if { [is_deprecated $prop] } { continue } - + if { [is_deprecated_property $prop] } { continue } # skip read-only properties if { [lsearch $read_only_props $prop] != -1 } { continue } - # skip ip_output_repo (contains absolute path) - if { - [string equal $type "project"] && [string equal -nocase $prop "ip_output_repo"] - } { continue } + # skip writing PR-Configuration, attached right after creation of impl run + if { ([get_property pr_flow [current_project]] == 1) && [string equal $type "run"] } { + set isImplRun [get_property is_implementation [$get_what $tcl_obj]] + if { ($isImplRun == 1) && [string equal -nocase $prop "pr_configuration"] } { + continue + } + } set prop_type "unknown" if { [string equal $type "run"] } { + # skip steps..reports dynamic read only property (to be populated by creation of reports) + if { [regexp -nocase "STEPS\..*\.REPORTS" $prop] } { + continue; + } if { [regexp "STEPS" $prop] } { # skip step properties } else { @@ -883,7 +1180,7 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { if { [filter $prop $cur_val] } { continue } # do not set "runs" or "project" part, if "board_part" is set - if { ([string equal $type "project"] || [string equal $type "run"]) && + if { ([string equal $type "project"] || [string equal $type "run"]) && [string equal -nocase $prop "part"] && $b_project_board_set } { continue @@ -896,10 +1193,41 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { continue } + # do not set default_rm for partitionDef initially as RM is not created at time of creation of pdef + if { [string equal $type "partitionDef"] && + [string equal -nocase $prop "default_rm"] } { + continue + } + # re-align values set cur_val [get_target_bool_val $def_val $cur_val] - - set prop_entry "[string tolower $prop]#[get_property $prop [$get_what $tcl_obj]]" + set abs_proj_file_path [get_property $prop [$get_what $tcl_obj]] + + set path_match [string match $proj_dir* $abs_proj_file_path] + if { ($path_match == 1) && ($a_global_vars(b_absolute_path) != 1) } { + # changing the absolute path to relative + set abs_path_length [string length $proj_dir] + set proj_file_path [string replace $abs_proj_file_path 0 $abs_path_length "\$proj_dir/"] + set proj_file_path [align_project_properties $prop $proj_name $proj_file_path] + set prop_entry "[string tolower $prop]#$proj_file_path" + } else { + set abs_proj_file_path [align_project_properties $prop $proj_name $abs_proj_file_path] + set prop_entry "[string tolower $prop]#$abs_proj_file_path" + } + + # re-align include dir path wrt origin dir + if { [string equal -nocase $prop "include_dirs"] } { + if { [llength $abs_proj_file_path] > 0 } { + if { !$a_global_vars(b_absolute_path) } { + set incl_paths $abs_proj_file_path + set rel_paths [list] + foreach path $incl_paths { + lappend rel_paths "\[file normalize \"\$origin_dir/[get_relative_file_path_for_source $path [get_script_execution_dir]]\"\]" + } + set prop_entry "[string tolower $prop]#[join $rel_paths " "]" + } + } + } # fix paths wrt the original project dir if {([string equal -nocase $prop "top_file"]) && ($cur_val != "") } { @@ -919,33 +1247,30 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { } elseif {([string equal -nocase $prop "target_constrs_file"] || [string equal -nocase $prop "target_ucf"]) && ($cur_val != "") } { - + set file $cur_val set fs_name $tcl_obj set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] set src_file [join [lrange $path_dirs [lsearch -exact $path_dirs "$fs_name"] end] "/"] - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list $file]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list $file]] 0] set file_props [list_property $file_object] if { [lsearch $file_props "IMPORTED_FROM"] != -1 } { if { $a_global_vars(b_arg_no_copy_srcs) } { set proj_file_path "\$orig_proj_dir/${proj_name}.srcs/$src_file" } else { - set proj_file_path "\$proj_dir/${proj_name}.srcs/$src_file" + set proj_file_path "\$proj_dir/\$project_name.srcs/$src_file" } } else { # is file new inside project? if { [is_local_to_project $file] } { - # is file inside fileset dir? - if { [regexp "^${fs_name}/" $src_file] } { - set proj_file_path "\$orig_proj_dir/${proj_name}.srcs/$src_file" - } else { - set file_no_quotes [string trim $file "\""] - set rel_file_path [get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]] - set proj_file_path "\[file normalize \"\$origin_dir/$rel_file_path\"\]" - #set proj_file_path "$file" - } + set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] + set local_constrs_file [join [lrange $path_dirs end-1 end] "/"] + set local_constrs_file [string trimleft $local_constrs_file "/"] + set local_constrs_file [string trimleft $local_constrs_file "\\"] + set file $local_constrs_file + set proj_file_path "\[get_files *$local_constrs_file\]" } else { if { $a_global_vars(b_absolute_path) } { set proj_file_path "$file" @@ -960,7 +1285,7 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { set prop_entry "[string tolower $prop]#$proj_file_path" } - + # re-align compiled_library_dir if { [string equal -nocase $prop "compxlib.compiled_library_dir"] || [string equal -nocase $prop "compxlib.modelsim_compiled_library_dir"] || @@ -975,6 +1300,7 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { if {[lsearch -exact $path_dirs "$cache_dir"] > 0} { set dir_path [join [lrange $path_dirs [lsearch -exact $path_dirs "$cache_dir"] end] "/"] set compile_lib_dir_path "\$proj_dir/$dir_path" + set compile_lib_dir_path [regsub $cache_dir $compile_lib_dir_path "\$\{project_name\}\.cache"] } set prop_entry "[string tolower $prop]#$compile_lib_dir_path" } @@ -1048,9 +1374,9 @@ proc write_props { proj_dir proj_name get_what tcl_obj type } { } proc add_simulator_props { get_what tcl_obj prop_info_list_arg } { - # Summary: write file and file properties + # Summary: write file and file properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none upvar $prop_info_list_arg prop_info_list @@ -1068,10 +1394,10 @@ proc add_simulator_props { get_what tcl_obj prop_info_list_arg } { proc write_simulator_props { prefix get_what tcl_obj prop_info_list_arg } { # Summary: write non-default simulator properties - # Argument Usage: + # Argument Usage: # Return Value: # none - + upvar $prop_info_list_arg prop_info_list variable a_global_vars variable l_script_data @@ -1101,12 +1427,16 @@ proc write_simulator_props { prefix get_what tcl_obj prop_info_list_arg } { proc is_deprecated_property { property } { # Summary: filter old properties - # Argument Usage: + # Argument Usage: # Return Value: set property [string tolower $property] - if { [string equal $property "runtime"] || + if { [string equal $property "board"] || + [string equal $property "verilog_dir"] || + [string equal $property "compxlib.compiled_library_dir"] || + [string equal $property "dsa.build_flow"] || + [string equal $property "runtime"] || [string equal $property "unit_under_test"] || [string equal $property "xelab.snapshot"] || [string equal $property "xelab.debug_level"] || @@ -1121,6 +1451,7 @@ proc is_deprecated_property { property } { [string equal $property "xsim.view"] || [string equal $property "xsim.wdb"] || [string equal $property "xsim.saif"] || + [string equal $property "xsim.tclbatch"] || [string equal $property "xsim.more_options"] || [string equal $property "modelsim.custom_do"] || [string equal $property "modelsim.custom_udo"] || @@ -1134,16 +1465,21 @@ proc is_deprecated_property { property } { [string equal $property "modelsim.64bit"] || [string equal $property "modelsim.vsim_more_options"] || [string equal $property "modelsim.vlog_more_options"] || - [string equal $property "modelsim.vcom_more_options"] } { + [string equal $property "modelsim.vcom_more_options"] || + [string equal $property "xsim.simulate.uut"] || + [string equal $property "modelsim.simulate.uut"] || + [string equal $property "questa.simulate.uut"] || + [string equal $property "ies.simulate.uut"] || + [string equal $property "vcs.simulate.uut"] } { return true } return false } proc write_files { proj_dir proj_name tcl_obj type } { - # Summary: write file and file properties + # Summary: write file and file properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none @@ -1164,14 +1500,16 @@ proc write_files { proj_dir proj_name tcl_obj type } { set import_coln [list] set add_file_coln [list] - foreach file [get_files -norecurse -of_objects [get_filesets $tcl_obj]] { + foreach file [get_files -quiet -norecurse -of_objects [get_filesets $tcl_obj]] { if { [file extension $file] == ".xcix" } { continue } + # Skip direct import/add of BD files if -use_bd_files is not provided + if { [file extension $file] == ".bd" && !$a_global_vars(b_arg_use_bd_files) } { continue } set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] set begin [lsearch -exact $path_dirs "$proj_name.srcs"] set src_file [join [lrange $path_dirs $begin+1 end] "/"] # fetch first object - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list $file]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list $file]] 0] set file_props [list_property $file_object] if { [lsearch $file_props "IMPORTED_FROM"] != -1 } { @@ -1211,45 +1549,36 @@ proc write_files { proj_dir proj_name tcl_obj type } { } # add to the import collection - set file_no_quotes [string trim $file "\""] - set org_file_path "\$origin_dir/[get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]]" - lappend import_coln "\"\[file normalize \"$org_file_path\"\]\"" + if { $a_global_vars(b_absolute_path) } { + lappend import_coln [file normalize [string trim $file "\""]] + } else { + set file_no_quotes [string trim $file "\""] + set org_file_path "\$origin_dir/[get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]]" + lappend import_coln "\"\[file normalize \"$org_file_path\"\]\"" + } lappend l_local_file_list $file } else { + if {$a_global_vars(b_absolute_path) } { + lappend add_file_coln [string trim $file "\""] + } else { + set file_no_quotes [string trim $file "\""] + set org_file_path "\$origin_dir/[get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]]" + lappend add_file_coln "\"\[file normalize \"$org_file_path\"\]\"" + } lappend l_remote_file_list $file } - # add file to collection - if { $a_global_vars(b_arg_no_copy_srcs) && (!$a_global_vars(b_absolute_path))} { - set file_no_quotes [string trim $file "\""] - set rel_file_path [get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]] - set file1 "\"\[file normalize \"\$origin_dir/$rel_file_path\"\]\"" - lappend add_file_coln "$file1" - } else { - lappend add_file_coln "$file" - } - - # set flag that local sources were found and print warning at the end - if { !$a_global_vars(b_local_sources) } { - set a_global_vars(b_local_sources) 1 - } } } - - if {[llength $add_file_coln]>0} { + # set flag that local sources were found and print warning at the end + if { (!$a_global_vars(b_local_sources)) && ([llength l_local_file_list] > 0) } { + set a_global_vars(b_local_sources) 1 + } + + if {[llength $add_file_coln]>0} { lappend l_script_data "set files \[list \\" foreach file $add_file_coln { - if { $a_global_vars(b_absolute_path) } { lappend l_script_data " $file\\" - } else { - if { $a_global_vars(b_arg_no_copy_srcs) } { - lappend l_script_data " $file\\" - } else { - set file_no_quotes [string trim $file "\""] - set rel_file_path [get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]] - lappend l_script_data " \"\[file normalize \"\$origin_dir/$rel_file_path\"\]\"\\" - } - } } lappend l_script_data "\]" lappend l_script_data "add_files -norecurse -fileset \$obj \$files" @@ -1257,23 +1586,36 @@ proc write_files { proj_dir proj_name tcl_obj type } { } # now import local files if -no_copy_sources is not specified - if { ! $a_global_vars(b_arg_no_copy_srcs)} { if { [llength $import_coln] > 0 } { - lappend l_script_data "# Import local files from the original project" - lappend l_script_data "set files \[list \\" - foreach ifile $import_coln { - lappend l_script_data " $ifile\\" - } - lappend l_script_data "\]" - # is this a IP block fileset? if yes, import files into current source fileset - if { [is_ip_fileset $tcl_obj] } { - lappend l_script_data "set imported_files \[import_files -fileset [current_fileset -srcset] \$files\]" - } else { - lappend l_script_data "set imported_files \[import_files -fileset $tcl_obj \$files\]" - } + if { ! $a_global_vars(b_arg_no_copy_srcs)} { + lappend l_script_data "# Import local files from the original project" + lappend l_script_data "set files \[list \\" + foreach ifile $import_coln { + lappend l_script_data " $ifile\\" + } + lappend l_script_data "\]" + # is this a IP block fileset? if yes, import files into current source fileset + if { [is_ip_fileset $tcl_obj] } { + lappend l_script_data "set imported_files \[import_files -fileset [current_fileset -srcset] \$files\]" + } else { + lappend l_script_data "set imported_files \[import_files -fileset $tcl_obj \$files\]" + } + } else { + lappend l_script_data "# Add local files from the original project (-no_copy_sources specified)" + lappend l_script_data "set files \[list \\" + foreach ifile $import_coln { + lappend l_script_data " $ifile\\" + } + lappend l_script_data "\]" + # is this a IP block fileset? if yes, add files into current source fileset + if { [is_ip_fileset $tcl_obj] } { + lappend l_script_data "set added_files \[add_files -fileset [current_fileset -srcset] \$files\]" + } else { + lappend l_script_data "set added_files \[add_files -fileset $tcl_obj \$files\]" + } + } lappend l_script_data "" - } - } + } # write fileset file properties for remote files (added sources) write_fileset_file_properties $tcl_obj $fs_name $proj_dir $l_remote_file_list "remote" @@ -1284,8 +1626,8 @@ proc write_files { proj_dir proj_name tcl_obj type } { } proc write_constrs { proj_dir proj_name tcl_obj type } { - # Summary: write constrs fileset files and properties - # Argument Usage: + # Summary: write constrs fileset files and properties + # Argument Usage: # Return Value: # none @@ -1300,17 +1642,17 @@ proc write_constrs { proj_dir proj_name tcl_obj type } { return } - foreach file [get_files -norecurse -of_objects [get_filesets $tcl_obj]] { + foreach file [get_files -quiet -norecurse -of_objects [get_filesets $tcl_obj]] { lappend l_script_data "# Add/Import constrs file and set constrs file properties" set constrs_file {} set file_category {} set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] set begin [lsearch -exact $path_dirs "$proj_name.srcs"] set src_file [join [lrange $path_dirs $begin+1 end] "/"] - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list $file]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list $file]] 0] set file_props [list_property $file_object] - # constrs sources imported? + # constrs sources imported? if { [lsearch $file_props "IMPORTED_FROM"] != -1 } { set imported_path [get_property "imported_from" $file] set rel_file_path [get_relative_file_path_for_source $file [get_script_execution_dir]] @@ -1361,7 +1703,7 @@ proc write_constrs { proj_dir proj_name tcl_obj type } { } else { # file is added from remote location, so set it as remote in the new project set file_category "remote" - + # find relative file path of the added constrs if no_copy in the new project if { $a_global_vars(b_arg_no_copy_srcs) && (!$a_global_vars(b_absolute_path))} { set file_no_quotes [string trim $file "\""] @@ -1383,9 +1725,9 @@ proc write_constrs { proj_dir proj_name tcl_obj type } { } proc add_constrs_file { file_str } { - # Summary: add constrs file + # Summary: add constrs file # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none @@ -1407,9 +1749,9 @@ proc add_constrs_file { file_str } { } proc import_constrs_file { tcl_obj file_str } { - # Summary: import constrs file + # Summary: import constrs file # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none @@ -1424,9 +1766,9 @@ proc import_constrs_file { tcl_obj file_str } { } proc write_constrs_fileset_file_properties { tcl_obj fs_name proj_dir file file_category } { - # Summary: write constrs fileset file properties + # Summary: write constrs fileset file properties # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: # none @@ -1445,7 +1787,7 @@ proc write_constrs_fileset_file_properties { tcl_obj fs_name proj_dir file file_ } set file [string trim $file "\""] - + # fix file path for local files if { [string equal $file_category "local"] } { set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] @@ -1457,9 +1799,9 @@ proc write_constrs_fileset_file_properties { tcl_obj fs_name proj_dir file file_ set file_object "" if { [string equal $file_category "local"] } { - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list "*$file"]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list "*$file"]] 0] } elseif { [string equal $file_category "remote"] } { - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list $file]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list $file]] 0] } # get the constrs file properties @@ -1532,11 +1874,11 @@ proc write_constrs_fileset_file_properties { tcl_obj fs_name proj_dir file file_ } proc write_specified_run { proj_dir proj_name runs } { - # Summary: write the specified run information + # Summary: write the specified run information # This helper command is used to script help. - # Argument Usage: + # Argument Usage: # Return Value: - # none + # none variable a_global_vars variable l_script_data @@ -1558,33 +1900,63 @@ proc write_specified_run { proj_dir proj_name runs } { set parent_run_str " -parent_run $parent_run" } + set fileset_type [get_property fileset_type [get_property srcset [$get_what $tcl_obj]]] + set isImplRun [get_property is_implementation [$get_what $tcl_obj]] + set isPRProject [get_property pr_flow [current_project]] + set def_flow_type_val [list_property_value -default flow [$get_what $tcl_obj]] set cur_flow_type_val [get_property flow [$get_what $tcl_obj]] set def_strat_type_val [list_property_value -default strategy [$get_what $tcl_obj]] set cur_strat_type_val [get_property strategy [$get_what $tcl_obj]] + set isChildImplRun 0 + if { $isPRProject == 1 && $isImplRun == 1 && $parent_run != "" } { + set isChildImplRun [get_property is_implementation [$get_what $parent_run]] + if { $isChildImplRun == 1 } { + set prConfig [get_property pr_configuration [get_runs $tcl_obj]] + if { [get_pr_configurations $prConfig] == "" } { +# review this change. Either skip this run creation or flag error while sourcing script...??? + continue + } + } + } + + set cmd_str " create_run -name $tcl_obj -part $part -flow {$cur_flow_type_val} -strategy \"$cur_strat_type_val\"" + + if { $isChildImplRun == 1 } { + set cmd_str " $cmd_str -pr_config $prConfig" + } + lappend l_script_data "# Create '$tcl_obj' run (if not found)" lappend l_script_data "if \{\[string equal \[get_runs -quiet $tcl_obj\] \"\"\]\} \{" - set cmd_str " create_run -name $tcl_obj -part $part -flow {$cur_flow_type_val} -strategy \"$cur_strat_type_val\"" lappend l_script_data "$cmd_str -constrset $constrs_set$parent_run_str" lappend l_script_data "\} else \{" lappend l_script_data " set_property strategy \"$cur_strat_type_val\" \[get_runs $tcl_obj\]" lappend l_script_data " set_property flow \"$cur_flow_type_val\" \[get_runs $tcl_obj\]" lappend l_script_data "\}" + if { ($isImplRun == 1) && ($isPRProject == 1 && $isChildImplRun == 0) && ({DesignSrcs} == $fileset_type) } { + set prConfig [get_property pr_configuration [get_runs $tcl_obj]] + if { [get_pr_configurations $prConfig] != "" } { + lappend l_script_data "set_property pr_configuration $prConfig \[get_runs $tcl_obj\]" + } + } + lappend l_script_data "set obj \[$get_what $tcl_obj\]" write_props $proj_dir $proj_name $get_what $tcl_obj "run" + + write_report_strategy $tcl_obj } } proc get_fileset_type_switch { fileset_type } { # Summary: Return the fileset type switch for a given fileset - # Argument Usage: + # Argument Usage: # Return Value: # Fileset type switch name - + variable a_fileset_types - + set fs_switch "" foreach {fs_data} $a_fileset_types { set fs_type [lindex $fs_data 0] @@ -1599,11 +1971,11 @@ proc get_fileset_type_switch { fileset_type } { proc get_target_bool_val { def_val cur_val } { # Summary: Resolve current boolean property value wrt its default value - # Argument Usage: + # Argument Usage: # Return Value: # Resolved boolean value - - set target_val $cur_val + + set target_val $cur_val if { [string equal $def_val "false"] && [string equal $cur_val "0"] } { set target_val "false" } \ elseif { [string equal $def_val "true"] && [string equal $cur_val "1"] } { set target_val "true" } \ @@ -1615,9 +1987,9 @@ proc get_target_bool_val { def_val cur_val } { } proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_category } { - # Summary: + # Summary: # Write fileset file properties for local and remote files - # Argument Usage: + # Argument Usage: # tcl_obj: object to inspect # fs_name: fileset name # l_file_list: list of files (local or remote) @@ -1629,7 +2001,7 @@ proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_c variable l_script_data variable l_local_files variable l_remote_files - + # is this a IP block fileset? if yes, set current source fileset if { [is_ip_fileset $tcl_obj] } { lappend l_script_data "# Set '[current_fileset -srcset]' fileset file properties for $file_category files" @@ -1646,10 +2018,10 @@ proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_c lappend l_remote_files $file } else {} } - + foreach file $l_file_list { set file [string trim $file "\""] - + # fix file path for local files if { [string equal $file_category "local"] } { set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] @@ -1661,9 +2033,9 @@ proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_c set file_object "" if { [string equal $file_category "local"] } { - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list "*$file"]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list "*$file"]] 0] } elseif { [string equal $file_category "remote"] } { - set file_object [lindex [get_files -of_objects [get_filesets $fs_name] [list $file]] 0] + set file_object [lindex [get_files -quiet -of_objects [get_filesets $fs_name] [list $file]] 0] } set file_props [list_property $file_object] @@ -1676,6 +2048,11 @@ proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_c continue } + # Fix for CR-939211 + if { ([file extension $file] == ".bd") && ([string equal -nocase $file_prop "generate_synth_checkpoint"] || [string equal -nocase $file_prop "synth_checkpoint_mode"]) } { + continue + } + set prop_type [get_property type [rdi::get_attr_specs $file_prop -object $file_object]] set def_val [list_property_value -default $file_prop $file_object] set cur_val [get_property $file_prop $file_object] @@ -1743,7 +2120,7 @@ proc write_fileset_file_properties { tcl_obj fs_name proj_dir l_file_list file_c proc get_script_execution_dir { } { # Summary: Return script directory path from where the script will be executed - # Argument Usage: + # Argument Usage: # none # Return Value: # Path to the script direc @@ -1868,6 +2245,24 @@ proc is_ip_fileset { fileset } { # true (1) if success, false (0) otherwise # make sure fileset is block fileset type + set isPRFlow [get_property pr_flow [current_project]] + set isRMFileset 0 + + if { $isPRFlow == 1 } { + set allReconfigModules [get_reconfig_modules] + foreach reconfigmodule $allReconfigModules { + set rmFileset [get_filesets -of_objects [get_reconfig_modules $reconfigmodule]] + if { [string equal $rmFileset $fileset] } { + set isRMFileset 1 + break + } + } + } + + if { $isRMFileset == 1 } { + return false + } + if { {BlockSrcs} != [get_property fileset_type [get_filesets $fileset]] } { return false } @@ -1876,7 +2271,7 @@ proc is_ip_fileset { fileset } { set ips [get_files -all -quiet -of_objects [get_filesets $fileset] -filter $ip_filter] set b_found false foreach ip $ips { - if { [get_property generate_synth_checkpoint [lindex [get_files -all $ip] 0]] } { + if { [get_property generate_synth_checkpoint [lindex [get_files -quiet -all $ip] 0]] } { set b_found true break } @@ -1915,8 +2310,539 @@ proc is_ip_run { run } { # run: run name # Return Value: # true (1) if success, false (0) otherwise - + set fileset [get_property srcset [get_runs $run]] return [is_ip_fileset $fileset] } + +proc wr_prflow { proj_dir proj_name } { + # Summary: write partial reconfiguration and properties + # This helper command is used to script help. + # Argument Usage: + # proj_name: project name + # Return Value: + # None + + if { [get_property pr_flow [current_project]] == 0 } { + return + } + + # write below properties only if it's a pr project + wr_pdefs $proj_dir $proj_name + wr_reconfigModules $proj_dir $proj_name + wr_prConf $proj_dir $proj_name +} + +proc wr_pdefs { proj_dir proj_name } { + # Summary: write partial reconfiguration and properties + # This helper command is used to script help. + # Argument Usage: + # proj_name: project name + # Return Value: + # None + + # write pDef i.e. create partition def + set partitionDefs [get_partition_def] + + foreach partitionDef $partitionDefs { + write_specified_partition_definition $proj_dir $proj_name $partitionDef + } +} + +proc write_specified_partition_definition { proj_dir proj_name pDef } { + # Summary: write the specified partition definition + # This helper command is used to script help. + # Argument Usage: + # Return Value: + # none + + variable l_script_data + + set get_what "get_partition_defs" + + set pdefName [get_property name [$get_what $pDef]] + set moduleName [get_property module_name [$get_what $pDef]] + set pdef_library [get_property library [$get_what $pDef]] + set default_library [get_property default_lib [current_project]] + + set cmd_str "create_partition_def -name $pdefName -module $moduleName" + if { ($pdef_library != "") && (![string equal $pdef_library $default_library]) } { + set cmd_str "$cmd_str -library $pdef_library" + } + + lappend l_script_data "# Create '$pdefName' partition definition" + lappend l_script_data "$cmd_str" + + lappend l_script_data "set obj \[$get_what $pDef\]" + write_props $proj_dir $proj_name $get_what $pDef "partitionDef" +} + +proc wr_reconfigModules { proj_dir proj_name } { + # Summary: write reconfiguration modules for RPs + # This helper command is used to script help. + # Argument Usage: + # proj_name: project name + # Return Value: + # None + + # write reconfigurations modules + set reconfigModules [get_reconfig_modules] + + foreach rm $reconfigModules { + set rm_bds [get_files -quiet -of_objects [get_reconfig_modules $rm] *.bd] + foreach rm_bd $rm_bds { + write_bd_as_proc $rm_bd + } + + write_specified_reconfig_module $proj_dir $proj_name $rm + } +} + +proc write_specified_reconfig_module { proj_dir proj_name reconfModule } { + # Summary: write the specified partial reconfiguration module information + # This helper command is used to script help. + # Argument Usage: + # Return Value: + # none + + variable l_script_data + + set get_what "get_reconfig_modules" + + # fetch all the run attritubes and properties of passed reconfig modules + set name [get_property name [$get_what $reconfModule]] + set partitionDefName [get_property partition_def [$get_what $reconfModule]] + set isGateLevelSet [get_property is_gate_level [$get_what $reconfModule]] + + lappend l_script_data "# Create '$reconfModule' reconfigurable module" + lappend l_script_data "set partitionDef \[get_partition_defs $partitionDefName\]" + + if { $isGateLevelSet } { + set moduleName [get_property module_name [$get_what $reconfModule]] + if { $moduleName == "" } { + return + } + lappend l_script_data "create_reconfig_module -name $name -top $moduleName -partition_def \$partitionDef -gate_level" + } else { + lappend l_script_data "create_reconfig_module -name $name -partition_def \$partitionDef" + } + + # write default_rm property for pDef if RM and its corresponding property for pDef->defaultRM is same + set defaultRM_for_pDef [get_property default_rm [get_partition_def $partitionDefName]] + + if { [string equal $reconfModule $defaultRM_for_pDef] } { + lappend l_script_data "set_property default_rm $reconfModule \$partitionDef" + } + + lappend l_script_data "set obj \[$get_what $reconfModule\]" + write_props $proj_dir $proj_name $get_what $reconfModule "reconfigModule" + + write_reconfigmodule_files $proj_dir $proj_name $reconfModule +} + +proc wr_prConf {proj_dir proj_name} { + # Summary: write reconfiguration modules for RPs + # This helper command is used to script help. + # Argument Usage: + # proj_name: project name + # Return Value: + # None + + # write pr configurations + set prConfigurations [get_pr_configurations] + + foreach prConfig $prConfigurations { + write_specified_prConfiguration $proj_dir $proj_name $prConfig + } +} + +proc write_specified_prConfiguration { proj_dir proj_name prConfig } { + # Summary: write the specified pr reconfiguration + # This helper command is used to script help. + # Argument Usage: + # Return Value: + # none + + variable l_script_data + + set get_what "get_pr_configurations" + + # fetch pr config properties + set name [get_property name [$get_what $prConfig]] + + lappend l_script_data "# Create '$prConfig' pr configurations" + lappend l_script_data "create_pr_configuration -name $name" + + lappend l_script_data "set obj \[$get_what $prConfig\]" + write_props $proj_dir $proj_name $get_what $prConfig "prConfiguration" +} + +proc write_reconfigmodule_files { proj_dir proj_name reconfigModule } { + # Summary: write file and file properties + # This helper command is used to script help. + # Argument Usage: + # Return Value: + # none + + variable a_global_vars + variable l_script_data + + set l_local_file_list [list] + set l_remote_file_list [list] + + # return if empty fileset + if {[llength [get_files -quiet -norecurse -of_objects [get_filesets -of_objects $reconfigModule]]] == 0 } { + lappend l_script_data "# Empty (no sources present)\n" + return + } + + set fileset [get_filesets -of_objects $reconfigModule] + set fs_name [get_property name $fileset] + + set import_coln [list] + set add_file_coln [list] + set bd_list [list] + + foreach file [get_files -quiet -norecurse -of_objects [get_filesets -of_objects $reconfigModule]] { + if { [file extension $file ] ==".bd" && !$a_global_vars(b_arg_use_bd_files)} { + lappend bd_list $file + continue + } + set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] + set begin [lsearch -exact $path_dirs "$proj_name.srcs"] + set src_file [join [lrange $path_dirs $begin+1 end] "/"] + + # fetch first object + set file_object [lindex [get_files -quiet -norecurse -of_objects [get_filesets -of_objects $reconfigModule] [list $file]] 0] + set file_props [list_property $file_object] + + if { [lsearch $file_props "IMPORTED_FROM"] != -1 } { + + # import files + set imported_path [get_property "imported_from" $file] + set rel_file_path [get_relative_file_path_for_source $file [get_script_execution_dir]] + set proj_file_path "\$origin_dir/$rel_file_path" + + set file "\"[file normalize $proj_dir/${proj_name}.srcs/$src_file]\"" + + if { $a_global_vars(b_arg_no_copy_srcs) } { + # add to the local collection + lappend l_remote_file_list $file + if { $a_global_vars(b_absolute_path) } { + lappend add_file_coln "$file" + } else { + lappend add_file_coln "\"\[file normalize \"$proj_file_path\"\]\"" + } + } else { + # add to the import collection + lappend l_local_file_list $file + if { $a_global_vars(b_absolute_path) } { + lappend import_coln "$file" + } else { + lappend import_coln "\"\[file normalize \"$proj_file_path\"\]\"" + } + } + + } else { + set file "\"$file\"" + + # is local? add to local project, add to collection and then import this collection by default unless -no_copy_sources is specified + if { [is_local_to_project $file] } { + if { $a_global_vars(b_arg_dump_proj_info) } { + set src_file "\$PSRCDIR/$src_file" + } + + # add to the import collection + set file_no_quotes [string trim $file "\""] + set org_file_path "\$origin_dir/[get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]]" + lappend import_coln "\"\[file normalize \"$org_file_path\"\]\"" + lappend l_local_file_list $file + } else { + lappend l_remote_file_list $file + } + + # add file to collection + if { $a_global_vars(b_arg_no_copy_srcs) && (!$a_global_vars(b_absolute_path))} { + set file_no_quotes [string trim $file "\""] + set rel_file_path [get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]] + set file1 "\"\[file normalize \"\$origin_dir/$rel_file_path\"\]\"" + lappend add_file_coln "$file1" + } else { + lappend add_file_coln "$file" + } + + } + } + + if {[llength $bd_list] > 0 } { + foreach bd_file $bd_list { + set filename [file tail $bd_file] + lappend l_script_data " move_files \[ get_files $filename \] -of_objects \[get_reconfig_modules $reconfigModule\]" + } + } + + if {[llength $add_file_coln]>0} { + lappend l_script_data "set files \[list \\" + foreach file $add_file_coln { + if { $a_global_vars(b_absolute_path) } { + lappend l_script_data " $file\\" + } else { + if { $a_global_vars(b_arg_no_copy_srcs) } { + lappend l_script_data " $file\\" + } else { + set file_no_quotes [string trim $file "\""] + set rel_file_path [get_relative_file_path_for_source $file_no_quotes [get_script_execution_dir]] + lappend l_script_data " \"\[file normalize \"\$origin_dir/$rel_file_path\"\]\"\\" + } + } + } + lappend l_script_data "\]" + lappend l_script_data "add_files -norecurse -of_objects \[get_reconfig_modules $reconfigModule\] \$files" + lappend l_script_data "" + } + + # now import local files if -no_copy_sources is not specified + if { ! $a_global_vars(b_arg_no_copy_srcs)} { + if { [llength $import_coln] > 0 } { + lappend l_script_data "# Import local files from the original project" + lappend l_script_data "set files \[list \\" + foreach ifile $import_coln { + lappend l_script_data " $ifile\\" + } + lappend l_script_data "\]" + lappend l_script_data "import_files -of_objects \[get_reconfig_modules $reconfigModule\] \$files" + lappend l_script_data "" + } + } + + # write fileset file properties for remote files (added sources) + write_reconfigmodule_file_properties $reconfigModule $fs_name $proj_dir $l_remote_file_list "remote" + + # write fileset file properties for local files (imported sources) + write_reconfigmodule_file_properties $reconfigModule $fs_name $proj_dir $l_local_file_list "local" + + # move sub-design files (XCI/BD) of reconfig modules from sources fileset to reconfig-module (RM) fileset + add_reconfigmodule_subdesign_files $reconfigModule +} + +proc add_reconfigmodule_subdesign_files { reconfigModule } { + # Summary: + # Argument Usage: + # Return Value: + + variable l_script_data + + foreach rmSubdesignFileset [get_property subdesign_filesets $reconfigModule] { + foreach fileObj [get_files -quiet -norecurse -of_objects [get_filesets $rmSubdesignFileset]] { + set path_dirs [split [string trim [file normalize [string map {\\ /} $fileObj ]]] "/"] + set path [join [lrange $path_dirs end-1 end] "/"] + set path [string trimleft $path "/"] + lappend l_script_data "move_files -of_objects \$obj \[get_files *$path\]" + lappend l_script_data "" + } + } +} + +proc write_reconfigmodule_file_properties { reconfigModule fs_name proj_dir l_file_list file_category } { + # Summary: + # Write fileset file properties for local and remote files + # Argument Usage: + # reconfigModule : object to inspect + # fs_name: fileset name + # l_file_list: list of files (local or remote) + # file_category: file catwgory (local or remote) + # Return Value: + # none + + + variable a_global_vars + variable l_script_data + variable l_local_files + variable l_remote_files + + set l_local_files [list] + set l_remote_files [list] + + set tcl_obj [get_filesets -of_objects $reconfigModule] + + lappend l_script_data "# Set '$reconfigModule' fileset file properties for $file_category files" + set file_prop_count 0 + + # collect local/remote files + foreach file $l_file_list { + if { [string equal $file_category "local"] } { + lappend l_local_files $file + } elseif { [string equal $file_category "remote"] } { + lappend l_remote_files $file + } else {} + } + + foreach file $l_file_list { + set file [string trim $file "\""] + + # fix file path for local files + if { [string equal $file_category "local"] } { + set path_dirs [split [string trim [file normalize [string map {\\ /} $file]]] "/"] + set src_file [join [lrange $path_dirs end-1 end] "/"] + set src_file [string trimleft $src_file "/"] + set src_file [string trimleft $src_file "\\"] + set file $src_file + } + + set file_object "" + if { [string equal $file_category "local"] } { + set file_object [lindex [get_files -quiet -norecurse -of_objects [get_filesets -of_objects $reconfigModule] [list "*$file"]] 0] + } elseif { [string equal $file_category "remote"] } { + set file_object [lindex [get_files -quiet -norecurse -of_objects [get_filesets -of_objects $reconfigModule] [list $file]] 0] + } + + set file_props [list_property $file_object] + set prop_info_list [list] + set prop_count 0 + + foreach file_prop $file_props { + set is_readonly [get_property is_readonly [rdi::get_attr_specs $file_prop -object $file_object]] + if { [string equal $is_readonly "1"] } { + continue + } + + set prop_type [get_property type [rdi::get_attr_specs $file_prop -object $file_object]] + set def_val [list_property_value -default $file_prop $file_object] + set cur_val [get_property $file_prop $file_object] + + # filter special properties + if { [filter $file_prop $cur_val $file] } { continue } + + # re-align values + set cur_val [get_target_bool_val $def_val $cur_val] + + set dump_prop_name [string tolower ${fs_name}_file_${file_prop}] + set prop_entry "" + if { [string equal $file_category "local"] } { + set prop_entry "[string tolower $file_prop]#[get_property $file_prop $file_object]" + } elseif { [string equal $file_category "remote"] } { + set prop_value_entry [get_property $file_prop $file_object] + set prop_entry "[string tolower $file_prop]#$prop_value_entry" + } else {} + + if { $a_global_vars(b_arg_all_props) } { + lappend prop_info_list $prop_entry + incr prop_count + } else { + if { $def_val != $cur_val } { + lappend prop_info_list $prop_entry + incr prop_count + } + } + + if { $a_global_vars(b_arg_dump_proj_info) } { + puts $a_global_vars(def_val_fh) "[file tail $file]=$file_prop ($prop_type) :DEFAULT_VALUE ($def_val)==CURRENT_VALUE ($cur_val)" + puts $a_global_vars(dp_fh) "$dump_prop_name=$cur_val" + } + } + # write properties now + if { $prop_count>0 } { + if { {remote} == $file_category } { + if { $a_global_vars(b_absolute_path) } { + lappend l_script_data "set file \"$file\"" + } else { + lappend l_script_data "set file \"\$origin_dir/[get_relative_file_path_for_source $file [get_script_execution_dir]]\"" + lappend l_script_data "set file \[file normalize \$file\]" + } + } else { + lappend l_script_data "set file \"$file\"" + } + lappend l_script_data "set obj \[get_files -of_objects \[get_reconfig_modules $reconfigModule\] \[list \"*\$file\"\]\]" + set get_what "get_files -of_objects " + write_properties $prop_info_list $get_what $tcl_obj + incr file_prop_count + } + } + + if { $file_prop_count == 0 } { + lappend l_script_data "# None" + } + lappend l_script_data "" +} + +proc write_report_strategy { run } { + # Summary: + # delete all reports associated with run, then recreate each one by one as per its configuration. + # Argument Usage: + # run FCO: + # Return Value: none + + set retVal [get_param project.enableReportConfiguration] + if { $retVal == 0 } { + return + } + set reports [get_report_configs -of_objects [get_runs $run]] + if { [llength $reports] == 0 } { + return + } + + variable l_script_data + + lappend l_script_data "set reports \[get_report_configs -of_objects \$obj\]" + lappend l_script_data "if { \[llength \$reports \] > 0 } {" + lappend l_script_data " delete_report_config \[get_report_configs -of_objects \$obj\]" + lappend l_script_data "}" + + foreach report $reports { + set report_name [get_property name $report] + set report_spec [get_property report_type $report] + set step [get_property run_step $report] + + lappend l_script_data "# Create '$report' report (if not found)" + lappend l_script_data "if \{ \[ string equal \[get_report_configs -of_objects \[get_runs $run\] $report\] \"\" \] \} \{" + lappend l_script_data " create_report_config -report_name $report_name -report_type $report_spec -steps $step -runs $run" + lappend l_script_data "\}" + + lappend l_script_data "set obj \[get_report_configs -of_objects \[get_runs $run\] $report\]" + lappend l_script_data "if { \$obj != \"\" } {" + write_report_props $report + lappend l_script_data "}" + } +} + +proc write_report_props { report } { + # Summary: + # iterate over all report options and send all non default values to -->set_property [report FCO] + # Argument Usage: + # report FCO: + # Return Value: none + + variable l_script_data + variable a_global_vars + + set obj_name [get_property name $report] + set read_only_props [rdi::get_attr_specs -class [get_property class $report] -filter {is_readonly}] + set prop_info_list [list] + set properties [list_property $report] + + foreach prop $properties { + if { [string equal -nocase $prop "OPTIONS.pb"] || [string equal -nocase $prop "OPTIONS.rpx"] } { + #skipping read_only property + continue + } + if { [lsearch $read_only_props $prop] != -1 } { continue } + + set def_val [list_property_value -default $prop $report] + set cur_val [get_property $prop $report] + + # filter special properties + if { [filter $prop $cur_val] } { continue } + + set cur_val [get_target_bool_val $def_val $cur_val] + set prop_entry "[string tolower $prop]#[get_property $prop $report]" + + if { $a_global_vars(b_arg_all_props) } { + lappend prop_info_list $prop_entry + } elseif { $def_val != $cur_val } { + lappend prop_info_list $prop_entry + } + } + + write_properties $prop_info_list "get_report_configs" $report +} }