Skip to content

Commit

Permalink
#0: Undo uninit, fixes N300 hang
Browse files Browse the repository at this point in the history
  • Loading branch information
spoojaryTT committed Dec 9, 2024
1 parent ba4dbdf commit 755ef9b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 28 deletions.
8 changes: 4 additions & 4 deletions tt_metal/hw/firmware/src/brisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ uint32_t tt_l1_ptr *sem_l1_base[ProgrammableCoreType::COUNT] __attribute__((used

// These arrays are stored in local memory of FW, but primarily used by the kernel which shares
// FW symbols. Hence mark these as 'used' so that FW compiler doesn't optimize it out.
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((section(".uninit"), used));
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((used));

#define MEM_MOVER_VIEW_IRAM_BASE_ADDR (0x4 << 12)

Expand Down
8 changes: 4 additions & 4 deletions tt_metal/hw/firmware/src/erisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ uint32_t tt_l1_ptr *sem_l1_base[ProgrammableCoreType::COUNT] __attribute__((used

// These arrays are stored in local memory of FW, but primarily used by the kernel which shares
// FW symbols. Hence mark these as 'used' so that FW compiler doesn't optimize it out.
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((section(".uninit"), used));
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((used));

void __attribute__((noinline)) Application(void) {
WAYPOINT("I");
Expand Down
8 changes: 4 additions & 4 deletions tt_metal/hw/firmware/src/idle_erisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ uint8_t my_y[NUM_NOCS] __attribute__((used));

// These arrays are stored in local memory of FW, but primarily used by the kernel which shares
// FW symbols. Hence mark these as 'used' so that FW compiler doesn't optimize it out.
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((section(".uninit"), used));
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((used));

//c_tensix_core core;

Expand Down
8 changes: 4 additions & 4 deletions tt_metal/hw/firmware/src/ncrisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ uint32_t tt_l1_ptr *sem_l1_base[ProgrammableCoreType::COUNT] __attribute__((used

// These arrays are stored in local memory of FW, but primarily used by the kernel which shares
// FW symbols. Hence mark these as 'used' so that FW compiler doesn't optimize it out.
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((section(".uninit"), used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((section(".uninit"), used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((section(".uninit"), used));
uint16_t dram_bank_to_noc_xy[NUM_NOCS][NUM_DRAM_BANKS] __attribute__((used));
int32_t bank_to_dram_offset[NUM_DRAM_BANKS] __attribute__((used));
uint16_t l1_bank_to_noc_xy[NUM_NOCS][NUM_L1_BANKS] __attribute__((used));
int32_t bank_to_l1_offset[NUM_L1_BANKS] __attribute__((used));

#if defined(PROFILE_KERNEL)
namespace kernel_profiler {
Expand Down
4 changes: 0 additions & 4 deletions tt_metal/hw/toolchain/erisc-b0-app-sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ SECTIONS
. = ALIGN(4);
__ldm_bss_end = .;
} > REGION_APP_DATA :data
/* Place uninitialized variables here, so we don't zero them out. */
.uninit : {
*(.uninit)
} > REGION_APP_DATA :data

.riscv.attributes 0 : { *(.riscv.attributes) } :attributes

Expand Down
4 changes: 0 additions & 4 deletions tt_metal/hw/toolchain/erisc-b0-kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ SECTIONS
. = ALIGN(4);
__ldm_bss_end = .;
} > REGION_APP_KERNEL_DATA :data
/* Place uninitialized variables here, so we don't zero them out. */
.uninit : {
*(.uninit)
} > REGION_APP_KERNEL_DATA :data

.riscv.attributes 0 : { *(.riscv.attributes) } :attributes

Expand Down
4 changes: 0 additions & 4 deletions tt_metal/hw/toolchain/sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ SECTIONS
. = ALIGN(4);
__ldm_bss_end = .;
} > REGION_DATA :data
/* Place uninitialized variables here, so we don't zero them out. */
.uninit : {
*(.uninit)
} > REGION_DATA :data

#ifdef TYPE_FIRMWARE
. = ALIGN(MEM_ALIGN);
Expand Down

0 comments on commit 755ef9b

Please sign in to comment.