diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2017-11-24 23:28:00 +1000 |
---|---|---|
committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-12-06 15:45:16 -0800 |
commit | 0f891fdd02753e86bf02123b43043b12f7582569 (patch) | |
tree | 0e8f2870fc423c927717dd336740e38b4e2226f9 /conf | |
parent | b86a915ae0129ad699eaa9ce7e4929591e093bf6 (diff) | |
download | meta-xilinx-0f891fdd02753e86bf02123b43043b12f7582569.tar.gz |
feature-microblaze-versions.inc: Rework and expand version conflicts
This change removes the use of the python function to expand the
TUNECONFLICTS definitions for version tunes. Instead this is replaced
with hardcoded definitions. This is preferred due to reduced complexity
of the python code as well as streamlining the include, this is also
done to make the includes align better with expectations of tune
includes in OE-Core.
This change also moves the version conflicts for the reorder tune into
arch-microblaze.
Additional documentation is added to cover details of MicroBlaze CPU
versions, and the change between different version formats.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Diffstat (limited to 'conf')
-rw-r--r-- | conf/machine/include/microblaze/arch-microblaze.inc | 1 | ||||
-rw-r--r-- | conf/machine/include/microblaze/feature-microblaze-versions.inc | 92 |
2 files changed, 42 insertions, 51 deletions
diff --git a/conf/machine/include/microblaze/arch-microblaze.inc b/conf/machine/include/microblaze/arch-microblaze.inc index 27f776c5..5eaa7dd5 100644 --- a/conf/machine/include/microblaze/arch-microblaze.inc +++ b/conf/machine/include/microblaze/arch-microblaze.inc | |||
@@ -15,6 +15,7 @@ TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "-mbig-endian | |||
15 | TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter" | 15 | TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter" |
16 | TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions" | 16 | TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions" |
17 | TUNEVALID[reorder] = "Enable Reorder Instructions" | 17 | TUNEVALID[reorder] = "Enable Reorder Instructions" |
18 | TUNECONFLICTS[reorder] += "v8.00 v8.10 v8.20" | ||
18 | 19 | ||
19 | # General feature compiler args | 20 | # General feature compiler args |
20 | TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-mxl-barrel-shift", "-mno-xl-barrel-shift" ,d)}" | 21 | TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-mxl-barrel-shift", "-mno-xl-barrel-shift" ,d)}" |
diff --git a/conf/machine/include/microblaze/feature-microblaze-versions.inc b/conf/machine/include/microblaze/feature-microblaze-versions.inc index 2e641649..955674ff 100644 --- a/conf/machine/include/microblaze/feature-microblaze-versions.inc +++ b/conf/machine/include/microblaze/feature-microblaze-versions.inc | |||
@@ -1,35 +1,30 @@ | |||
1 | # MicroBlaze versions are defined as features, the features are setup to | 1 | # MicroBlaze versions are defined as features, the features are setup to |
2 | # conflict with other versions as well as unavailable features for particular | 2 | # conflict with other versions as well as unavailable features for particular |
3 | # versions. | 3 | # versions. |
4 | # | ||
5 | # Versions before v9.0 of MicroBlaze use a versioning scheme of "vX.YY.Z" | ||
6 | # (where Z = [abc]). For v8.* versions of MicroBlaze the revision (Z) changes | ||
7 | # did not affect ABI and are ignored by this tune configuration. Though this | ||
8 | # format is expected by GCC including the revision, but this is defaulted to | ||
9 | # ".a". | ||
10 | # | ||
11 | # Since v9.0 of MicroBlaze the revision (Z) part of versions was entirely | ||
12 | # dropped and the version scheme was changed to "vX.Y". | ||
4 | 13 | ||
5 | def microblaze_parse_version(s): | 14 | def microblaze_current_version(d, gcc = False): |
6 | # versions before v9 use the "vX.YY.Z" scheme where Z = [ab] | ||
7 | # versions after v8 use the "vX.Y" scheme | ||
8 | import re | 15 | import re |
9 | m = re.search("^v(\d+)\.(\d+)(\.([ab]))?", s) | 16 | # find the current version, and convert it to major/minor integers |
10 | if m: | 17 | version = None |
11 | major, minor = int(m.group(1)), int(m.group(2)) | 18 | for t in (d.getVar("TUNE_FEATURES") or "").split(): |
12 | if major < 9: | 19 | m = re.search("^v(\d+)\.(\d+)", t) |
13 | return (major, minor, m.group(4) or "a") | 20 | if m: |
14 | return (major, minor) | 21 | version = int(m.group(1)), int(m.group(2)) |
15 | return None | 22 | break |
16 | |||
17 | def microblaze_version_conflict(ver, d): | ||
18 | tunes = d.getVarFlags("TUNEVALID").keys() | ||
19 | conflict = [] | ||
20 | version = microblaze_parse_version(ver) | ||
21 | for i in tunes: | ||
22 | iversion = microblaze_parse_version(i) | ||
23 | if iversion and iversion != version: | ||
24 | conflict.append(i) | ||
25 | return " ".join(conflict) | ||
26 | 23 | ||
27 | def microblaze_current_version(d, gcc = False): | 24 | # format the version string in generic or GCC specific formats |
28 | tunes = (d.getVar("TUNE_FEATURES") or "").split() | ||
29 | version = next((v for v in [microblaze_parse_version(i) for i in tunes] if v), None) | ||
30 | if version: | 25 | if version: |
31 | if version[0] <= 8 and len(version) > 2 and (gcc or version[2] != "a"): | 26 | if version[0] <= 8: |
32 | return "v%d.%02d.%s" % version[0:3] | 27 | return ("v%d.%02d" % version[0:2]) + (".a" if gcc else "") |
33 | else: | 28 | else: |
34 | return "v%d.%d" % version[0:2] | 29 | return "v%d.%d" % version[0:2] |
35 | return "" | 30 | return "" |
@@ -41,35 +36,30 @@ TUNEVALID[v8.20] = "MicroBlaze version 8.20" | |||
41 | TUNEVALID[v8.30] = "MicroBlaze version 8.30" | 36 | TUNEVALID[v8.30] = "MicroBlaze version 8.30" |
42 | TUNEVALID[v8.40] = "MicroBlaze version 8.40" | 37 | TUNEVALID[v8.40] = "MicroBlaze version 8.40" |
43 | TUNEVALID[v8.50] = "MicroBlaze version 8.50" | 38 | TUNEVALID[v8.50] = "MicroBlaze version 8.50" |
44 | TUNEVALID[v9.0] = "MicroBlaze version 9.0" | 39 | TUNEVALID[v9.0] = "MicroBlaze version 9.0" |
45 | TUNEVALID[v9.1] = "MicroBlaze version 9.1" | 40 | TUNEVALID[v9.1] = "MicroBlaze version 9.1" |
46 | TUNEVALID[v9.2] = "MicroBlaze version 9.2" | 41 | TUNEVALID[v9.2] = "MicroBlaze version 9.2" |
47 | TUNEVALID[v9.3] = "MicroBlaze version 9.3" | 42 | TUNEVALID[v9.3] = "MicroBlaze version 9.3" |
48 | TUNEVALID[v9.4] = "MicroBlaze version 9.4" | 43 | TUNEVALID[v9.4] = "MicroBlaze version 9.4" |
49 | TUNEVALID[v9.5] = "MicroBlaze version 9.5" | 44 | TUNEVALID[v9.5] = "MicroBlaze version 9.5" |
50 | TUNEVALID[v9.6] = "MicroBlaze version 9.6" | 45 | TUNEVALID[v9.6] = "MicroBlaze version 9.6" |
51 | TUNEVALID[v10.0] = "MicroBlaze version 10.0" | 46 | TUNEVALID[v10.0] = "MicroBlaze version 10.0" |
52 | 47 | ||
53 | # Version conflict matrix | 48 | # Version conflict matrix |
54 | TUNECONFLICTS[v8.00] := "${@microblaze_version_conflict('v8.00', d)}" | 49 | TUNECONFLICTS[v8.00] = "" |
55 | TUNECONFLICTS[v8.10] := "${@microblaze_version_conflict('v8.10', d)}" | 50 | TUNECONFLICTS[v8.10] = "v8.00" |
56 | TUNECONFLICTS[v8.20] := "${@microblaze_version_conflict('v8.20', d)}" | 51 | TUNECONFLICTS[v8.20] = "v8.00 v8.10" |
57 | TUNECONFLICTS[v8.30] := "${@microblaze_version_conflict('v8.30', d)}" | 52 | TUNECONFLICTS[v8.30] = "v8.00 v8.10 v8.20" |
58 | TUNECONFLICTS[v8.40] := "${@microblaze_version_conflict('v8.40', d)}" | 53 | TUNECONFLICTS[v8.40] = "v8.00 v8.10 v8.20 v8.30" |
59 | TUNECONFLICTS[v8.50] := "${@microblaze_version_conflict('v8.50', d)}" | 54 | TUNECONFLICTS[v8.50] = "v8.00 v8.10 v8.20 v8.30 v8.40" |
60 | TUNECONFLICTS[v9.0] := "${@microblaze_version_conflict('v9.0', d)}" | 55 | TUNECONFLICTS[v9.0] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50" |
61 | TUNECONFLICTS[v9.1] := "${@microblaze_version_conflict('v9.1', d)}" | 56 | TUNECONFLICTS[v9.1] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0" |
62 | TUNECONFLICTS[v9.2] := "${@microblaze_version_conflict('v9.2', d)}" | 57 | TUNECONFLICTS[v9.2] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1" |
63 | TUNECONFLICTS[v9.3] := "${@microblaze_version_conflict('v9.3', d)}" | 58 | TUNECONFLICTS[v9.3] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2" |
64 | TUNECONFLICTS[v9.4] := "${@microblaze_version_conflict('v9.4', d)}" | 59 | TUNECONFLICTS[v9.4] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3" |
65 | TUNECONFLICTS[v9.5] := "${@microblaze_version_conflict('v9.5', d)}" | 60 | TUNECONFLICTS[v9.5] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4" |
66 | TUNECONFLICTS[v9.6] := "${@microblaze_version_conflict('v9.6', d)}" | 61 | TUNECONFLICTS[v9.6] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4 v9.5" |
67 | TUNECONFLICTS[v10.0] := "${@microblaze_version_conflict('v10.0', d)}" | 62 | TUNECONFLICTS[v10.0] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4 v9.5 v9.6" |
68 | |||
69 | # Version/feature conflicts | ||
70 | TUNECONFLICTS[v8.00] += "reorder" | ||
71 | TUNECONFLICTS[v8.10] += "reorder" | ||
72 | TUNECONFLICTS[v8.20] += "reorder" | ||
73 | 63 | ||
74 | # Version flags | 64 | # Version flags |
75 | TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}" | 65 | TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}" |