29 namespace eval globalSettings {
42 variable LIBERO_MANDATORY_VARIABLES
47 variable HOG_EXTERNAL_PATH
49 variable TARGET_SIMULATOR
51 variable pre_synth_file
52 variable post_synth_file
53 variable pre_impl_file
54 variable post_impl_file
56 variable post_bit_file
57 variable quartus_post_module_file
65 variable synth_top_module
74 variable quartus_post_module
82 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..*"}
83 set_msg_config -suppress -regexp -string {".*File '.*.xci' referenced by design '.*' could not be found..*"}
86 set_msg_config -suppress -id {IP_Flow 19-3664}
88 set_msg_config -suppress -id {Vivado 12-23660} -string {{ERROR: [Vivado 12-23660] Simulation is not supported for the target language VHDL when design contains NoC (Network-on-Chip) blocks} }
91 create_project -force [
file tail $globalSettings::DESIGN] $globalSettings::build_dir -part $globalSettings::PART
92 file mkdir "$globalSettings::build_dir/[
file tail $globalSettings::DESIGN].gen/sources_1"
93 if { [
IsVersal $globalSettings::PART] } {
94 Msg Info "This project uses a Versal device."
98 set obj [get_projects [
file tail $globalSettings::DESIGN]]
99 set_property "target_language" "VHDL" $obj
102 set_property "simulator_language" "Mixed" $obj
104 set_property "compxlib.${simulator}_compiled_library_dir" $globalSettings::simlib_path $obj
106 set_property "default_lib" "xil_defaultlib" $obj
108 set_param project.enableVHDL2008 1
109 set_property "enable_vhdl_2008" 1 $obj
111 set_property source_mgmt_mode All [current_project]
113 Msg Debug "Setting PART = $globalSettings::PART"
114 set_property PART $globalSettings::PART [current_project]
120 package require ::quartus::project
122 if {[
string equal $globalSettings::FAMILY "quartus_only"]} {
123 Msg Error "You must specify a device Family for Quartus"
125 file mkdir $globalSettings::build_dir
126 cd $globalSettings::build_dir
127 if {[is_project_open]} {
131 file delete {*}[glob -nocomplain $globalSettings::DESIGN.q*]
133 project_new -family $globalSettings::FAMILY -overwrite -part $globalSettings::PART $globalSettings::DESIGN
134 set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
139 if {[
file exists $globalSettings::build_dir]} {
140 file delete -force $globalSettings::build_dir
142 new_project -location $globalSettings::build_dir -name [
file tail $globalSettings::DESIGN] -die $globalSettings::DIE -package $globalSettings::PACKAGE -family $globalSettings::FAMILY -hdl VHDL
144 if {[
file exists $globalSettings::build_dir]} {
145 file delete -force $globalSettings::build_dir
148 file mkdir $globalSettings::build_dir
149 cd $globalSettings::build_dir
150 prj_project new -name [
file tail $globalSettings::DESIGN] -dev $globalSettings::DEVICE -synthesis $globalSettings::SYNTHESIS_TOOL
154 puts "Creating project for $globalSettings::DESIGN part $globalSettings::PART"
155 puts "Configuring project settings:"
156 puts " - simulator_language: Mixed"
157 puts " - target_language: VHDL"
158 puts " - simulator: QuestaSim"
159 puts "Adding IP directory \"$globalSettings::user_ip_repo\" to the project "
164 proc AddProjectFiles {} {
169 if {[
string equal [get_filesets -quiet sources_1] ""]} {
170 create_fileset -srcset sources_1
172 set sources "sources_1"
184 if {[
string equal [get_filesets -quiet constrs_1] ""]} {
185 create_fileset -constrset constrs_1
189 set constraints [get_filesets constrs_1]
196 if {[
file isdirectory $globalSettings::list_path]} {
197 set list_files [glob -directory $globalSettings::list_path "*"]
199 Msg Error "No list directory found at $globalSettings::list_path"
203 source $globalSettings::tcl_path/utils/cmdline.tcl
207 AddHogFiles {*}[
GetHogFiles -list_files {.src,.sim,.ext} -ext_path $globalSettings::HOG_EXTERNAL_PATH $globalSettings::list_path $globalSettings::repo_path]
213 AddHogFiles {*}[
GetHogFiles -list_files {.con} -ext_path $globalSettings::HOG_EXTERNAL_PATH $globalSettings::list_path $globalSettings::repo_path]
227 proc CreateReportStrategy {obj} {
232 if {[
string equal [get_property -quiet report_strategy $obj] ""]} {
234 Msg Info "No report strategy needed for implementation"
237 set_property set_report_strategy_name 1 $obj
238 set_property report_strategy {Vivado Implementation Default Reports} $obj
239 set_property set_report_strategy_name 0 $obj
241 set reports [get_report_configs -of_objects $obj]
243 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0] ""] } {
244 create_report_config -report_name impl_1_place_report_utilization_0 -report_type report_utilization:1.0 -steps place_design -runs impl_1
246 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0]
252 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0] ""] } {
253 create_report_config -report_name impl_1_route_report_drc_0 -report_type report_drc:1.0 -steps route_design -runs impl_1
255 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0]
261 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0] ""] } {
262 create_report_config -report_name impl_1_route_report_power_0 -report_type report_power:1.0 -steps route_design -runs impl_1
264 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0]
270 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary] ""] } {
271 create_report_config -report_name impl_1_route_report_timing_summary -report_type report_timing_summary:1.0 -steps route_design -runs impl_1
273 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary]
275 Msg Info "Report timing created successfully"
279 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_utilization] ""] } {
280 create_report_config -report_name impl_1_route_report_utilization -report_type report_utilization:1.0 -steps route_design -runs impl_1
282 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_utilization]
284 Msg Info "Report utilization created successfully"
289 if { [
string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0] ""] } {
290 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
292 set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0]
294 set_property -name "options.max_paths" -value "10" -objects $obj
295 set_property -name "options.warn_on_violation" -value "1" -objects $obj
300 Msg Info "Won't create any report strategy, not in Vivado"
310 proc ConfigureSynthesis {} {
314 if {[
string equal [get_runs -quiet synth_1] ""]} {
315 create_run -name synth_1 -part $globalSettings::PART -constrset constrs_1
320 set obj [get_runs synth_1]
321 set_property "part" $globalSettings::PART $obj
325 if {$globalSettings::pre_synth_file ne ""} {
329 if {[get_filesets -quiet utils_1] != ""} {
330 AddFile $globalSettings::pre_synth [get_filesets -quiet utils_1]
332 set_property STEPS.SYNTH_DESIGN.TCL.PRE $globalSettings::pre_synth $obj
336 set_global_assignment -name PRE_FLOW_SCRIPT_FILE quartus_sh:$globalSettings::pre_synth
339 configure_tool -name {SYNTHESIZE} -params SYNPLIFY_TCL_FILE:$globalSettings::pre_synth
341 prj_impl pre_script "syn" $globalSettings::pre_synth
344 Msg Debug "Setting $globalSettings::pre_synth to be run before synthesis"
348 if {$globalSettings::post_synth_file ne ""} {
352 if {[get_filesets -quiet utils_1] != ""} {
353 AddFile $globalSettings::post_synth [get_filesets -quiet utils_1]
355 set_property STEPS.SYNTH_DESIGN.TCL.POST $globalSettings::post_synth $obj
359 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
362 prj_impl post_script "syn" $globalSettings::post_synth
364 Msg Debug "Setting $globalSettings::post_synth to be run after synthesis"
371 current_run -synthesis $obj
374 if {[
string equal [get_property -quiet report_strategy $obj] ""]} {
376 Msg Debug "No report strategy needed for synthesis"
380 set_property set_report_strategy_name 1 $obj
381 set_property report_strategy {Vivado Synthesis Default Reports} $obj
382 set_property set_report_strategy_name 0 $obj
384 if { [
string equal [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0] ""] } {
385 create_report_config -report_name synth_1_synth_report_utilization_0 -report_type report_utilization:1.0 -steps synth_design -runs synth_1
387 set reports [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0]
398 Msg info "Reporting strategy for synthesis"
407 proc ConfigureImplementation {} {
411 if {[
string equal [get_runs -quiet impl_1] ""]} {
412 create_run -name impl_1 -part $globalSettings::PART -constrset constrs_1 -parent_run synth_1
415 set obj [get_runs impl_1]
416 set_property "part" $globalSettings::PART $obj
418 set_property "steps.[
BinaryStepName $globalSettings::PART].args.readback_file" "0" $obj
419 set_property "steps.[
BinaryStepName $globalSettings::PART].args.verbose" "0" $obj
428 if {$globalSettings::pre_impl_file ne ""} {
432 if {[get_filesets -quiet utils_1] != ""} {
433 AddFile $globalSettings::pre_impl [get_filesets -quiet utils_1]
435 set_property STEPS.INIT_DESIGN.TCL.POST $globalSettings::pre_impl $obj
441 prj_impl pre_script "par" $globalSettings::pre_impl
443 Msg Debug "Setting $globalSettings::pre_impl to be run after implementation"
448 if {$globalSettings::post_impl_file ne ""} {
452 if {[get_filesets -quiet utils_1] != ""} {
453 AddFile $globalSettings::post_impl [get_filesets -quiet utils_1]
455 set_property STEPS.ROUTE_DESIGN.TCL.POST $globalSettings::post_impl $obj
459 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
461 prj_impl post_script "par" $globalSettings::post_impl
463 Msg Debug "Setting $globalSettings::post_impl to be run after implementation"
467 if {$globalSettings::pre_bit_file ne ""} {
471 if {[get_filesets -quiet utils_1] != ""} {
472 AddFile $globalSettings::pre_bit [get_filesets -quiet utils_1]
474 set_property STEPS.[
BinaryStepName $globalSettings::PART].TCL.PRE $globalSettings::pre_bit $obj
480 prj_impl pre_script "export" $globalSettings::pre_bit
482 Msg Debug "Setting $globalSettings::pre_bit to be run after bitfile generation"
486 if {$globalSettings::post_bit_file ne ""} {
490 if {[get_filesets -quiet utils_1] != ""} {
491 AddFile $globalSettings::post_bit [get_filesets -quiet utils_1]
493 set_property STEPS.[
BinaryStepName $globalSettings::PART].TCL.POST $globalSettings::post_bit $obj
497 set_global_assignment -name POST_MODULE_SCRIPT_FILE quartus_sh:$globalSettings::quartus_post_module
499 prj_impl post_script "export" $globalSettings::post_bit
501 Msg Debug "Setting $globalSettings::post_bit to be run after bitfile generation"
510 proc ConfigureSimulation {} {
511 set simsets_dict [
GetSimSets "$globalSettings::group_name/$globalSettings::DESIGN" $globalSettings::repo_path]
517 Msg Debug "Setting load_glbl parameter to true for every fileset..."
518 foreach simset [get_filesets -quiet] {
519 if {[get_property FILESET_TYPE $simset] != "SimulationSrcs" } {
523 set_property -name {xsim.elaborate.load_glbl} -value {true} -objects [get_filesets $simset]
526 set sim_dict [
DictGet $simsets_dict $simset]
527 set sim_props [
DictGet $sim_dict "properties"]
529 if {$sim_props != ""} {
530 Msg Info "Setting properties for simulation set: $simset..."
531 dict for {prop_name prop_val} $sim_props {
532 set prop_name [string toupper $prop_name]
533 if { $prop_name == "ACTIVE" && $prop_val == 1 } {
534 Msg Info "Setting $simset as active simulation set..."
535 current_fileset -simset [ get_filesets $simset ]
537 Msg Debug "Setting $prop_name = $prop_val"
538 if {[IsInList [string toupper $prop_name] [VIVADO_PATH_PROPERTIES] 1]} {
539 # Check that the file exists before setting these properties
540 if {[file exists $globalSettings::repo_path/$prop_val]} {
541 set_property $prop_name $globalSettings::repo_path/$prop_val [get_filesets $simset]
543 Msg Warning "Impossible to set property $prop_name to $prop_val. File is missing"
546 set_property $prop_name $prop_val [get_filesets $simset]
557 proc ConfigureProperties {} {
559 cd $globalSettings::repo_path
563 if {[
info exists globalSettings::PROPERTIES]} {
564 if {[dict exists $globalSettings::PROPERTIES main]} {
565 Msg Info "Setting project-wide properties..."
566 set proj_props [dict get $globalSettings::PROPERTIES main]
567 dict for {prop_name prop_val} $proj_props {
569 if { [ string tolower $prop_name ] != "ip_repo_paths" } {
570 if {[ string tolower $prop_name] != "part"} {
571 # Part is already set
572 Msg Debug "Setting $prop_name = $prop_val"
573 set_property $prop_name $prop_val [current_project]
576 set ip_repo_list [regsub -all {\s+} $prop_val " $globalSettings::repo_path/"]
577 set ip_repo_list $globalSettings::repo_path/$ip_repo_list
579 Msg Info "Setting $ip_repo_list as user IP repository..."
581 set_property ip_repo_paths "$ip_repo_list" [current_fileset]
583 set_property ip_repo_paths "$ip_repo_list" [current_project]
590 foreach run [get_runs -quiet] {
591 if {[dict exists $globalSettings::PROPERTIES $run]} {
592 Msg Info "Setting properties for run: $run..."
593 set run_props [dict get $globalSettings::PROPERTIES $run]
595 set stragety_str "STRATEGY strategy Strategy"
596 Msg Debug "Setting Strategy and Flow for run $run (if specified in hog.conf)"
597 foreach s $stragety_str {
598 if {[dict exists $run_props $s]} {
599 set prop [dict get $run_props $s]
600 set_property $s $prop $run
601 set run_props [dict remove $run_props $s]
602 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."
603 Msg Info "Setting $s = $prop"
607 dict for {prop_name prop_val} $run_props {
608 Msg Debug "Setting $prop_name = $prop_val"
609 if {[string trim $prop_val] == ""} {
610 Msg Warning "Property $prop_name has empty value. Skipping..."
613 if {[IsInList [string toupper $prop_name] [VIVADO_PATH_PROPERTIES] 1]} {
614 # Check that the file exists before setting these properties
615 set utility_file $globalSettings::repo_path/$prop_val
616 if {[file exists $utility_file]} {
617 lassign [GetHogFiles -ext_path $globalSettings::HOG_EXTERNAL_PATH $globalSettings::list_path $globalSettings::repo_path] lib prop dummy
620 lappend hog_files $ff
623 if {[lsearch $hog_files $utility_file] < 0} {
624 Msg CriticalWarning "The file: $utility_file is set as a property in hog.conf but is not added to the project in any list file. Hog cannot track it."
626 #Add file tu utils_1 to avoid warning
627 AddFile $globalSettings::repo_path/$prop_val [get_filesets -quiet utils_1]
629 set_property $prop_name $utility_file $run
631 Msg Warning "Impossible to set property $prop_name to $prop_val. File is missing"
634 set_property $prop_name $prop_val $run
646 if {[
info exists globalSettings::PROPERTIES]} {
648 if {[dict exists $globalSettings::PROPERTIES main]} {
649 Msg Info "Setting device properties..."
650 set dev_props [dict get $globalSettings::PROPERTIES main]
651 dict for {prop_name prop_val} $dev_props {
652 if { !([string toupper $prop_name] in $globalSettings::LIBERO_MANDATORY_VARIABLES) } {
653 Msg Debug "Setting $prop_name = $prop_val"
654 set_device -[string tolower $prop_name] $prop_val
659 if {[dict exists $globalSettings::PROPERTIES project]} {
660 Msg Info "Setting project-wide properties..."
661 set dev_props [dict get $globalSettings::PROPERTIES project]
662 dict for {prop_name prop_val} $dev_props {
663 Msg Debug "Setting $prop_name = $prop_val"
664 project_settings -[string tolower $prop_name] $prop_val
668 if {[dict exists $globalSettings::PROPERTIES synth]} {
669 Msg Info "Setting Synthesis properties..."
670 set synth_props [dict get $globalSettings::PROPERTIES synth]
671 dict for {prop_name prop_val} $synth_props {
672 Msg Debug "Setting $prop_name = $prop_val"
673 configure_tool -name {SYNTHESIZE} -params "[string toupper $prop_name]:$prop_val"
677 if {[dict exists $globalSettings::PROPERTIES impl]} {
678 Msg Info "Setting Implementation properties..."
679 set impl_props [dict get $globalSettings::PROPERTIES impl]
680 dict for {prop_name prop_val} $impl_props {
681 Msg Debug "Setting $prop_name = $prop_val"
682 configure_tool -name {PLACEROUTE} -params "[string toupper $prop_name]:$prop_val"
687 if {[dict exists $globalSettings::PROPERTIES bitstream]} {
688 Msg Info "Setting Bitstream properties..."
689 set impl_props [dict get $globalSettings::PROPERTIES impl]
690 dict for {prop_name prop_val} $impl_props {
691 Msg Debug "Setting $prop_name = $prop_val"
692 configure_tool -name {GENERATEPROGRAMMINGFILE} -params "[string toupper $prop_name]:$prop_val"
696 configure_tool -name {VERIFYTIMING} -params {FORMAT:TEXT}
699 if {[
info exists globalSettings::PROPERTIES]} {
701 if {[dict exists $globalSettings::PROPERTIES main]} {
702 Msg Info "Setting project-wide properties..."
703 set dev_props [dict get $globalSettings::PROPERTIES main]
704 dict for {prop_name prop_val} $dev_props {
705 # Device is already set
706 if { [string toupper $prop_name] != "DEVICE" } {
707 Msg Debug "Setting $prop_name = $prop_val"
708 prj_project option $prop_name $prop_val
713 if {[dict exists $globalSettings::PROPERTIES impl]} {
714 Msg Info "Setting Implementation properties..."
715 set dev_props [dict get $globalSettings::PROPERTIES impl]
716 dict for {prop_name prop_val} $dev_props {
717 # Device is already set
718 Msg Debug "Setting $prop_name = $prop_val"
719 prj_impl option $prop_name $prop_val
724 Msg info "Configuring Properties"
733 current_run -implementation [get_runs impl_1]
740 Msg Info "Running report_ip_status, before upgrading and handling IPs..."
744 if {$globalSettings::HOG_IP_PATH != ""} {
745 set ip_repo_path $globalSettings::HOG_IP_PATH
746 Msg Info "HOG_IP_PATH is set, will pull/push synthesised IPs from/to $ip_repo_path."
748 HandleIP pull [get_property IP_FILE $ip] $ip_repo_path $globalSettings::repo_path [get_property IP_OUTPUT_DIR $ip]
751 Msg Info "HOG_IP_PATH not set, will not push/pull synthesised IPs."
755 proc SetGlobalVar {var {default_value HOG_NONE}} {
757 if {[
info exists ::$var]} {
758 Msg Debug "Setting $var to [subst $[subst ::$var]]"
760 set globalSettings::$var [subst $[subst ::$var]]
761 }
elseif {$default_value == "HOG_NONE"} {
762 Msg Error "Mandatory variable $var was not defined. Please define it in hog.conf or in project tcl script."
764 Msg Info "Setting $var to default value: \"$default_value\""
766 set globalSettings::$var $default_value
772 proc CreateProject args {
777 if {[
catch {
package require cmdline} ERROR]} {
778 puts "ERROR: If you are running this script on tclsh, you can fix this by installing 'tcllib'"
782 {simlib_path.arg "" "Path of simulation libs"}
783 {verbose "If set, launch the script in verbose mode."}
786 set usage "Create Vivado/ISE/Quartus/Libero/Diamond project.\nUsage: CreateProject \[OPTIONS\] <project> <repository path>\n Options:"
788 if {[
catch {
array set options [
cmdline::getoptions args $parameters $usage]}] || [
llength $args] < 2 ||[
lindex $args 0] eq""} {
793 set globalSettings::DESIGN [
lindex $args 0]
794 if {[
file exists [
lindex $args 1]]} {
795 set globalSettings::repo_path [
file normalize [
lindex $args 1]]
797 Msg Error "The second argument, [
lindex $args 1], should be the repository path."
799 set globalSettings::tcl_path $globalSettings::repo_path/Hog/Tcl
802 if { $options(verbose) == 1 } {
803 variable ::DEBUG_MODE 1
807 if {$options(simlib_path)!= ""} {
809 set globalSettings::simlib_path "$options(simlib_path)"
811 set globalSettings::simlib_path "$globalSettings::repo_path/$options(simlib_path)"
813 Msg Info "Simulation library path set to $options(simlib_path)"
815 set globalSettings::simlib_path "$globalSettings::repo_path/SimulationLib"
816 Msg Info "Simulation library path set to default $globalSettings::repo_path/SimulationLib"
821 set proj_dir [
file normalize $globalSettings::repo_path/Top/$globalSettings::DESIGN]
822 lassign [
GetConfFiles $proj_dir] conf_file sim_file pre_file post_file
825 if {[
file exists $conf_file]} {
826 Msg Info "Parsing configuration file $conf_file..."
832 if {$conf_version != "0.0.0"} {
835 set a_v [
split $actual_version "."]
836 set c_v [
split $conf_version "."]
838 if { [
llength $a_v] < 2} {
839 Msg Error "Couldn't parse IDE version: $actual_version."
840 }
elseif {[
llength $a_v] == 2} {
843 if { [
llength $c_v] < 2} {
844 Msg Error "Wrong version format in hog.conf: $conf_version."
845 }
elseif {[
llength $c_v] == 2} {
851 Msg Info "Project version and $ide version match: $conf_version."
852 }
elseif {$comp == 1} {
853 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."
855 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."
858 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"
860 if {[dict exists $globalSettings::PROPERTIES main]} {
861 set main [dict get $globalSettings::PROPERTIES main]
862 dict for {p v} $main {
863 # notice the dollar in front of p: creates new variables and fill them with the value
864 Msg Info "Main property $p set to $v"
869 Msg Error "No main section found in $conf_file, make sure it has a section called \[main\] containing the mandatory properties."
872 Msg Error "$conf_file was not found in your project directory, please create one."
898 if {[
info exists env(HOG_EXTERNAL_PATH)]} {
899 set globalSettings::HOG_EXTERNAL_PATH $env(HOG_EXTERNAL_PATH)
901 set globalSettings::HOG_EXTERNAL_PATH ""
906 set build_dir_name "Projects"
907 set globalSettings::group_name [
file dirname $globalSettings::DESIGN]
908 set globalSettings::pre_synth_file "pre-synthesis.tcl"
909 set globalSettings::post_synth_file "post-synthesis.tcl"
910 set globalSettings::pre_impl_file "pre-implementation.tcl"
911 set globalSettings::post_impl_file "post-implementation.tcl"
912 set globalSettings::pre_bit_file "pre-bitstream.tcl"
913 set globalSettings::post_bit_file "post-bitstream.tcl"
914 set globalSettings::quartus_post_module_file "quartus-post-module.tcl"
915 set globalSettings::top_path "$globalSettings::repo_path/Top/$globalSettings::DESIGN"
916 set globalSettings::list_path "$globalSettings::top_path/list"
917 set globalSettings::build_dir "$globalSettings::repo_path/$build_dir_name/$globalSettings::DESIGN"
918 set globalSettings::DESIGN [
file tail $globalSettings::DESIGN]
919 set globalSettings::top_name [
file tail $globalSettings::DESIGN]
920 set globalSettings::top_name [
file rootname $globalSettings::top_name]
921 set globalSettings::synth_top_module "top_$globalSettings::top_name"
922 set globalSettings::user_ip_repo ""
924 set globalSettings::pre_synth [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_synth_file"]
925 set globalSettings::post_synth [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_synth_file"]
926 set globalSettings::pre_impl [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_impl_file"]
927 set globalSettings::post_impl [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_impl_file"]
928 set globalSettings::pre_bit [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::pre_bit_file"]
929 set globalSettings::post_bit [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::post_bit_file"]
930 set globalSettings::quartus_post_module [
file normalize "$globalSettings::tcl_path/integrated/$globalSettings::quartus_post_module_file"]
931 set globalSettings::LIBERO_MANDATORY_VARIABLES {"FAMILY" "PACKAGE" "DIE" }
933 set user_hog_file "$globalSettings::repo_path/Top/hog.tcl"
934 if {[
file exists $user_hog_file]} {
935 Msg Info "Sourcing user hog.tcl file..."
936 source $user_hog_file
939 if {[
file exists $pre_file]} {
940 Msg Info "Found pre-creation Tcl script $pre_file, executing it..."
944 if {[
info exists env(HOG_IP_PATH)]} {
945 set globalSettings::HOG_IP_PATH $env(HOG_IP_PATH)
947 set globalSettings::HOG_IP_PATH ""
962 set fileName_old [
file normalize "./hogTmp/.hogQsys.md5"]
963 set fileDir [
file normalize "$globalSettings::build_dir/.hog/"]
965 set fileName_new [
file normalize "$fileDir/.hogQsys.md5"]
966 if {[
file exists $fileName_new]} {
967 file delete $fileName_new
969 if {[
file exists $fileName_old]} {
970 file rename -force $fileName_old $fileName_new
971 file delete -force -- "./hogTmp"
975 if {[
file exists $post_file]} {
976 Msg Info "Found post-creation Tcl script $post_file, executing it..."
980 build_design_hierarchy
986 lassign [
GetHogFiles -ext_path "$globalSettings::HOG_EXTERNAL_PATH" -list_files ".src,.ext" "$globalSettings::repo_path/Top/$globalSettings::group_name/$globalSettings::DESIGN/list/" $globalSettings::repo_path] listLibraries listProperties listSrcSets
988 lassign [
GetHogFiles -ext_path "$globalSettings::HOG_EXTERNAL_PATH" -list_files ".con" "$globalSettings::repo_path/Top/$globalSettings::group_name/$globalSettings::DESIGN/list/" $globalSettings::repo_path] listConstraints listConProperties listConSets
990 lassign [
GetHogFiles -ext_path "$globalSettings::HOG_EXTERNAL_PATH" -list_files ".sim" "$globalSettings::repo_path/Top/$globalSettings::group_name/$globalSettings::DESIGN/list/" $globalSettings::repo_path] listSimLibraries listSimProperties listSimSets
993 cd $globalSettings::build_dir
999 cd $globalSettings::repo_path
1002 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
1006 if {$commit == 0 } {
1007 set commit $this_commit
1010 if {$xml_hash != ""} {
1018 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
1030 Msg Info "Project $globalSettings::DESIGN created successfully in [
Relative $globalSettings::repo_path $globalSettings::build_dir]."