| #include "sw/device/tests/kelvin/hps-c-port/sw/init/kelvin.h" |
| #include "sw/device/tests/kelvin/hps-c-port/model/inc/model.h" |
| #include "sw/device/tests/kelvin/hps-c-port/ml_input.h" |
| |
| constexpr int kImageLen = 240 * 320; |
| |
| constexpr uint32_t kCommand = 0x3FF000; // +4.0MB - 4KB |
| |
| struct command_t { |
| uint32_t input_addr; |
| uint32_t output_addr; |
| uint32_t padding[1024 - 2]; |
| }; |
| static_assert(sizeof(command_t) == 4096); |
| |
| static int8_t input_[kImageLen] __aligned__ __noinit__; |
| |
| int main(void) { |
| const command_t *command = reinterpret_cast<const command_t*>(kCommand); |
| const uint8_t *image = reinterpret_cast<const uint8_t*>(command->input_addr); |
| int8_t *output = reinterpret_cast<int8_t*>(command->output_addr); |
| |
| ml_input(kImageLen, image, input_); |
| model(input_, output); |
| flushat(output); |
| |
| return 0; |
| } |