Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platforms: Add cortex-m33 platforms #69

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion devices/arm/cortex_m.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,18 @@ CORTEX_M7_FPU_DEVICE_CONFIG = device_config(
fpu = "fpv5-d16",
)

CORTEX_M_DEVICE_CONFIGS = [CORTEX_M0_DEVICE_CONFIG, CORTEX_M3_DEVICE_CONFIG, CORTEX_M4_FPU_DEVICE_CONFIG, CORTEX_M4_DEVICE_CONFIG, CORTEX_M7_FPU_DEVICE_CONFIG]
CORTEX_M33_DEVICE_CONFIG = device_config(
cpu = "armv8-m",
endian = "little",
float_abi = "soft",
fpu = "none",
)

CORTEX_M33_FPU_DEVICE_CONFIG = device_config(
cpu = "armv8-m",
endian = "little",
float_abi = "hard",
fpu = "fpv5-d16",
)

CORTEX_M_DEVICE_CONFIGS = [CORTEX_M0_DEVICE_CONFIG, CORTEX_M3_DEVICE_CONFIG, CORTEX_M4_FPU_DEVICE_CONFIG, CORTEX_M4_DEVICE_CONFIG, CORTEX_M7_FPU_DEVICE_CONFIG, CORTEX_M33_DEVICE_CONFIG, CORTEX_M33_FPU_DEVICE_CONFIG]
23 changes: 23 additions & 0 deletions platforms/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ platform(
parents = [":cortex_m"],
)

platform(
name = "cortex_m33",
constraint_values = [
"@platforms//cpu:armv8-m",
],
exec_properties = {
"EXECUTOR": "cortex_m33"
},
parents = [":cortex_m3"]
)

platform(
name = "cortex_m33_fpu",
constraint_values = [
"@platforms//cpu:armv8-m",
"@bazel_embedded//constraints/fpu:fpv5-d16",
],
exec_properties = {
"EXECUTOR": "cortex_m33_fpu"
},
parents = [":cortex_m3"]
)

platform(
name = "stm32f2xx",
parents = [":cortex_m3"],
Expand Down
6 changes: 6 additions & 0 deletions toolchains/features/common/impl/gcc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def GccIncludeFeature(include_paths):
def GccAchitectureFeature(architecture, float_abi, endian, fpu):
if fpu == "none":
fpu = "auto"

# @platforms//cpu has armv8-m entry intended to match cortex m23, m33, m35p
# processors which all have the main instruction set. GCC needs this
# explicitly set when using arch flag.
if architecture == "armv8-m":
architecture = "armv8-m.main"
_ARCHITECTURE_FEATURE = feature(
name = "architecture",
enabled = True,
Expand Down
1 change: 1 addition & 0 deletions toolchains/gcc_arm_none_eabi/gcc_arm_none_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ gcc_arm_none_toolchain_config = rule(
"armv6s-m",
"armv7-m",
"armv7e-m",
"armv8-m",
"armv8-m.base",
"armv8-m.main",
"iwmmxt",
Expand Down