Hog Hog2026.2-1
add_hog_custom_button.tcl
Go to the documentation of this file.
1 #!/usr/bin/env tclsh
2 # Copyright 2018-2026 The University of Birmingham
3 # Copyright 2018-2026 Max-Planck-Institute for Physics
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 # @file
18 # Creates two custom buttons in Vivado gui with Hog logo, to update automatically list files and hog.conf
19 # tclint-disable line-length
20 set hog_path [file normalize "[file dirname [info script]]/../.."]
21 
22 remove_gui_custom_commands -quiet Hog_check
23 create_gui_custom_command -name Hog_check -description "Check Hog list files and hog.conf" -show_on_toolbar -toolbar_icon $hog_path/images/hog_check.png -command "if {\[info exists env(HOG_EXTERNAL_PATH)\]} {set argv \[list \"-ext_path\" \"\$env(HOG_EXTERNAL_PATH)\"]} else { set argv \"\" }; set proj_file \[get_property DIRECTORY \[current_project\]\]; set index \[string last \"Projects/\" \$proj_file\]; set index \[expr \$index - 2\]; set repo_path \[string range \$proj_file 0 \$index\];
24 source -notrace \$repo_path/Hog/Tcl/utils/check_list_files.tcl; set argv \[list\]"
25 
26 remove_gui_custom_commands -quiet Hog_listFiles
27 create_gui_custom_command -name Hog_listFiles -description "Recreate Hog list files (overwrites the old ones)" -show_on_toolbar -toolbar_icon $hog_path/images/hog_list.png -command "if {\[info exists env(HOG_EXTERNAL_PATH)\]} {set argv \[list \"-recreate\" \"-force\"\ \"-ext_path\" \"\$env(HOG_EXTERNAL_PATH)\"]} else { set argv \[list \"-recreate\" \"-force\"\] }; set proj_file \[get_property DIRECTORY \[current_project\]\]; set index \[string last \"Projects/\" \$proj_file\]; set index \[expr \$index - 2\]; set repo_path \[string range \$proj_file 0 \$index\];
28 source -notrace \$repo_path/Hog/Tcl/utils/check_list_files.tcl; set argv \[list\]"
29 
30 remove_gui_custom_commands -quiet Hog_conf
31 create_gui_custom_command -name Hog_conf -description "Recreate hog.conf (overwrites the old ones)" -show_on_toolbar -toolbar_icon $hog_path/images/hog_cfg.png -command "if {\[info exists env(HOG_EXTERNAL_PATH)\]} {set argv \[list \"-recreate_conf\" \"-force\"\ \"-ext_path\" \"\$env(HOG_EXTERNAL_PATH)\"]} else { set argv \[list \"-recreate_conf\" \"-force\"\] }; set proj_file \[get_property DIRECTORY \[current_project\]\]; set index \[string last \"Projects/\" \$proj_file\]; set index \[expr \$index - 2\]; set repo_path \[string range \$proj_file 0 \$index\]; source -notrace \$repo_path/Hog/Tcl/utils/check_list_files.tcl; set argv \[list\]"
32 
33 remove_gui_custom_commands -quiet Hog_sim
34 create_gui_custom_command -name Hog_sim -description "Recreate hog sim list files (overwrites the old ones)" -show_on_toolbar -toolbar_icon $hog_path/images/hog_sim.png -command "if {\[info exists env(HOG_EXTERNAL_PATH)\]} {set argv \[list \"-recreate_sim\" \"-force\"\ \"-ext_path\" \"\$env(HOG_EXTERNAL_PATH)\"]} else { set argv \[list \"-recreate_sim\" \"-force\"\] }; set proj_file \[get_property DIRECTORY \[current_project\]\]; set index \[string last \"Projects/\" \$proj_file\]; set index \[expr \$index - 2\]; set repo_path \[string range \$proj_file 0 \$index\]; source -notrace \$repo_path/Hog/Tcl/utils/check_list_files.tcl; set argv \[list\]"