blob: bbf6e78fc5a8e98fe66b4724cdc58a319f1ff1fb [file] [log] [blame]
-- Copyright Microsoft and CHERIoT Contributors.
-- SPDX-License-Identifier: MIT
set_project("CHERIoT cross-compartment benchmark");
sdkdir = "../../sdk"
includes(sdkdir)
set_toolchains("cheriot-clang")
-- Support libraries
includes(path.join(sdkdir, "lib/freestanding"),
path.join(sdkdir, "lib/atomic"),
path.join(sdkdir, "lib/crt"))
option("board")
set_default("sail")
debugOption("allocbench");
compartment("allocbench")
-- Allow allocating an effectively unbounded amount of memory (more than exists)
add_rules("cherimcu.component-debug")
add_defines("MALLOC_QUOTA=1000000")
add_defines("BOARD=" .. tostring(get_config("board")))
add_files("alloc.cc")
-- Firmware image for the example.
firmware("allocator-benchmark")
add_deps("crt", "freestanding", "atomic")
add_deps("allocbench")
on_load(function(target)
target:values_set("board", "$(board)")
target:values_set("threads", {
{
compartment = "allocbench",
priority = 1,
entry_point = "run",
stack_size = 0x300,
trusted_stack_frames = 4
},
}, {expand = false})
end)