Snitch Runtime
|
This file provides functions to program the Snitch DMA. More...
#include <math.h>
Go to the source code of this file.
Typedefs | |
typedef uint32_t | snrt_dma_txid_t |
A DMA transfer identifier. | |
Functions | |
void | snrt_dma_wait_all_channels (uint32_t num_channels) |
Block until the first num_channels channels are idle. | |
void | snrt_dma_start_tracking () |
Start tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed. | |
void | snrt_dma_stop_tracking () |
Stop tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed. | |
void | snrt_dma_memset (void *ptr, uint8_t value, uint32_t len) |
Fast memset function performed by DMA. | |
snrt_dma_txid_t | snrt_dma_load_1d_tile (volatile void *dst, volatile void *src, size_t tile_idx, size_t tile_size, uint32_t prec) |
Load a tile of a 1D array. | |
snrt_dma_txid_t | snrt_dma_mcast_load_1d_tile (void *dst, void *src, size_t tile_idx, size_t tile_size, uint32_t prec, uint32_t mcast) |
Load a tile of a 1D array. | |
snrt_dma_txid_t | snrt_dma_1d_to_2d (volatile void *dst, volatile void *src, size_t size, size_t row_size, size_t stride) |
Transfer and reshape a 1D array into a 2D array. | |
snrt_dma_txid_t | snrt_dma_2d_to_1d (volatile void *dst, volatile void *src, size_t size, size_t row_size, size_t stride) |
Transfer and reshape a 2D array into a 1D array. | |
snrt_dma_txid_t | snrt_dma_store_1d_tile (void *dst, void *src, size_t tile_idx, size_t tile_size, uint32_t prec) |
Store a tile to a 1D array. | |
snrt_dma_txid_t | snrt_dma_load_2d_tile (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec, size_t tile_ld) |
Load a 2D tile of a 2D array. | |
snrt_dma_txid_t | snrt_dma_load_2d_tile (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec) |
snrt_dma_txid_t | snrt_dma_load_2d_tile_in_banks (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec, size_t num_banks) |
Load a 2D tile of a 2D array and reshape it to occupy a subset of TCDM banks. | |
snrt_dma_txid_t | snrt_dma_store_2d_tile (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec, size_t tile_ld) |
Store a 2D tile to a 2D array. | |
snrt_dma_txid_t | snrt_dma_store_2d_tile (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec) |
snrt_dma_txid_t | snrt_dma_store_2d_tile_from_banks (void *dst, void *src, size_t tile_x1_idx, size_t tile_x0_idx, size_t tile_x1_size, size_t tile_x0_size, size_t full_x0_size, uint32_t prec, size_t num_banks) |
This file provides functions to program the Snitch DMA.
|
inline |
Transfer and reshape a 1D array into a 2D array.
dst | Pointer to the destination array. |
src | Pointer to the source array. |
size | Number of bytes to transfer. |
row_size | Size of a row in the 2D array, in bytes. |
stride | Stride between successive rows in the 2D array, in bytes. |
|
inline |
Transfer and reshape a 2D array into a 1D array.
dst | Pointer to the destination array. |
src | Pointer to the source array. |
size | Number of bytes to transfer. |
row_size | Size of a row in the 2D array, in bytes. |
stride | Stride between successive rows in the 2D array, in bytes. |
|
inline |
Load a tile of a 1D array.
dst | Pointer to the tile destination. |
src | Pointer to the source array. |
tile_idx | Index of the tile in the 1D array. |
tile_size | Number of elements within a tile of the 1D array. |
prec | Number of bytes of each element in the 1D array. |
|
inline |
Load a 2D tile of a 2D array.
dst | Pointer to the tile destination. |
src | Pointer to the source array. |
tile_x1_idx | Outermost coordinate of the tile in the 2D array. |
tile_x0_idx | Innermost coordinate of the tile in the 2D array. |
tile_x1_size | Number of elements in the outermost dimension of the tile. |
tile_x0_size | Number of elements in the innermost dimension of the tile. |
full_x0_size | Number of elements in the innermost dimension of the array. |
prec | Number of bytes of each element in the 2D array. |
tile_ld | Leading dimension of the tile, in bytes. |
|
inline |
Load a 2D tile of a 2D array and reshape it to occupy a subset of TCDM banks.
dst | Pointer to the tile destination. |
src | Pointer to the source array. |
tile_x1_idx | Outermost coordinate of the tile in the 2D array. |
tile_x0_idx | Innermost coordinate of the tile in the 2D array. |
tile_x1_size | Number of elements in the outermost dimension of the tile. |
tile_x0_size | Number of elements in the innermost dimension of the tile. |
full_x0_size | Number of elements in the innermost dimension of the array. |
prec | Number of bytes of each element in the 2D array. |
num_banks | Number of banks to reshape the tile into. |
|
inline |
Load a tile of a 1D array.
dst | Pointer to the tile destination. |
src | Pointer to the source array. |
tile_idx | Index of the tile in the 1D array. |
tile_size | Number of elements within a tile of the 1D array. |
prec | Number of bytes of each element in the 1D array. |
mcast | Multicast mask applied on the destination address. |
|
inline |
Fast memset function performed by DMA.
ptr | Pointer to the start of the region. |
value | Value to set. |
len | Number of bytes, must be a multiple of the DMA bus width. |
|
inline |
Start tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed.
|
inline |
Stop tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed.
|
inline |
Store a tile to a 1D array.
dst | Pointer to the destination array. |
src | Pointer to the source tile. |
tile_idx | Index of the tile in the 1D array. |
tile_size | Number of elements within a tile of the 1D array. |
prec | Number of bytes of each element in the 1D array. |
|
inline |
Store a 2D tile to a 2D array.
dst | Pointer to the destination array. |
src | Pointer to the source tile. |
tile_x1_idx | Outermost coordinate of the tile in the 2D array. |
tile_x0_idx | Innermost coordinate of the tile in the 2D array. |
tile_x1_size | Number of elements in the outermost dimension of the tile. |
tile_x0_size | Number of elements in the innermost dimension of the tile. |
full_x0_size | Number of elements in the innermost dimension of the array. |
prec | Number of bytes of each element in the 2D array. |
tile_ld | Leading dimension of the tile, in bytes. |
|
inline |
Block until the first num_channels
channels are idle.
num_channels | The number of channels to wait on. |