Skip to content

Commit

Permalink
sw: Fix platform's bootdata struct
Browse files Browse the repository at this point in the history
  • Loading branch information
suehtamacv committed Nov 7, 2023
1 parent 5d81c8c commit 3833e19
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions sw/snRuntime/src/platforms/shared/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
extern const uint32_t _snrt_cluster_cluster_core_num;
extern const uint32_t _snrt_cluster_cluster_base_hartid;
extern const uint32_t _snrt_cluster_cluster_id;
void *const _snrt_cluster_global_offset = (void *)0x10000000;

const uint32_t snrt_stack_size __attribute__((weak, section(".rodata"))) = 10;

// The boot data generated along with the system RTL.
// See `ip/test/src/tb_lib.hh` for details.
struct snrt_cluster_bootdata {
uint32_t boot_addr;
uint32_t core_count;
uint32_t hartid_base;
uint32_t tcdm_start;
uint32_t tcdm_size;
uint32_t tcdm_offset;
uint64_t boot_addr;
uint64_t core_count;
uint64_t hartid_base;
uint64_t tcdm_start;
uint64_t tcdm_size;
uint64_t tcdm_offset;
uint64_t global_mem_start;
uint64_t global_mem_end;
};
Expand Down Expand Up @@ -51,8 +50,7 @@ void _snrt_init_team(uint32_t cluster_core_id, uint32_t cluster_core_num,
team->cluster_num = 0;
team->cluster_core_base_hartid = bootdata->hartid_base;
team->cluster_core_num = cluster_core_num;
team->global_mem.start =
(uint64_t)(bootdata->global_mem_start + _snrt_cluster_global_offset);
team->global_mem.start = (uint64_t)bootdata->global_mem_start;
team->global_mem.end = (uint64_t)bootdata->global_mem_end;
team->cluster_mem.start = (uint64_t)spm_start;
team->cluster_mem.end = (uint64_t)spm_start + bootdata->tcdm_size;
Expand Down

0 comments on commit 3833e19

Please sign in to comment.