summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2017-11-24 23:28:00 +1000
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2017-12-06 15:45:16 -0800
commit0f891fdd02753e86bf02123b43043b12f7582569 (patch)
tree0e8f2870fc423c927717dd336740e38b4e2226f9 /conf
parentb86a915ae0129ad699eaa9ce7e4929591e093bf6 (diff)
downloadmeta-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.inc1
-rw-r--r--conf/machine/include/microblaze/feature-microblaze-versions.inc92
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
15TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter" 15TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter"
16TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions" 16TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions"
17TUNEVALID[reorder] = "Enable Reorder Instructions" 17TUNEVALID[reorder] = "Enable Reorder Instructions"
18TUNECONFLICTS[reorder] += "v8.00 v8.10 v8.20"
18 19
19# General feature compiler args 20# General feature compiler args
20TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-mxl-barrel-shift", "-mno-xl-barrel-shift" ,d)}" 21TUNE_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
5def microblaze_parse_version(s): 14def 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
17def 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
27def 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"
41TUNEVALID[v8.30] = "MicroBlaze version 8.30" 36TUNEVALID[v8.30] = "MicroBlaze version 8.30"
42TUNEVALID[v8.40] = "MicroBlaze version 8.40" 37TUNEVALID[v8.40] = "MicroBlaze version 8.40"
43TUNEVALID[v8.50] = "MicroBlaze version 8.50" 38TUNEVALID[v8.50] = "MicroBlaze version 8.50"
44TUNEVALID[v9.0] = "MicroBlaze version 9.0" 39TUNEVALID[v9.0] = "MicroBlaze version 9.0"
45TUNEVALID[v9.1] = "MicroBlaze version 9.1" 40TUNEVALID[v9.1] = "MicroBlaze version 9.1"
46TUNEVALID[v9.2] = "MicroBlaze version 9.2" 41TUNEVALID[v9.2] = "MicroBlaze version 9.2"
47TUNEVALID[v9.3] = "MicroBlaze version 9.3" 42TUNEVALID[v9.3] = "MicroBlaze version 9.3"
48TUNEVALID[v9.4] = "MicroBlaze version 9.4" 43TUNEVALID[v9.4] = "MicroBlaze version 9.4"
49TUNEVALID[v9.5] = "MicroBlaze version 9.5" 44TUNEVALID[v9.5] = "MicroBlaze version 9.5"
50TUNEVALID[v9.6] = "MicroBlaze version 9.6" 45TUNEVALID[v9.6] = "MicroBlaze version 9.6"
51TUNEVALID[v10.0] = "MicroBlaze version 10.0" 46TUNEVALID[v10.0] = "MicroBlaze version 10.0"
52 47
53# Version conflict matrix 48# Version conflict matrix
54TUNECONFLICTS[v8.00] := "${@microblaze_version_conflict('v8.00', d)}" 49TUNECONFLICTS[v8.00] = ""
55TUNECONFLICTS[v8.10] := "${@microblaze_version_conflict('v8.10', d)}" 50TUNECONFLICTS[v8.10] = "v8.00"
56TUNECONFLICTS[v8.20] := "${@microblaze_version_conflict('v8.20', d)}" 51TUNECONFLICTS[v8.20] = "v8.00 v8.10"
57TUNECONFLICTS[v8.30] := "${@microblaze_version_conflict('v8.30', d)}" 52TUNECONFLICTS[v8.30] = "v8.00 v8.10 v8.20"
58TUNECONFLICTS[v8.40] := "${@microblaze_version_conflict('v8.40', d)}" 53TUNECONFLICTS[v8.40] = "v8.00 v8.10 v8.20 v8.30"
59TUNECONFLICTS[v8.50] := "${@microblaze_version_conflict('v8.50', d)}" 54TUNECONFLICTS[v8.50] = "v8.00 v8.10 v8.20 v8.30 v8.40"
60TUNECONFLICTS[v9.0] := "${@microblaze_version_conflict('v9.0', d)}" 55TUNECONFLICTS[v9.0] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50"
61TUNECONFLICTS[v9.1] := "${@microblaze_version_conflict('v9.1', d)}" 56TUNECONFLICTS[v9.1] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0"
62TUNECONFLICTS[v9.2] := "${@microblaze_version_conflict('v9.2', d)}" 57TUNECONFLICTS[v9.2] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1"
63TUNECONFLICTS[v9.3] := "${@microblaze_version_conflict('v9.3', d)}" 58TUNECONFLICTS[v9.3] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2"
64TUNECONFLICTS[v9.4] := "${@microblaze_version_conflict('v9.4', d)}" 59TUNECONFLICTS[v9.4] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3"
65TUNECONFLICTS[v9.5] := "${@microblaze_version_conflict('v9.5', d)}" 60TUNECONFLICTS[v9.5] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4"
66TUNECONFLICTS[v9.6] := "${@microblaze_version_conflict('v9.6', d)}" 61TUNECONFLICTS[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"
67TUNECONFLICTS[v10.0] := "${@microblaze_version_conflict('v10.0', d)}" 62TUNECONFLICTS[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
70TUNECONFLICTS[v8.00] += "reorder"
71TUNECONFLICTS[v8.10] += "reorder"
72TUNECONFLICTS[v8.20] += "reorder"
73 63
74# Version flags 64# Version flags
75TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}" 65TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}"