| /* |
| * 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. |
| */ |
| |
| |
| #include <stdint.h> |
| #include <string.h> |
| |
| #include "hw/top_matcha/sw/autogen/top_matcha.h" |
| #include "sw/device/examples/hello_world_multicore/hello_world_multicore_sc_loaders.h" |
| #include "sw/device/examples/hello_world_multicore/hello_world_multicore_smc_fpga_nexus_bin_c.h" // Generated. |
| #include "sw/device/lib/base/mmio.h" |
| #include "sw/device/tests/kelvin/kelvin_hello_world_bin.h" // Generated. |
| |
| void load_smc(void) { |
| memcpy((void *)TOP_MATCHA_RAM_SMC_BASE_ADDR, |
| hello_world_multicore_smc_fpga_nexus_bin, |
| hello_world_multicore_smc_fpga_nexus_bin_len); |
| } |
| |
| void load_kelvin(void) { |
| mmio_region_t ml_dmem = |
| mmio_region_from_addr(TOP_MATCHA_ML_TOP_DMEM_BASE_ADDR); |
| uint32_t *kelvin_hello_world_bin_uint32 = (uint32_t *)kelvin_hello_world_bin; |
| for (int i = 0; i < kelvin_hello_world_bin_len / sizeof(uint32_t); ++i) { |
| mmio_region_write32(ml_dmem, i * sizeof(uint32_t), |
| kelvin_hello_world_bin_uint32[i]); |
| } |
| } |
| |
| void load_init(void) {} |