TT Zephyr Platforms 19.6.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
tensix_init.c File Reference

Macros

#define ARC_NOC0_X   8
#define ARC_NOC0_Y   0
#define TENSIX_X_START   2
#define TENSIX_Y_START   2
#define TENSIX_X_END   1
#define TENSIX_Y_END   11
#define TENSIX_L1_SIZE   (1536 * 1024)
#define TRISC0_RESET_PC   0xFFB12228
#define TRISC_RESET_PC_OVERRIDE   0xFFB12234
#define SOFT_RESET_0   0xFFB121B0
#define ALL_RISC_SOFT_RESET   0x47800
#define TRISC_WIPE_FW_TAG   "destwipe"
#define TRISC_WIPE_FW_LOAD_ADDR   0x6000 /* TRISC0_CODE region start */
#define SCRATCHPAD_SIZE   CONFIG_TT_BH_ARC_SCRATCHPAD_SIZE
#define COUNTER_TENSIX_X   1
#define COUNTER_TENSIX_Y   2
#define COUNTER_L1_ADDR   0x110000 /* Must match firmware hardcoded value */
#define NUM_TENSIX_ROWS   10
#define WIPE_DEST_TIMEOUT_US   10000 /* 10ms timeout */

Functions

 LOG_MODULE_REGISTER (tensix_init, CONFIG_TT_APP_LOG_LEVEL)
static void EnableTensixCG (void)
static void wipe_l1 (void)
 Zeros the l1 of every non-harvested tensix core.
static int global_sync (uint8_t ring, uint8_t noc_tlb, uint32_t expected_count)
 Global synchronization for wipe_dest.
static int noc2axi_write32_fw (const uint8_t *src, uint8_t *dst, size_t len)
 Helper function to write 32-bit words to NOC.
static void setup_tensix_mcast_tlb (uint8_t ring, uint8_t noc_tlb, uint32_t addr)
 Setup the multicast TLB for the unharvested tensix cores.
static int wipe_dest (void)
 Zeros the DEST register of every non-harvested tensix core.
void TensixInit (void)
static int tensix_init (void)
 SYS_INIT_APP (tensix_init)

Variables

static const struct device *const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static const struct device *const dma_noc = DEVICE_DT_GET(DT_NODELABEL(dma1))
static const struct device *const flash = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(spi_flash))

Macro Definition Documentation

◆ ALL_RISC_SOFT_RESET

#define ALL_RISC_SOFT_RESET   0x47800

◆ ARC_NOC0_X

#define ARC_NOC0_X   8

◆ ARC_NOC0_Y

#define ARC_NOC0_Y   0

◆ COUNTER_L1_ADDR

#define COUNTER_L1_ADDR   0x110000 /* Must match firmware hardcoded value */

◆ COUNTER_TENSIX_X

#define COUNTER_TENSIX_X   1

◆ COUNTER_TENSIX_Y

#define COUNTER_TENSIX_Y   2

◆ NUM_TENSIX_ROWS

#define NUM_TENSIX_ROWS   10

◆ SCRATCHPAD_SIZE

#define SCRATCHPAD_SIZE   CONFIG_TT_BH_ARC_SCRATCHPAD_SIZE

◆ SOFT_RESET_0

#define SOFT_RESET_0   0xFFB121B0

◆ TENSIX_L1_SIZE

#define TENSIX_L1_SIZE   (1536 * 1024)

◆ TENSIX_X_END

#define TENSIX_X_END   1

◆ TENSIX_X_START

#define TENSIX_X_START   2

◆ TENSIX_Y_END

#define TENSIX_Y_END   11

◆ TENSIX_Y_START

#define TENSIX_Y_START   2

◆ TRISC0_RESET_PC

#define TRISC0_RESET_PC   0xFFB12228

◆ TRISC_RESET_PC_OVERRIDE

#define TRISC_RESET_PC_OVERRIDE   0xFFB12234

◆ TRISC_WIPE_FW_LOAD_ADDR

#define TRISC_WIPE_FW_LOAD_ADDR   0x6000 /* TRISC0_CODE region start */

◆ TRISC_WIPE_FW_TAG

#define TRISC_WIPE_FW_TAG   "destwipe"

◆ WIPE_DEST_TIMEOUT_US

#define WIPE_DEST_TIMEOUT_US   10000 /* 10ms timeout */

Function Documentation

◆ EnableTensixCG()

void EnableTensixCG ( void )
static

◆ global_sync()

int global_sync ( uint8_t ring,
uint8_t noc_tlb,
uint32_t expected_count )
static

Global synchronization for wipe_dest.

This function is used to synchronize the wipe_dest operation across all tensix cores. It reads the counter from the chosen tensix core and waits for it to reach the expected count. It returns 0 if the counter reached the expected count, -ETIMEDOUT otherwise.

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( tensix_init ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ noc2axi_write32_fw()

int noc2axi_write32_fw ( const uint8_t * src,
uint8_t * dst,
size_t len )
static

Helper function to write 32-bit words to NOC.

This function is used to write 32-bit words to NOC using DMA.

◆ setup_tensix_mcast_tlb()

void setup_tensix_mcast_tlb ( uint8_t ring,
uint8_t noc_tlb,
uint32_t addr )
inlinestatic

Setup the multicast TLB for the unharvested tensix cores.

Parameters
ringThe ring to use for the multicast TLB
noc_tlbThe TLB number to use for the multicast TLB
addrThe address to load the firmware to

◆ SYS_INIT_APP()

SYS_INIT_APP ( tensix_init )

◆ tensix_init()

int tensix_init ( void )
static

◆ TensixInit()

void TensixInit ( void )

◆ wipe_dest()

int wipe_dest ( void )
static

Zeros the DEST register of every non-harvested tensix core.

The DEST register can only be written by code running on the local TRISC. This function loads a wipe firmware from SPI flash to each Tensix's L1, runs it on TRISC 0 to clear DEST using 32-bit stores, then puts TRISC 0 back in reset.

◆ wipe_l1()

void wipe_l1 ( void )
static

Zeros the l1 of every non-harvested tensix core.

First zero the l1 of an arbitrary non-harvested tensix core, then broadcasts the zero'd l1 to all other non-harvested tensix cores. This approach is faster than iterating over all tensix cores sequentially to clear each l1.

Variable Documentation

◆ dma_noc

const struct device* const dma_noc = DEVICE_DT_GET(DT_NODELABEL(dma1))
static

◆ flash

const struct device* const flash = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(spi_flash))
static

◆ fwtable_dev

const struct device* const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static