--
-- Copyright 2023 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

set_project("CHERIoT soundstream demo")

local shodan_dir = os.getenv("ROOTDIR")
if shodan_dir == nil or shodan_dir == '' then
  raise("ROOTDIR not set")
end
local cheriot_out_dir = os.getenv("CHERIOT_OUT_DIR")
if cheriot_out_dir == nil or cheriot_out_dir == '' then
  raise("CHERIOT_OUT_DIR not set")
end

local sdkdir = path.join(shodan_dir, "sw/cheriot-rtos/sdk")
includes(sdkdir)
set_toolchains("cheriot-clang")

option("board")
    set_default("sencha")

local matcha_dir = path.join(shodan_dir, "hw/matcha")
local dif_dir = path.join(matcha_dir, "sw/device/lib/dif")
local dif_autogen_dir = path.join(dif_dir, "autogen")
local opentitan_dir = path.join(shodan_dir, "hw/opentitan-upstream")
local matcha_gen_dir = path.join(cheriot_out_dir, "opentitan-gen/include/opentitan")

-- Support libraries
includes(path.join(sdkdir, "lib"))
includes(path.join(sdkdir, "lib/freestanding"))

-- Each driver operates in a compartment.
compartment("i2s")
    add_files("i2s.cc")
    add_files(path.join(dif_dir, "dif_i2s.c"),
              path.join(dif_autogen_dir, "dif_i2s_autogen.c"))
    add_includedirs(matcha_dir, matcha_gen_dir, opentitan_dir)
    add_defines("CHERIOT_NO_AMBIENT_MALLOC")

compartment("mailbox")
    add_files("mailbox.cc")
    add_files(path.join(dif_dir, "dif_tlul_mailbox.c"),
              path.join(dif_autogen_dir, "dif_tlul_mailbox_autogen.c"))
    add_includedirs(matcha_dir, matcha_gen_dir, opentitan_dir)
    add_defines("CHERIOT_NO_AMBIENT_MALLOC")

compartment("ml_top")
    add_files("ml_top.cc")
    add_files(path.join(dif_dir, "dif_ml_top.c"),
              path.join(dif_autogen_dir, "dif_ml_top_autogen.c"))
    add_includedirs(matcha_dir, matcha_gen_dir, opentitan_dir)
    add_defines("CHERIOT_NO_AMBIENT_MALLOC")

-- Soundstream application.
compartment("soundstream")
    add_files("soundstream.cc", "encode.cc")
    add_files(path.join(matcha_dir, "hw/top_matcha/sw/autogen/top_matcha.c"));
    add_includedirs(matcha_dir, matcha_gen_dir, opentitan_dir)

-- Firmware image.
firmware("soundstream-firmware")
    add_deps("freestanding")
    add_deps("debug", "i2s", "ml_top", "mailbox", "soundstream")
    on_load(function(target)
        target:values_set("board", "$(board)")
        -- NB: trusted_stack_frames is a guess; +1'd for any
        --     compartment error handler usage?
        target:values_set("threads", {
            {
                compartment = "soundstream",
                priority = 1,
                entry_point = "entry",
                stack_size = 0x1000, -- 4KB
                trusted_stack_frames = 5
            },
            -- NB: stack sizes bumped for logging
            {
                compartment = "i2s",
                priority = 1,
                entry_point = "i2s_isr",
                stack_size = 0x400, -- 512B
                trusted_stack_frames = 3
            },
            {
                compartment = "ml_top",
                priority = 1,
                entry_point = "ml_top_isr",
                stack_size = 0x400, -- 512B
                trusted_stack_frames = 3
            },
            {
                compartment = "mailbox",
                priority = 1,
                entry_point = "mailbox_isr",
                stack_size = 0x400, -- 512B
                trusted_stack_frames = 3
            }
        }, {expand = false})
    end)
