summaryrefslogtreecommitdiffstats
path: root/conf/machine/include/microblaze/feature-microblaze-versions.inc
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2017-01-14 20:26:20 +1000
committerNathan Rossi <nathan@nathanrossi.com>2017-03-31 22:31:49 +1000
commitdf22c892c6d1254709ea5dbd89674877f23193fd (patch)
tree9fe44856e44d7b0d523d4ff46b908ad8e8159d78 /conf/machine/include/microblaze/feature-microblaze-versions.inc
parentf17852607bc73aea32fb10e089ac441fe7413397 (diff)
downloadmeta-xilinx-df22c892c6d1254709ea5dbd89674877f23193fd.tar.gz
feature-microblaze-versions.inc: Clean up and consolidation
Clean up the MicroBlaze versions tunes as well and improve the TUNECONFLICTS for version features so that the conflicts matrix is automatically generated. Additionally consolidate the version features into a single include. Improve and generate the "-mcpu=" and package strings based on the version feature. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'conf/machine/include/microblaze/feature-microblaze-versions.inc')
-rw-r--r--conf/machine/include/microblaze/feature-microblaze-versions.inc126
1 files changed, 104 insertions, 22 deletions
diff --git a/conf/machine/include/microblaze/feature-microblaze-versions.inc b/conf/machine/include/microblaze/feature-microblaze-versions.inc
index 1d99ede4..dcdf020d 100644
--- a/conf/machine/include/microblaze/feature-microblaze-versions.inc
+++ b/conf/machine/include/microblaze/feature-microblaze-versions.inc
@@ -1,22 +1,104 @@
1# Microblaze Versions are defined as features sets, each containing 1# MicroBlaze versions are defined as features, the features are setup to
2# a set of hardware features. 2# conflict with other versions as well as unavailable features for particular
3 3# versions.
4MBCCARGSVERSION = "" 4
5MBPKGVERSION = "" 5def microblaze_parse_version(s):
6require conf/machine/include/microblaze/feature-microblaze-v10.inc 6 # versions before v9 use the "vX.YY.Z" scheme where Z = [ab]
7require conf/machine/include/microblaze/feature-microblaze-v9.inc 7 # versions after v8 use the "vX.Y" scheme
8require conf/machine/include/microblaze/feature-microblaze-v8.inc 8 import re
9require conf/machine/include/microblaze/feature-microblaze-v7.inc 9 m = re.search("^v(\d+)\.(\d+)(\.([ab]))?", s)
10 10 if m:
11# Setup a 'feature set' conflict list which ensures only one version is selected 11 major, minor = int(m.group(1)), int(m.group(2))
12# when defining the TUNE_FEATURES_tune-<> in local.conf file. 12 if major < 9:
13TUNECONFLICTS[v10.0] += "v7.30 v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.6" 13 return (major, minor, m.group(4) or "a")
14TUNECONFLICTS[v9.6] += "v7.30 v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v10.0" 14 return (major, minor)
15TUNECONFLICTS[v9.0] += "v7.30 v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.6 v10.0" 15 return None
16TUNECONFLICTS[v8.50] += "v7.30 v8.00 v8.10 v8.20 v8.30 v8.40 v9.0 v9.6 v10.0" 16
17TUNECONFLICTS[v8.40] += "v7.30 v8.00 v8.10 v8.20 v8.30 v8.50 v9.0 v9.6 v10.0" 17def microblaze_version_conflict(ver, d):
18TUNECONFLICTS[v8.30] += "v7.30 v8.00 v8.10 v8.20 v8.40 v8.50 v9.0 v9.6 v10.0" 18 tunes = d.getVarFlags("TUNEVALID").keys()
19TUNECONFLICTS[v8.20] += "v7.30 v8.00 v8.10 v8.30 v8.40 v8.50 v9.0 v9.6 v10.0" 19 conflict = []
20TUNECONFLICTS[v8.10] += "v7.30 v8.00 v8.20 v8.30 v8.40 v8.50 v9.0 v9.6 v10.0" 20 version = microblaze_parse_version(ver)
21TUNECONFLICTS[v8.00] += "v7.30 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.6 v10.0" 21 for i in tunes:
22TUNECONFLICTS[v7.30] += "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.6 v10.0" 22 iversion = microblaze_parse_version(i)
23 if iversion and iversion != version:
24 conflict.append(i)
25 return " ".join(conflict)
26
27def microblaze_current_version(d):
28 tunes = (d.getVar("TUNE_FEATURES") or "").split()
29 for i in tunes:
30 version = microblaze_parse_version(i)
31 if version:
32 return version
33 return None
34
35def microblaze_format_gcc_version(ver):
36 if ver:
37 if ver[0] <= 8 and len(ver) > 2:
38 return "v%d.%d.%s" % ver[0:3]
39 else:
40 return "v%d.%d" % ver[0:2]
41 return ""
42
43def microblaze_format_pkg_version(ver):
44 if ver:
45 if ver[0] <= 8 and len(ver) > 2 and ver[2] != "a":
46 return "v%d.%d.%s" % ver[0:3]
47 else:
48 return "v%d.%d" % ver[0:2]
49 return ""
50
51# MicroBlaze versions
52TUNEVALID[v7.30] = "MicroBlaze version 7.30"
53TUNEVALID[v8.00] = "MicroBlaze version 8.00"
54TUNEVALID[v8.10] = "MicroBlaze version 8.10"
55TUNEVALID[v8.20] = "MicroBlaze version 8.20"
56TUNEVALID[v8.30] = "MicroBlaze version 8.30"
57TUNEVALID[v8.40] = "MicroBlaze version 8.40"
58TUNEVALID[v8.50] = "MicroBlaze version 8.50"
59TUNEVALID[v9.0] = "MicroBlaze version 9.0"
60TUNEVALID[v9.1] = "MicroBlaze version 9.1"
61TUNEVALID[v9.2] = "MicroBlaze version 9.2"
62TUNEVALID[v9.3] = "MicroBlaze version 9.3"
63TUNEVALID[v9.4] = "MicroBlaze version 9.4"
64TUNEVALID[v9.5] = "MicroBlaze version 9.5"
65TUNEVALID[v9.6] = "MicroBlaze version 9.6"
66TUNEVALID[v10.0] = "MicroBlaze version 10.0"
67
68# Version conflict matrix
69TUNECONFLICTS[v7.30] := "${@microblaze_version_conflict('v7.30', d)}"
70TUNECONFLICTS[v8.00] := "${@microblaze_version_conflict('v8.00', d)}"
71TUNECONFLICTS[v8.10] := "${@microblaze_version_conflict('v8.10', d)}"
72TUNECONFLICTS[v8.20] := "${@microblaze_version_conflict('v8.20', d)}"
73TUNECONFLICTS[v8.30] := "${@microblaze_version_conflict('v8.30', d)}"
74TUNECONFLICTS[v8.40] := "${@microblaze_version_conflict('v8.40', d)}"
75TUNECONFLICTS[v8.50] := "${@microblaze_version_conflict('v8.50', d)}"
76TUNECONFLICTS[v9.0] := "${@microblaze_version_conflict('v9.0', d)}"
77TUNECONFLICTS[v9.1] := "${@microblaze_version_conflict('v9.1', d)}"
78TUNECONFLICTS[v9.2] := "${@microblaze_version_conflict('v9.2', d)}"
79TUNECONFLICTS[v9.3] := "${@microblaze_version_conflict('v9.3', d)}"
80TUNECONFLICTS[v9.4] := "${@microblaze_version_conflict('v9.4', d)}"
81TUNECONFLICTS[v9.5] := "${@microblaze_version_conflict('v9.5', d)}"
82TUNECONFLICTS[v9.6] := "${@microblaze_version_conflict('v9.6', d)}"
83TUNECONFLICTS[v10.0] := "${@microblaze_version_conflict('v10.0', d)}"
84
85# Version/feature conflicts
86TUNECONFLICTS[v7.30] += "reorder little-endian"
87TUNECONFLICTS[v8.00] += "reorder"
88TUNECONFLICTS[v8.10] += "reorder"
89TUNECONFLICTS[v8.20] += "reorder"
90
91# Version flags
92TUNE_CCARGS += "-mcpu=${@microblaze_format_gcc_version(microblaze_current_version(d))}"
93MBPKGARCH_VERSION = "-${@microblaze_format_pkg_version(microblaze_current_version(d))}"
94
95# Perform some additional tune feature dependency enforcement
96python __anonymous () {
97 tunes = (d.getVar('TUNE_FEATURES') or "").split()
98 if len(tunes) != 0:
99 # For v8.30 pattern-compare is required if reorder is enabled, enforce
100 # this in tune features.
101 if 'v8.30' in tunes and 'reorder' in tunes and 'pattern-compare' not in tunes:
102 d.setVar("TUNE_FEATURES_append", " pattern-compare")
103}
104