Skip to content

Commit 14401d8

Browse files
pamauryluismarques
authored andcommitted
[rom_ext] make sure that 64-bit division is not used
Check for the compiler-inserted 64-bit division symbols. Signed-off-by: Amaury Pouly <amaury.pouly@opentitan.org>
1 parent ced95fc commit 14401d8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • sw/device/silicon_creator/rom_ext

sw/device/silicon_creator/rom_ext/BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ load(
1818
)
1919
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
2020
load("//rules:signing.bzl", "signature_test")
21+
load("//rules:symbols.bzl", "check_elf_symbols_test")
2122

2223
package(default_visibility = ["//visibility:public"])
2324

@@ -358,6 +359,20 @@ ROM_EXT_FEATURES = [
358359
for slot in SLOTS
359360
]
360361

362+
# 64-bit division is forbidden in the ROM_EXT (or needs to use udiv64_slow)
363+
[
364+
check_elf_symbols_test(
365+
name = "rom_ext_{}_slot_{}_symbol_check".format(variation_name, slot),
366+
forbidden = [
367+
"__udivdi3",
368+
"__divdi3",
369+
],
370+
target = ":rom_ext_{}_slot_{}".format(variation_name, slot),
371+
)
372+
for variation_name, variation_deps in ROM_EXT_VARIATIONS.items()
373+
for slot in SLOTS
374+
]
375+
361376
[
362377
opentitan_binary(
363378
name = "rom_ext_{}".format(name),

0 commit comments

Comments
 (0)