File tree Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2021 ETH Zurich and University of Bologna.
1+ // Copyright 2025 ETH Zurich and University of Bologna.
22// Solderpad Hardware License, Version 0.51, see LICENSE for details.
33// SPDX-License-Identifier: SHL-0.51
44
55#include <tb _lib.hh >
66
77namespace sim {
88
9- const BootData BOOTDATA = {.boot_addr = ${hex(cfg[' cluster' ][' boot_addr' ])} ,
9+ // Allow other C sources to use BOOTDATA (ex. crt0s defined in other SDKs)
10+ extern " C" const BootData BOOTDATA = {.boot_addr = ${hex(cfg[' cluster' ][' boot_addr' ])} ,
1011 .core_count = ${ cfg[' cluster' ][' nr_cores' ]} ,
1112 .hartid_base = ${ cfg[' cluster' ][' cluster_base_hartid' ]} ,
1213 .tcdm_start = ${ hex(cfg[' cluster' ][' cluster_base_addr' ])} ,
Original file line number Diff line number Diff line change 1+ // Copyright 2025 ETH Zurich and University of Bologna.
2+ // Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+ // SPDX-License-Identifier: SHL-0.51
4+
5+ #pragma once
6+
7+ #include <inttypes.h>
8+
9+ struct BootData {
10+ uint32_t boot_addr ;
11+ uint32_t core_count ;
12+ uint32_t hartid_base ;
13+ uint32_t tcdm_start ;
14+ uint32_t tcdm_size ;
15+ uint32_t tcdm_offset ;
16+ uint64_t global_mem_start ;
17+ uint64_t global_mem_end ;
18+ uint32_t cluster_count ;
19+ uint32_t clint_base ;
20+ };
Original file line number Diff line number Diff line change 1414#include < unordered_map>
1515#include < vector>
1616
17+ #include " bootdata.h"
1718#include " ipc.hh"
1819
1920namespace sim {
Original file line number Diff line number Diff line change @@ -116,18 +116,6 @@ struct GlobalMemory {
116116extern GlobalMemory MEM;
117117
118118// The boot data generated along with the system RTL.
119- struct BootData {
120- uint32_t boot_addr;
121- uint32_t core_count;
122- uint32_t hartid_base;
123- uint32_t tcdm_start;
124- uint32_t tcdm_size;
125- uint32_t tcdm_offset;
126- uint64_t global_mem_start;
127- uint64_t global_mem_end;
128- uint32_t cluster_count;
129- uint32_t clint_base;
130- };
131- extern const BootData BOOTDATA;
119+ extern " C" const BootData BOOTDATA;
132120
133121} // namespace sim
You can’t perform that action at this time.
0 commit comments