TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
|
#include <stdint.h>
#include <stdbool.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>
#include "noc.h"
#include "noc2axi.h"
#include "util.h"
Data Structures | |
struct | ret_addr_hi |
union | ret_addr_hi_u |
Macros | |
#define | NOC_DMA_TLB 0 |
#define | NOC_DMA_NOC_ID 0 |
#define | NOC_DMA_TIMEOUT_MS 100 |
#define | NOC_MAX_BURST_SIZE 16384 |
#define | NOC_CMD_CPY (0 << 0) |
#define | NOC_CMD_RD (0 << 1) |
#define | NOC_CMD_WR (1 << 1) |
#define | NOC_CMD_RESP_MARKED (1 << 4) |
#define | NOC_CMD_BRCST_PACKET (1 << 5) |
#define | NOC_CMD_PATH_RESERVE (1 << 8) |
#define | NOC_CMD_BRCST_SRC_INCLUDE (1 << 17) |
#define | TARGET_ADDR_LO 0xFFB20000 |
#define | TARGET_ADDR_MID 0xFFB20004 |
#define | TARGET_ADDR_HI 0xFFB20008 |
#define | RET_ADDR_LO 0xFFB2000C |
#define | RET_ADDR_MID 0xFFB20010 |
#define | RET_ADDR_HI 0xFFB20014 |
#define | PACKET_TAG 0xFFB20018 |
#define | CMD_BRCST 0xFFB2001C |
#define | AT_LEN 0xFFB20020 |
#define | AT_LEN_1 0xFFB20024 |
#define | AT_DATA 0xFFB20028 |
#define | BRCST_EXCLUDE 0xFFB2002C |
#define | CMD_CTRL 0xFFB20040 |
#define | NIU_MST_WR_ACK_RECEIVED 0xFFB20204 |
#define | NIU_MST_RD_RESP_RECEIVED 0xFFB20208 |
Functions | |
static void | program_noc_dma_tlb (uint8_t x, uint8_t y) |
static void | write_noc_dma_config (uint32_t addr, uint32_t value) |
static uint32_t | read_noc_dma_config (uint32_t addr) |
static bool | noc_wait_cmd_ready (void) |
static uint32_t | get_expected_acks (uint32_t noc_cmd, uint64_t size) |
static bool | is_behind (uint32_t current, uint32_t target) |
static bool | wait_noc_dma_done (uint32_t noc_cmd, uint32_t expected_acks) |
static uint32_t | noc_dma_format_coord (uint8_t x, uint8_t y) |
static uint32_t | noc_dma_format_multicast (uint8_t start_x, uint8_t start_y, uint8_t end_x, uint8_t end_y) |
static bool | noc_dma_transfer (uint32_t cmd, uint32_t ret_coord, uint64_t ret_addr, uint32_t targ_coord, uint64_t targ_addr, uint32_t size, bool multicast, uint8_t transaction_id, bool include_self, bool wait_for_done) |
bool | noc_dma_read (uint8_t local_x, uint8_t local_y, uint64_t local_addr, uint8_t remote_x, uint8_t remote_y, uint64_t remote_addr, uint32_t size, bool wait_for_done) |
bool | noc_dma_write (uint8_t local_x, uint8_t local_y, uint64_t local_addr, uint8_t remote_x, uint8_t remote_y, uint64_t remote_addr, uint32_t size, bool wait_for_done) |
static bool | noc_dma_write_multicast (uint8_t local_x, uint8_t local_y, uint64_t local_addr, uint8_t remote_start_x, uint8_t remote_start_y, uint8_t remote_end_x, uint8_t remote_end_y, uint64_t remote_addr, uint32_t size, bool include_self) |
bool | noc_dma_broadcast (uint8_t local_x, uint8_t local_y, uint64_t addr, uint32_t size) |
#define AT_DATA 0xFFB20028 |
#define AT_LEN 0xFFB20020 |
#define AT_LEN_1 0xFFB20024 |
#define BRCST_EXCLUDE 0xFFB2002C |
#define CMD_BRCST 0xFFB2001C |
#define CMD_CTRL 0xFFB20040 |
#define NIU_MST_RD_RESP_RECEIVED 0xFFB20208 |
#define NIU_MST_WR_ACK_RECEIVED 0xFFB20204 |
#define NOC_CMD_BRCST_PACKET (1 << 5) |
#define NOC_CMD_BRCST_SRC_INCLUDE (1 << 17) |
#define NOC_CMD_CPY (0 << 0) |
#define NOC_CMD_PATH_RESERVE (1 << 8) |
#define NOC_CMD_RD (0 << 1) |
#define NOC_CMD_RESP_MARKED (1 << 4) |
#define NOC_CMD_WR (1 << 1) |
#define NOC_DMA_NOC_ID 0 |
#define NOC_DMA_TIMEOUT_MS 100 |
#define NOC_DMA_TLB 0 |
#define NOC_MAX_BURST_SIZE 16384 |
#define PACKET_TAG 0xFFB20018 |
#define RET_ADDR_HI 0xFFB20014 |
#define RET_ADDR_LO 0xFFB2000C |
#define RET_ADDR_MID 0xFFB20010 |
#define TARGET_ADDR_HI 0xFFB20008 |
#define TARGET_ADDR_LO 0xFFB20000 |
#define TARGET_ADDR_MID 0xFFB20004 |
|
static |
bool noc_dma_read | ( | uint8_t | local_x, |
uint8_t | local_y, | ||
uint64_t | local_addr, | ||
uint8_t | remote_x, | ||
uint8_t | remote_y, | ||
uint64_t | remote_addr, | ||
uint32_t | size, | ||
bool | wait_for_done ) |
|
static |
bool noc_dma_write | ( | uint8_t | local_x, |
uint8_t | local_y, | ||
uint64_t | local_addr, | ||
uint8_t | remote_x, | ||
uint8_t | remote_y, | ||
uint64_t | remote_addr, | ||
uint32_t | size, | ||
bool | wait_for_done ) |
|
static |
|
static |