1# MicroBlaze architecture tune feature configuration
2
3# Architecture feature and override
4TUNEVALID[microblaze] = "MicroBlaze"
5MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "microblaze", "microblaze:", "", d)}"
6
7# 64-bit
8TUNEVALID[64-bit] = "64-bit MicroBlaze"
9TUNECONFLICTS[64-bit] = "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 v10.0"
10MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "64-bit", "microblaze64:", "", d)}"
11
12# Endian
13TUNEVALID[bigendian] = "Use Microblaze Big Endian"
14TUNECONFLICTS[bigendian] = "v10.0"
15
16MBPKGARCH_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "eb", "el", d)}"
17
18TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}"
19
20# General features
21TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter"
22TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions"
23TUNEVALID[reorder] = "Enable Reorder Instructions"
24TUNECONFLICTS[reorder] = "v8.00 v8.10 v8.20"
25
26# Core configuration tune optimizations
27TUNEVALID[frequency-optimized] = "Enabling tuning for frequency optimized core (AREA_OPTIMIZED_2)"
28TUNECONFLICTS[frequency-optimized] = "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"
29
30# Feature compiler args
31TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", " -mxl-barrel-shift", " -mno-xl-barrel-shift", d)}"
32TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "pattern-compare", " -mxl-pattern-compare", " -mno-xl-pattern-compare", d)}"
33TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "frequency-optimized", " -mxl-frequency", "", d)}"
34TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "64-bit", " -m64", "", d)}"
35
36# Disable reorder for v8.30 if pattern-compare is not enabled
37TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "reorder", \
38        bb.utils.contains("TUNE_FEATURES", "v8.30", \
39            bb.utils.contains("TUNE_FEATURES", "pattern-compare", \
40                " -mxl-reorder", " -mno-xl-reorder", d), \
41            " -mxl-reorder", d), " -mno-xl-reorder", d)}"
42
43# Feature package architecture formatting
44MBPKGARCH_TUNE = ""
45MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-bs", "", d)}"
46MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "pattern-compare", "-cmp", "", d)}"
47MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "reorder", "-re", "", d)}"
48MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "frequency-optimized", "-fo", "", d)}"
49
50# Additional features
51require conf/machine/include/microblaze/feature-microblaze-versions.inc
52require conf/machine/include/microblaze/feature-microblaze-math.inc
53
54# Architecture name, either 'microblaze' or 'microblazeel' depending on endianess
55TUNE_ARCH = "microblaze${@bb.utils.contains("TUNE_FEATURES", "bigendian", "", "el", d)}"
56
57# Add 64-bit to the PKGARCH if enabled.
58MBPKGARCH_SIZE = "${@bb.utils.contains("TUNE_FEATURES", "64-bit", "64", "", d)}"
59
60# Package Architecture formatting
61TUNE_PKGARCH = "microblaze${MBPKGARCH_SIZE}${MBPKGARCH_ENDIAN}${MBPKGARCH_VERSION}${MBPKGARCH_TUNE}${MBPKGARCH_MATH}"
62
63