summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/classes/xilinx-vars.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2022-11-07 13:55:13 -0800
committerMark Hatle <mark.hatle@amd.com>2022-11-10 15:04:42 -0800
commite041b4fd3be52c1804e63a64cf2764be0c5c8675 (patch)
tree2eff6fe2152a32da7de5fda43a4b77f65c43b72c /meta-xilinx-core/classes/xilinx-vars.bbclass
parent7a7009d7090a8058b3d9504d2a2e3d84ed149d9b (diff)
downloadmeta-xilinx-e041b4fd3be52c1804e63a64cf2764be0c5c8675.tar.gz
conf/machine: Better document inheritence expectations
See the README files for specific requirements, but we have designed the machine configurations into an inheritance model. This module can be further broken into 3 distinct categories of variables: 1 - Variables that MUST be declared BEFORE inheriting the base machine 2 - Variables that SHOULD be declared BEFORE inheriting the base machine, as they are commonly overridden. (This will need continual review.) 3 - All remaining variables that should only be declared in the machine .conf file, and MUST be declared AFTER inheriting the base machine. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/classes/xilinx-vars.bbclass')
-rw-r--r--meta-xilinx-core/classes/xilinx-vars.bbclass26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta-xilinx-core/classes/xilinx-vars.bbclass b/meta-xilinx-core/classes/xilinx-vars.bbclass
new file mode 100644
index 00000000..a1a0e38c
--- /dev/null
+++ b/meta-xilinx-core/classes/xilinx-vars.bbclass
@@ -0,0 +1,26 @@
1# Check variable usage to make sure that the machine is probably configured
2# properly.
3addhandler xilinx_variables_config_eventhandler
4xilinx_variables_config_eventhandler[eventmask] = "bb.event.ConfigParsed"
5
6# It's up to the base sytem to define the variables being used here, we're
7# only going to check them.
8python xilinx_variables_config_eventhandler () {
9 # Verify HDF_MACHINE
10 hdf_prior = d.getVar('HDF_MACHINE_PRIOR')
11 hdf_final = d.getVar('HDF_MACHINE')
12
13 if hdf_prior and hdf_prior != hdf_final:
14 bb.fatal("HDF_MACHINE is set to %s, it appears you intended %s. " \
15 "This is usually as a result of specifying it in the local.conf or before the 'require' in the machine .conf file. " \
16 "See meta-xilinx-core/conf/machine/README." % (hdf_final, hdf_prior))
17
18 # Verify DEFAULTTUNE
19 tune_prior = d.getVar('DEFAULTTUNE_PRIOR')
20 tune_final = d.getVar('DEFAULTTUNE')
21
22 if tune_prior and tune_prior != tune_final:
23 bb.fatal("The loaded DEFAULTTUNE is %s, but it appears you intended %s. " \
24 "This is usually as a result of specifying it after the 'require' in the machine .conf file. " \
25 "See meta-xilinx-core/conf/machine/README." % (tune_prior, tune_final))
26}