Hog v10.13.0
commands.tcl
Go to the documentation of this file.
1 #!/usr/bin/env tclsh
2 # @file
3 # Copyright 2018-2026 The University of Birmingham
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 # Developers Tip for new commands
18 # Add a hashtag sign # after the curly brake (e.g. \^C(REATE)?$ {# ...}) if the command requires a project name as an argument
19 
20 # Add this bit above!
21 # \^NEW_DIRECTIVE?$ {
22 # set do_new_directive 1
23 # }
24 
25 set default_commands {
26  \^L(IST)?$ {
27  Msg Status "\n** The projects in this repository are:"
28  ListProjects $repo_path $list_all
29  Msg Status "\n"
30  exit 0
31  # NAME*: LIST or L
32  # DESCRIPTION: List the projects in the repository. To show hidden projects use the -all option
33  # OPTIONS: all, verbose
34  }
35 
36  \^H(ELP)?$ {
37  puts "$usage"
38  exit 0
39  # NAME: HELP or H
40  # DESCRIPTION: Display this help message or specific help for each directive
41  # OPTIONS:
42  }
43 
44  \^(CHECKCI|CIE)?$ {
45  set do_check_ci_env 1
46  # NAME: CHECKCIENV or CIE
47  # DESCRIPTION: Check that the common environment variables needed for Hog-CI are set
48  # OPTIONS: verbose
49  }
50 
51  \^(CHECKPROJENV|CPE)?$ {#
52  set do_checkproj_env 1
53  # NAME: CHECKPROJENV or CPE
54  # DESCRIPTION: Check that the environment variables needed for Hog-CI to run the chosen project are set and point to valid paths
55  # OPTIONS: verbose
56  }
57 
58  \^(CHECKPROJVER|CPV)?$ {#
59  set do_checkproj_ver 1
60  # NAME: CHECKPROJVER or CPV
61  # DESCRIPTION: Check the project version just before creating the HDL project in Create_Project stage. \
62  The CI job will SKIP the project pipeline, if it the project has not been modified with respect to the target branch.
63  # OPTIONS: ext_path.arg, simcheck, verbose
64  }
65 
66  \^C(REATE)?$ {#
67  set do_create 1
68  set recreate 1
69  # NAME*: CREATE or C
70  # DESCRIPTION: Create the project, replace it if already existing.
71  # OPTIONS: ext_path.arg, lib.arg, vivado_only, vitis_only, verbose
72  }
73 
74  \^I(MPL(EMENT(ATION)?)?)?$ {#
75  set do_implementation 1
76  set do_bitstream 1
77  set do_compile 1
78  # NAME: IMPLEMENTATION or I
79  # DESCRIPTION: Runs only the implementation, the project must already exist and be synthesised.
80  # OPTIONS: check_syntax, ext_path.arg, njobs.arg, no_bitstream, no_reset, recreate, verbose
81  }
82 
83  \^SYNT(H(ESIS(E)?)?)? {#
84  set do_synthesis 1
85  set do_compile 1
86  # NAME: SYNTH
87  # DESCRIPTION: Run synthesis only, create the project if not existing.
88  # OPTIONS: check_syntax, ext_path.arg, njobs.arg, recreate, verbose
89  }
90 
91  \^S(IM(ULAT(ION|E)?)?)?$ {#
92  set do_simulation 1
93  set do_create 1
94  # NAME*: SIMULATION or S
95  # DESCRIPTION: Simulate the project, creating it if not existing, unless it is a GHDL simulation.
96  # OPTIONS: check_syntax, compile_only, ext_path.arg, lib.arg, recreate, scripts_only, simset.arg, verbose
97  }
98 
99  \^W(ORK(FLOW)?)?$ {#
100  set do_implementation 1
101  set do_synthesis 1
102  set do_bitstream 1
103  set do_compile 1
104  # NAME*: WORKFLOW or W
105  # DESCRIPTION: Runs the full workflow, creates the project if not existing.
106  # OPTIONS: bitstream_only, check_syntax, ext_path.arg, impl_only, njobs.arg, no_bitstream, recreate, synth_only, verbose, vitis_only, xsa.arg
107  }
108 
109  \^(CREATEWORKFLOW|CW)?$ {#
110  set do_implementation 1
111  set do_synthesis 1
112  set do_bitstream 1
113  set do_compile 1
114  set do_create 1
115  set recreate 1
116  # NAME: CREATEWORKFLOW or CW
117  # DESCRIPTION: Creates the project -even if existing- and launches the complete workflow.
118  # OPTIONS: check_syntax, ext_path.arg, njobs.arg, no_bitstream, synth_only, verbose, vivado_only, vitis_only, xsa.arg
119  }
120 
121  \^(CHECKSYNTAX|CS)?$ {#proj
122  set do_check_syntax 1
123  # NAME: CHECKSYNTAX or CS
124  # DESCRIPTION: Check the syntax of the project. Only for Vivado, Quartus and Libero projects.
125  # OPTIONS: ext_path.arg, recreate, verbose
126  }
127 
128  ^(IPB(US)?)|(X(ML)?)$ {#proj
129  set do_ipbus_xml 1
130  # NAME: IPBUS or IPB
131  # DESCRIPTION: Copy, check or create the IPbus XMLs for the project.
132  # OPTIONS: dst_dir.arg, generate, verbose
133  }
134 
135  \^V(IEW)?$ {#proj
136  set do_list_file_parse 1
137  # NAME*: VIEW or V
138  # DESCRIPTION: Print Hog list file contents in a tree-like fashon.
139  # OPTIONS: verbose
140  }
141 
142  \^(CHECKYAML|YML)?$ {
143  set min_n_of_args -1
144  set max_n_of_args 1
145  set do_check_yaml_ref 1
146  # NAME: CHECKYML or YML
147  # DESCRIPTION: Check that the ref to Hog repository in the .gitlab-ci.yml file, matches the one in Hog submodule.
148  # OPTIONS: verbose
149  }
150 
151  \^B(UTTONS)?$ {
152  set min_n_of_args -1
153  set max_n_of_args 1
154  set do_buttons 1
155  # NAME: BUTTONS or B
156  # DESCRIPTION: Add Hog buttons to the Vivado GUI, to check and recreate Hog list and configuration files.
157  # OPTIONS: verbose
158  }
159 
160  \^(CHECKLIST|CL)?$ {#proj
161  set do_check_list_files 1
162  # NAME: CHECKLIST or CL
163  # DESCRIPTION: Check that list and configuration files on disk match what is on the project.
164  # OPTIONS: ext_path.arg, verbose
165  }
166 
167  \^COMPSIM(LIB)?$ {
168  set do_compile_lib 1
169  set argument_is_no_project 1
170  # NAME: COMPSIMLIB or COMPSIM
171  # DESCRIPTION: Compiles the simulation library for the chosen simulator with Vivado.
172  # OPTIONS: dst_dir.arg, verbose
173  }
174 
175  \^RTL(ANALYSIS)?$ {#
176  set do_rtl 1
177  # NAME: RTL or RTLANALYSIS
178  # DESCRIPTION: Elaborate the RTL analysis report for the chosen project.
179  # OPTIONS: check_syntax, recreate, verbose
180  }
181 
182  \^SIG(ASI)?$ {#
183  set do_sigasi 1
184  # NAME: SIGASI or SIG
185  # DESCRIPTION: Create a .csv file to be used in Sigasi.
186  # OPTIONS: verbose
187  }
188 
189  \^T(REE)?$ {#
190  set do_hierarchy 1
191  # NAME: TREE or T
192  # DESCRIPTION: Print the design hierarchy for the chosen project.
193  # OPTIONS: compile_order, ext_path.arg, ignore.arg, include_gen_prods, include_ieee, light, output.arg, top.arg, verbose
194  }
195 
196  \^VHDL(LS)?$ {#
197  set do_vhdl_ls 1
198  # NAME: VHDL-LS or VHDL
199  # DESCRIPTION: Create a VHDL-LS configuration file for the chosen project.
200  # OPTIONS: verbose
201  }
202 
203  \^COCOTB$ {#
204  set do_cocotb 1
205  # NAME: COCOTB
206  # DESCRIPTION: Create a cocotb Python script to build VHDL/Verilog libraries using runner.build().
207  # OPTIONS: verbose, lib.arg
208  }
209 
210  \^VER(SION)?$ {#
211  set do_version 1
212  # NAME*: VERSION or VER
213  # DESCRIPTION: Print the version of the chosen Hog project. With -describe, prints the Hog describe string instead.
214  # OPTIONS: describe, verbose
215  }
216 
217  default {
218  if {$directive != ""} {
219  set NO_DIRECTIVE_FOUND 1
220  } else {
221  puts "$usage"
222  exit 0
223  }
224  }
225 }