29 namespace eval globalSettings {
42 variable LIBERO_MANDATORY_VARIABLES
47 variable SIM_PROPERTIES
48 variable HOG_EXTERNAL_PATH
50 variable TARGET_SIMULATOR
52 variable pre_synth_file
53 variable post_synth_file
54 variable pre_impl_file
55 variable post_impl_file
57 variable post_bit_file
58 variable quartus_post_module_file
66 variable synth_top_module
75 variable quartus_post_module
83 set_msg_config -suppress -regexp -string {".*The IP file '.*' has been moved from its original location, as a result the outputs for this IP will now be generated in '.*'. Alternatively a copy of the IP can be imported into the project using one of the 'import_ip' or 'import_files' commands..*"}
84 set_msg_config -suppress -regexp -string {".*File '.*.xci' referenced by design '.*' could not be found..*"}
87 create_project -force [
file tail $globalSettings::DESIGN] $globalSettings::build_dir -part $globalSettings::PART
88 file mkdir "$globalSettings::build_dir/[
file tail $globalSettings::DESIGN].gen/sources_1"
89 if { [
IsVersal $globalSettings::PART] } {
90 Msg Info "This project uses a Versal device."
94 set obj [get_projects [
file tail $globalSettings::DESIGN]]
95 set_property "target_language" "VHDL" $obj
98 set_property "simulator_language" "Mixed" $obj
100 set_property "compxlib.${simulator}_compiled_library_dir" $globalSettings::simlib_path $obj
102 set_property "default_lib" "xil_defaultlib" $obj
104 set_param project.enableVHDL2008 1
105 set_property "enable_vhdl_2008" 1 $obj
107 set_property source_mgmt_mode All [current_project]
109 Msg Debug "Setting PART = $globalSettings::PART"
110 set_property PART $globalSettings::PART [current_project]
116 package require ::quartus::project
118 if {[
string equal $globalSettings::FAMILY "quartus_only"]} {
119 Msg Error "You must specify a device Family for Quartus"
121 file mkdir $globalSettings::build_dir
122 cd $globalSettings::build_dir
123 if {[is_project_open]} {
127 file delete {*}[glob -nocomplain $globalSettings::DESIGN.q*]
129 project_new -family $globalSettings::FAMILY -overwrite -part $globalSettings::PART $globalSettings::DESIGN
130 set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
135 if {[
file exists $globalSettings::build_dir]} {
136 file delete -force $globalSettings::build_dir
138 new_project -location $globalSettings::build_dir -name [
file tail $globalSettings::DESIGN] -die $globalSettings::DIE -package $globalSettings::PACKAGE -family $globalSettings::FAMILY -hdl VHDL
140 if {[
file exists $globalSettings::build_dir]} {
141 file delete -force $globalSettings::build_dir
144 file mkdir $globalSettings::build_dir
145 cd $globalSettings::build_dir
146 prj_project new -name [
file tail $globalSettings::DESIGN] -dev $globalSettings::DEVICE -synthesis $globalSettings::SYNTHESIS_TOOL
150 puts "Creating project for $globalSettings::DESIGN part $globalSettings::PART"
151 puts "Configuring project settings:"
152 puts " - simulator_language: Mixed"
153 puts " - target_language: VHDL"
154 puts " - simulator: QuestaSim"
155 puts "Adding IP directory \"$globalSettings::user_ip_repo\" to the project "
160 proc AddProjectFiles {} {
165 if {[
string equal [get_filesets -quiet sources_1] ""]} {
166 create_fileset -srcset sources_1
168 set sources "sources_1"
180 if {[
string equal [get_filesets -quiet constrs_1] ""]} {
181 create_fileset -constrset constrs_1
185 set constraints [get_filesets constrs_1]
192 if {[
file isdirectory $globalSettings::list_path]} {
193 set list_files [glob -directory $globalSettings::list_path "*"]
195 Msg Error "No list directory found at $globalSettings::list_path"
199 source $globalSettings::tcl_path/utils/cmdline.tcl
203 AddHogFiles {*}[
GetHogFiles -list_files {.src,.sim,.ext} -ext_path $globalSettings::HOG_EXTERNAL_PATH $globalSettings::list_path $globalSettings::repo_path]
209 AddHogFiles {*}[
GetHogFiles -list_files {.con} -ext_path $globalSettings::HOG_EXTERNAL_PATH $globalSettings::list_path $globalSettings::repo_path]
223 proc CreateReportStrategy {obj} {
228 if {[
string equal [get_property -quiet report_strategy $obj] ""]} {
230 Msg Info "No report strategy needed for implementation"
233 set_property set_report_strategy_name 1 $obj
234 set_property report_strategy {Vivado Implementation Default Reports} $obj
235 set_property set_report_strategy_name 0 $obj
237 set reports [get_report_configs -of_objects $obj]
239 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0] ""] } {
240 create_report_config -report_name impl_1_place_report_utilization_0 -report_type report_utilization:1.0 -steps place_design -runs impl_1
242 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0]
248 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0] ""] } {
249 create_report_config -report_name impl_1_route_report_drc_0 -report_type report_drc:1.0 -steps route_design -runs impl_1
251 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0]
257 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0] ""] } {
258 create_report_config -report_name impl_1_route_report_power_0 -report_type report_power:1.0 -steps route_design -runs impl_1
260 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0]
266 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary] ""] } {
267 create_report_config -report_name impl_1_route_report_timing_summary -report_type report_timing_summary:1.0 -steps route_design -runs impl_1
269 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary]
271 Msg Info "Report timing created successfully"
275 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_utilization] ""] } {
276 create_report_config -report_name impl_1_route_report_utilization -report_type report_utilization:1.0 -steps route_design -runs impl_1
278 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_utilization]
280 Msg Info "Report utilization created successfully"
285 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0] ""] } {
286 create_report_config -report_name impl_1_post_route_phys_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps post_route_phys_opt_design -runs impl_1
288 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0]
290 set_property -name "options.max_paths" -value "10" -objects $obj
291 set_property -name "options.warn_on_violation" -value "1" -objects $obj
296 Msg Info "Won't create any report strategy, not in Vivado"
306 proc ConfigureSynthesis {} {
310 if {[
string equal [get_runs -quiet synth_1] ""]} {
311 create_run -name synth_1 -part $globalSettings::PART -constrset constrs_1
316 set obj [get_runs synth_1]
317 set_property "part" $globalSettings::PART $obj
321 if {$globalSettings::pre_synth_file ne ""} {
325 if {[get_filesets -quiet utils_1] != ""} {
326 AddFile $globalSettings::pre_synth [get_filesets -quiet utils_1]
328 set_property STEPS.SYNTH_DESIGN.TCL.PRE $globalSettings::pre_synth $obj
332 set_global_assignment -name PRE_FLOW_SCRIPT_FILE quartus_sh:$globalSettings::pre_synth
335 configure_tool -name {SYNTHESIZE} -params SYNPLIFY_TCL_FILE:$globalSettings::pre_synth
337 prj_impl pre_script "syn" $globalSettings::pre_synth
340 Msg Debug "Setting $globalSettings::pre_synth to be run before synthesis"
344 if {$globalSettings::post_synth_file ne ""} {
348 if {[get_filesets -quiet utils_1] != ""} {
349 AddFile $globalSettings::post_synth [get_filesets -quiet utils_1]
351 set_property STEPS.SYNTH_DESIGN.TCL.POST $globalSettings::post_synth $obj
355 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
358 prj_impl post_script "syn" $globalSettings::post_synth
360 Msg Debug "Setting $globalSettings::post_synth to be run after synthesis"
367 current_run -synthesis $obj
370 if {[
string equal [get_property -quiet report_strategy $obj] ""]} {
372 Msg Debug "No report strategy needed for synthesis"
376 set_property set_report_strategy_name 1 $obj
377 set_property report_strategy {Vivado Synthesis Default Reports} $obj
378 set_property set_report_strategy_name 0 $obj
380 if { [
string equal [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0] ""] } {
381 create_report_config -report_name synth_1_synth_report_utilization_0 -report_type report_utilization:1.0 -steps synth_design -runs synth_1
383 set reports [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0]
394 Msg info "Reporting strategy for synthesis"
403 proc ConfigureImplementation {} {
407 if {[
string equal [get_runs -quiet impl_1] ""]} {
408 create_run -name impl_1 -part $globalSettings::PART -constrset constrs_1 -parent_run synth_1
411 set obj [get_runs impl_1]
412 set_property "part" $globalSettings::PART $obj
414 set_property "steps.[
BinaryStepName $globalSettings::PART].args.readback_file" "0" $obj
415 set_property "steps.[
BinaryStepName $globalSettings::PART].args.verbose" "0" $obj
424 if {$globalSettings::pre_impl_file ne ""} {
428 if {[get_filesets -quiet utils_1] != ""} {
429 AddFile $globalSettings::pre_impl [get_filesets -quiet utils_1]
431 set_property STEPS.INIT_DESIGN.TCL.POST $globalSettings::pre_impl $obj
437 prj_impl pre_script "par" $globalSettings::pre_impl
439 Msg Debug "Setting $globalSettings::pre_impl to be run after implementation"
444 if {$globalSettings::post_impl_file ne ""} {
448 if {[get_filesets -quiet utils_1] != ""} {
449 AddFile $globalSettings::post_impl [get_filesets -quiet utils_1]
451 set_property STEPS.ROUTE_DESIGN.TCL.POST $globalSettings::post_impl $obj
455 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
457 prj_impl post_script "par" $globalSettings::post_impl
459 Msg Debug "Setting $globalSettings::post_impl to be run after implementation"
463 if {$globalSettings::pre_bit_file ne ""} {
467 if {[get_filesets -quiet utils_1] != ""} {
468 AddFile $globalSettings::pre_bit [get_filesets -quiet utils_1]
470 set_property STEPS.[
BinaryStepName $globalSettings::PART].TCL.PRE $globalSettings::pre_bit $obj
476 prj_impl pre_script "export" $globalSettings::pre_bit
478 Msg Debug "Setting $globalSettings::pre_bit to be run after bitfile generation"
482 if {$globalSettings::post_bit_file ne ""} {
486 if {[get_filesets -quiet utils_1] != ""} {
487 AddFile $globalSettings::post_bit [get_filesets -quiet utils_1]
489 set_property STEPS.[
BinaryStepName $globalSettings::PART].TCL.POST $globalSettings::post_bit $obj
493 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
495 prj_impl post_script "export" $globalSettings::post_bit
497 Msg Debug "Setting $globalSettings::post_bit to be run after bitfile generation"
506 proc ConfigureSimulation {} {
511 Msg Debug "Setting load_glbl parameter to true for every fileset..."
512 foreach simset [get_filesets -quiet] {
513 if {[get_property FILESET_TYPE $simset] != "SimulationSrcs" } {
517 set_property -name {xsim.elaborate.load_glbl} -value {true} -objects [get_filesets $simset]
520 if {[dict exists $globalSettings::SIM_PROPERTIES $simset]} {
521 Msg Info "Setting properties for simulation set: $simset..."
522 set sim_props [dict get $globalSettings::SIM_PROPERTIES $simset]
523 dict for {prop_name prop_val} $sim_props {
524 set prop_name [string toupper $prop_name]
525 if { $prop_name == "ACTIVE" && $prop_val == 1 } {
526 Msg Info "Setting $simset as active simulation set..."
527 current_fileset -simset [ get_filesets $simset ]
529 Msg Debug "Setting $prop_name = $prop_val"
530 if {[IsInList [string toupper $prop_name] [VIVADO_PATH_PROPERTIES] 1]} {
531 # Check that the file exists before setting these properties
532 if {[file exists $globalSettings::repo_path/$prop_val]} {
533 set_property $prop_name $globalSettings::repo_path/$prop_val [get_filesets $simset]
535 Msg Warning "Impossible to set property $prop_name to $prop_val. File is missing"
538 set_property $prop_name $prop_val [get_filesets $simset]
543 if {[dict exists $globalSettings::SIM_PROPERTIES sim]} {
544 Msg Info "Setting properties for simulation set: sim..."
545 set sim_props [dict get $globalSettings::SIM_PROPERTIES sim]
546 dict for {prop_name prop_val} $sim_props {
547 Msg Debug "Setting $prop_name = $prop_val"
548 set_property $prop_name $prop_val [get_filesets $simset]
558 Msg info "Configuring simulation"
564 proc ConfigureProperties {} {
566 cd $globalSettings::repo_path
570 if {[
info exists globalSettings::PROPERTIES]} {
571 if {[dict exists $globalSettings::PROPERTIES main]} {
572 Msg Info "Setting project-wide properties..."
573 set proj_props [dict get $globalSettings::PROPERTIES main]
574 dict for {prop_name prop_val} $proj_props {
576 if { [ string tolower $prop_name ] != "ip_repo_paths" } {
577 if {[ string tolower $prop_name] != "part"} {
578 # Part is already set
579 Msg Debug "Setting $prop_name = $prop_val"
580 set_property $prop_name $prop_val [current_project]
583 set ip_repo_list [regsub -all {\s+} $prop_val " $globalSettings::repo_path/"]
584 set ip_repo_list $globalSettings::repo_path/$ip_repo_list
586 Msg Info "Setting $ip_repo_list as user IP repository..."
588 set_property ip_repo_paths "$ip_repo_list" [current_fileset]
590 set_property ip_repo_paths "$ip_repo_list" [current_project]
597 foreach run [get_runs -quiet] {
598 if {[dict exists $globalSettings::PROPERTIES $run]} {
599 Msg Info "Setting properties for run: $run..."
600 set run_props [dict get $globalSettings::PROPERTIES $run]
602 set stragety_str "STRATEGY strategy Strategy"
603 Msg Debug "Setting Strategy and Flow for run $run (if specified in hog.conf)"
604 foreach s $stragety_str {
605 if {[dict exists $run_props $s]} {
606 set prop [dict get $run_props $s]
607 set_property $s $prop $run
608 set run_props [dict remove $run_props $s]
609 Msg Warning "A strategy for run $run has been defined inside hog.conf. This prevents Hog to compare the project properties. Please regenerate your hog.conf file using the dedicated Hog button."
610 Msg Info "Setting $s = $prop"
614 dict for {prop_name prop_val} $run_props {
615 Msg Debug "Setting $prop_name = $prop_val"
616 if {[string trim $prop_val] == ""} {
617 Msg Warning "Property $prop_name has empty value. Skipping..."
620 if {[IsInList [string toupper $prop_name] [VIVADO_PATH_PROPERTIES] 1]} {
621 # Check that the file exists before setting these properties
622 if {[file exists $globalSettings::repo_path/$prop_val]} {
623 set_property $prop_name $globalSettings::repo_path/$prop_val $run
625 Msg Warning "Impossible to set property $prop_name to $prop_val. File is missing"
628 set_property $prop_name $prop_val $run
640 if {[
info exists globalSettings::PROPERTIES]} {
642 if {[dict exists $globalSettings::PROPERTIES main]} {
643 Msg Info "Setting device properties..."
644 set dev_props [dict get $globalSettings::PROPERTIES main]
645 dict for {prop_name prop_val} $dev_props {
646 if { !([string toupper $prop_name] in $globalSettings::LIBERO_MANDATORY_VARIABLES) } {
647 Msg Debug "Setting $prop_name = $prop_val"
648 set_device -[string tolower $prop_name] $prop_val
653 if {[dict exists $globalSettings::PROPERTIES project]} {
654 Msg Info "Setting project-wide properties..."
655 set dev_props [dict get $globalSettings::PROPERTIES project]
656 dict for {prop_name prop_val} $dev_props {
657 Msg Debug "Setting $prop_name = $prop_val"
658 project_settings -[string tolower $prop_name] $prop_val
662 if {[dict exists $globalSettings::PROPERTIES synth]} {
663 Msg Info "Setting Synthesis properties..."
664 set synth_props [dict get $globalSettings::PROPERTIES synth]
665 dict for {prop_name prop_val} $synth_props {
666 Msg Debug "Setting $prop_name = $prop_val"
667 configure_tool -name {SYNTHESIZE} -params "[string toupper $prop_name]:$prop_val"
671 if {[dict exists $globalSettings::PROPERTIES impl]} {
672 Msg Info "Setting Implementation properties..."
673 set impl_props [dict get $globalSettings::PROPERTIES impl]
674 dict for {prop_name prop_val} $impl_props {
675 Msg Debug "Setting $prop_name = $prop_val"
676 configure_tool -name {PLACEROUTE} -params "[string toupper $prop_name]:$prop_val"
681 if {[dict exists $globalSettings::PROPERTIES bitstream]} {
682 Msg Info "Setting Bitstream properties..."
683 set impl_props [dict get $globalSettings::PROPERTIES impl]
684 dict for {prop_name prop_val} $impl_props {
685 Msg Debug "Setting $prop_name = $prop_val"
686 configure_tool -name {GENERATEPROGRAMMINGFILE} -params "[string toupper $prop_name]:$prop_val"
690 configure_tool -name {VERIFYTIMING} -params {FORMAT:TEXT}
693 if {[
info exists globalSettings::PROPERTIES]} {
695 if {[dict exists $globalSettings::PROPERTIES main]} {
696 Msg Info "Setting project-wide properties..."
697 set dev_props [dict get $globalSettings::PROPERTIES main]
698 dict for {prop_name prop_val} $dev_props {
699 # Device is already set
700 if { [string toupper $prop_name] != "DEVICE" } {
701 Msg Debug "Setting $prop_name = $prop_val"
702 prj_project option $prop_name $prop_val
707 if {[dict exists $globalSettings::PROPERTIES impl]} {
708 Msg Info "Setting Implementation properties..."
709 set dev_props [dict get $globalSettings::PROPERTIES impl]
710 dict for {prop_name prop_val} $dev_props {
711 # Device is already set
712 Msg Debug "Setting $prop_name = $prop_val"
713 prj_impl option $prop_name $prop_val
718 Msg info "Configuring Properties"
727 current_run -implementation [get_runs impl_1]
734 Msg Info "Running report_ip_status, before upgrading and handling IPs..."
738 if {$globalSettings::HOG_IP_PATH != ""} {
739 set ip_repo_path $globalSettings::HOG_IP_PATH
740 Msg Info "HOG_IP_PATH is set, will pull/push synthesised IPs from/to $ip_repo_path."
742 HandleIP pull [get_property IP_FILE $ip] $ip_repo_path $globalSettings::repo_path [get_property IP_OUTPUT_DIR $ip]
745 Msg Info "HOG_IP_PATH not set, will not push/pull synthesised IPs."
749 proc SetGlobalVar {var {default_value HOG_NONE}} {
751 if {[
info exists ::$var]} {
752 Msg Debug "Setting $var to [subst $[subst ::$var]]"
754 set globalSettings::$var [subst $[subst ::$var]]
755 }
elseif {$default_value == "HOG_NONE"} {
756 Msg Error "Mandatory variable $var was not defined. Please define it in hog.conf or in project tcl script."
758 Msg Info "Setting $var to default value: \"$default_value\""
760 set globalSettings::$var $default_value
766 proc CreateProject args {
771 if {[
catch {
package require cmdline} ERROR]} {
772 puts "ERROR: If you are running this script on tclsh, you can fix this by installing 'tcllib'"
776 {simlib_path.arg "" "Path of simulation libs"}
777 {verbose "If set, launch the script in verbose mode."}
780 set usage "Create Vivado/ISE/Quartus/Libero/Diamond project.\nUsage: CreateProject \[OPTIONS\] <project> <repository path>\n Options:"
782 if {[
catch {
array set options [
cmdline::getoptions args $parameters $usage]}] || [
llength $args] < 2 ||[
lindex $args 0] eq""} {
787 set globalSettings::DESIGN [
lindex $args 0]
788 if {[
file exists [
lindex $args 1]]} {
789 set globalSettings::repo_path [
file normalize [
lindex $args 1]]
791 Msg Error "The second argument, [
lindex $args 1], should be the repository path."
793 set globalSettings::tcl_path $globalSettings::repo_path/Hog/Tcl
796 if { $options(verbose) == 1 } {
797 variable ::DEBUG_MODE 1
801 if {$options(simlib_path)!= ""} {
803 set globalSettings::simlib_path "$options(simlib_path)"
805 set globalSettings::simlib_path "$globalSettings::repo_path/$options(simlib_path)"
807 Msg Info "Simulation library path set to $options(simlib_path)"
809 set globalSettings::simlib_path "$globalSettings::repo_path/SimulationLib"
810 Msg Info "Simulation library path set to default $globalSettings::repo_path/SimulationLib"
815 set proj_dir [
file normalize $globalSettings::repo_path/Top/$globalSettings::DESIGN]
816 lassign [
GetConfFiles $proj_dir] conf_file sim_file pre_file post_file
819 if {[
file exists $conf_file]} {
820 Msg Info "Parsing configuration file $conf_file..."
826 if {$conf_version != "0.0.0"} {
829 set a_v [
split $actual_version "."]
830 set c_v [
split $conf_version "."]
832 if { [
llength $a_v] < 2} {
833 Msg Error "Couldn't parse IDE version: $actual_version."
834 }
elseif {[
llength $a_v] == 2} {
837 if { [
llength $c_v] < 2} {
838 Msg Error "Wrong version format in hog.conf: $conf_version."
839 }
elseif {[
llength $c_v] == 2} {
845 Msg Info "Project version and $ide version match: $conf_version."
846 }
elseif {$comp == 1} {
847 Msg CriticalWarning "The $ide version in use is $actual_version, that is newer than $conf_version, as specified in the first line of $conf_file, if you want update this project to version $actual_version, please update the configuration file."
849 Msg Error "The $ide version in use is $actual_version, that is older than $conf_version as specified in $conf_file. The project will not be created.\nIf you absolutely want to create this project that was meant for version $conf_version with $ide version $actual_version, you can change the version from the first line of $conf_file.\nThis is HIGHLY discouraged as there could be unrecognised properties in the configuration file and IPs created with a newer $ide version cannot be downgraded."
852 Msg CriticalWarning "No version found in the first line of $conf_file. It is HIGHLY recommended to replace the first line of $conf_file with: \#$ide $actual_version"
854 if {[dict exists $globalSettings::PROPERTIES main]} {
855 set main [dict get $globalSettings::PROPERTIES main]
856 dict for {p v} $main {
857 # notice the dollar in front of p: creates new variables and fill them with the value
858 Msg Info "Main property $p set to $v"
863 Msg Error "No main section found in $conf_file, make sure it has a section called \[main\] containing the mandatory properties."
866 if {[
file exists $sim_file] && [
IsVivado]} {
867 Msg Info "Parsing simulation configuration file $sim_file..."
873 Msg Error "$conf_file was not found in your project directory, please create one."
899 if {[
info exists env(HOG_EXTERNAL_PATH)]} {
900 set globalSettings::HOG_EXTERNAL_PATH $env(HOG_EXTERNAL_PATH)
902 set globalSettings::HOG_EXTERNAL_PATH ""
907 set build_dir_name "Projects"
908 set globalSettings::group_name [
file dirname $globalSettings::DESIGN]
909 set globalSettings::pre_synth_file "pre-synthesis.tcl"
910 set globalSettings::post_synth_file "post-synthesis.tcl"
911 set globalSettings::pre_impl_file "pre-implementation.tcl"
912 set globalSettings::post_impl_file "post-implementation.tcl"
913 set globalSettings::pre_bit_file "pre-bitstream.tcl"
914 set globalSettings::post_bit_file "post-bitstream.tcl"
915 set globalSettings::quartus_post_module_file "quartus-post-module.tcl"
916 set globalSettings::top_path "$globalSettings::repo_path/Top/$globalSettings::DESIGN"
917 set globalSettings::list_path "$globalSettings::top_path/list"
918 set globalSettings::build_dir "$globalSettings::repo_path/$build_dir_name/$globalSettings::DESIGN"
919 set globalSettings::DESIGN [
file tail $globalSettings::DESIGN]
920 set globalSettings::top_name [
file tail $globalSettings::DESIGN]
921 set globalSettings::top_name [
file rootname $globalSettings::top_name]
922 set globalSettings::synth_top_module "top_$globalSettings::top_name"
923 set globalSettings::user_ip_repo ""
925 set globalSettings::pre_synth [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_synth_file"]
926 set globalSettings::post_synth [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_synth_file"]
927 set globalSettings::pre_impl [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_impl_file"]
928 set globalSettings::post_impl [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_impl_file"]
929 set globalSettings::pre_bit [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_bit_file"]
930 set globalSettings::post_bit [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_bit_file"]
931 set globalSettings::quartus_post_module [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::quartus_post_module_file"]
932 set globalSettings::LIBERO_MANDATORY_VARIABLES {"FAMILY" "PACKAGE" "DIE" }
934 set user_hog_file "$globalSettings::repo_path/Top/hog.tcl"
935 if {[
file exists $user_hog_file]} {
936 Msg Info "Sourcing user hog.tcl file..."
937 source $user_hog_file
940 if {[
file exists $pre_file]} {
941 Msg Info "Found pre-creation Tcl script $pre_file, executing it..."
945 if {[
info exists env(HOG_IP_PATH)]} {
946 set globalSettings::HOG_IP_PATH $env(HOG_IP_PATH)
948 set globalSettings::HOG_IP_PATH ""
963 set fileName_old [
file normalize "./hogTmp/.hogQsys.md5"]
964 set fileDir [
file normalize "$globalSettings::build_dir/.hog/"]
966 set fileName_new [
file normalize "$fileDir/.hogQsys.md5"]
967 if {[
file exists $fileName_new]} {
968 file delete $fileName_new
970 if {[
file exists $fileName_old]} {
971 file rename -force $fileName_old $fileName_new
972 file delete -force -- "./hogTmp"
976 if {[
file exists $post_file]} {
977 Msg Info "Found post-creation Tcl script $post_file, executing it..."
981 build_design_hierarchy
987 lassign [
GetHogFiles -ext_path "$globalSettings::HOG_EXTERNAL_PATH" "$globalSettings::repo_path/Top/$globalSettings::group_name/$globalSettings::DESIGN/list/" $globalSettings::repo_path] listLibraries listProperties listFilesets
990 cd $globalSettings::build_dir
996 cd $globalSettings::repo_path
999 lassign [
GetRepoVersions [
file normalize $globalSettings::repo_path/Top/$globalSettings::group_name/$globalSettings::DESIGN] $globalSettings::repo_path $globalSettings::HOG_EXTERNAL_PATH] commit version hog_hash hog_ver top_hash top_ver libs hashes vers cons_ver cons_hash ext_names ext_hashes xml_hash xml_ver user_ip_repos user_ip_hashes user_ip_vers
1003 if {$commit == 0 } {
1004 set commit $this_commit
1007 if {$xml_hash != ""} {
1015 WriteGenerics "create" $globalSettings::repo_path $globalSettings::group_name/$globalSettings::DESIGN $date $timee $commit $version $top_hash $top_ver $hog_hash $hog_ver $cons_ver $cons_hash $libs $vers $hashes $ext_names $ext_hashes $user_ip_repos $user_ip_vers $user_ip_hashes $flavour $xml_ver $xml_hash
1027 Msg Info "Project $globalSettings::DESIGN created successfully in [
Relative $globalSettings::repo_path $globalSettings::build_dir]."