Snitch Runtime
|
This file contains functions to conveniently program Snitch's SSRs. More...
Go to the source code of this file.
Enumerations | |
enum | snrt_ssr_dm { SNRT_SSR_DM0 = 0 , SNRT_SSR_DM1 = 1 , SNRT_SSR_DM2 = 2 , SNRT_SSR_DM_ALL = 31 } |
The different SSRs. More... | |
enum | snrt_ssr_dim { SNRT_SSR_1D = 0 , SNRT_SSR_2D = 1 , SNRT_SSR_3D = 2 , SNRT_SSR_4D = 3 } |
The different dimensions. More... | |
enum | { REG_STATUS = 0 , REG_REPEAT = 1 , REG_BOUNDS = 2 , REG_STRIDES = 6 , REG_RPTR = 24 , REG_WPTR = 28 } |
The SSR configuration registers. More... | |
Functions | |
void | snrt_fpu_fence () |
Synchronize the integer and float pipelines. | |
void | snrt_ssr_enable () |
Enable all SSRs. | |
void | snrt_ssr_disable () |
Disable all SSRs. | |
uint32_t | read_ssr_cfg (uint32_t reg, uint32_t dm) |
Read the value of an SSR configuration register. | |
void | write_ssr_cfg (uint32_t reg, uint32_t dm, uint32_t value) |
Write a value to an SSR configuration register. | |
void | snrt_ssr_loop_1d (enum snrt_ssr_dm dm, size_t b0, size_t s0) |
Configure an SSR data mover for a 1D loop nest. | |
void | snrt_ssr_loop_2d (enum snrt_ssr_dm dm, size_t b0, size_t b1, size_t s0, size_t s1) |
Configure an SSR data mover for a 2D loop nest. | |
void | snrt_ssr_loop_3d (enum snrt_ssr_dm dm, size_t b0, size_t b1, size_t b2, size_t s0, size_t s1, size_t s2) |
Configure an SSR data mover for a 3D loop nest. | |
void | snrt_ssr_loop_4d (enum snrt_ssr_dm dm, size_t b0, size_t b1, size_t b2, size_t b3, size_t s0, size_t s1, size_t s2, size_t s3) |
Configure an SSR data mover for a 4D loop nest. | |
void | snrt_ssr_repeat (enum snrt_ssr_dm dm, size_t count) |
Configure the repetition count for a stream. | |
void | snrt_ssr_read (enum snrt_ssr_dm dm, enum snrt_ssr_dim dim, volatile void *ptr) |
Start a streaming read. | |
void | snrt_ssr_write (enum snrt_ssr_dm dm, enum snrt_ssr_dim dim, volatile void *ptr) |
Start a streaming write. | |
This file contains functions to conveniently program Snitch's SSRs.
An SSR stream can be configured to replace a store (or load) sequence as could be generated by an N-dimensional affine loop nest:
The configuration functions provided in this file reflect the parameters one would define to set up such a loop nest.
anonymous enum |
enum snrt_ssr_dim |
enum snrt_ssr_dm |
|
inline |
Read the value of an SSR configuration register.
reg | The register index. |
dm | The SSR index. |
|
inline |
Configure an SSR data mover for a 1D loop nest.
dm | The SSR index. |
b0 | The bound of the loop. |
s0 | The stride of the loop. |
|
inline |
Configure an SSR data mover for a 2D loop nest.
dm | The SSR index. |
b0 | The bound of the first loop. |
b1 | The bound of the second loop. |
s0 | The stride of the first loop. |
s1 | The stride of the second loop. |
|
inline |
Configure an SSR data mover for a 3D loop nest.
dm | The SSR index. |
b0 | The bound of the first loop. |
b1 | The bound of the second loop. |
b2 | The bound of the third loop. |
s0 | The stride of the first loop. |
s1 | The stride of the second loop. |
s2 | The stride of the third loop. |
|
inline |
Configure an SSR data mover for a 4D loop nest.
dm | The SSR index. |
b0 | The bound of the first loop. |
b1 | The bound of the second loop. |
b2 | The bound of the third loop. |
b3 | The bound of the fourth loop. |
s0 | The stride of the first loop. |
s1 | The stride of the second loop. |
s2 | The stride of the third loop. |
s3 | The stride of the fourth loop. |
|
inline |
Start a streaming read.
dm | The SSR index. |
dim | The number of dimensions to use. |
ptr | The pointer to the data. |
|
inline |
Configure the repetition count for a stream.
dm | The SSR index. |
count | The repetition count. |
|
inline |
Start a streaming write.
dm | The SSR index. |
dim | The number of dimensions to use. |
ptr | The pointer to the data. |
|
inline |
Write a value to an SSR configuration register.
reg | The register index. |
dm | The SSR index. |
value | The value to write. |