Snitch Runtime
Loading...
Searching...
No Matches
team.h File Reference

This file contains functions and macros related to Snitch team management. More...

Go to the source code of this file.

Functions

uint32_t snrt_hartid ()
 Get the RISC-V hardware thread ID (hartid).
 
uint32_t snrt_cluster_num ()
 Get the number of Snitch clusters in the system.
 
uint32_t snrt_cluster_core_num ()
 Get the number of cores per cluster.
 
uint32_t snrt_global_core_base_hartid ()
 Get the hartid of the first Snitch core in the system.
 
uint32_t snrt_global_core_num ()
 Get the total number of Snitch cores in the system.
 
uint32_t snrt_global_compute_core_num ()
 Get the total number of Snitch compute cores in the system.
 
uint32_t snrt_global_core_idx ()
 Get the index (!= hartid) of the current Snitch core in the system.
 
uint32_t snrt_global_compute_core_idx ()
 Get the index of the current Snitch compute core in the system.
 
uint32_t snrt_cluster_idx ()
 Get the index of the current Snitch cluster in the system.
 
uint32_t snrt_cluster_core_idx ()
 Get the index of the current Snitch core within the cluster.
 
uint32_t snrt_cluster_dm_core_num ()
 Get the number of data mover (DM) cores per cluster.
 
uint32_t snrt_cluster_compute_core_num ()
 Get the number of compute cores per cluster.
 
int snrt_is_compute_core ()
 Check if the current core is a compute core.
 
int snrt_cluster_is_last_compute_core ()
 Check if the current core is the last compute core in the cluster.
 
int snrt_is_dm_core ()
 Check if the current core is a data mover (DM) core.
 

Detailed Description

This file contains functions and macros related to Snitch team management.

The functions in this file provide information about the Snitch hardware configuration, such as the number of clusters, cores per cluster, and the current core's index within the system. These functions can be used for team management and core-specific operations.

Function Documentation

◆ snrt_cluster_compute_core_num()

uint32_t snrt_cluster_compute_core_num ( )
inline

Get the number of compute cores per cluster.

Returns
The number of compute cores per cluster.
125 {
127}
uint32_t snrt_cluster_dm_core_num()
Get the number of data mover (DM) cores per cluster.
Definition team.h:116
uint32_t snrt_cluster_core_num()
Get the number of cores per cluster.
Definition team.h:43

◆ snrt_cluster_core_idx()

uint32_t snrt_cluster_core_idx ( )
inline

Get the index of the current Snitch core within the cluster.

Returns
The index of the current core within the cluster.
107 {
109}
uint32_t snrt_global_core_idx()
Get the index (!= hartid) of the current Snitch core in the system.
Definition team.h:79

◆ snrt_cluster_core_num()

uint32_t snrt_cluster_core_num ( )
inline

Get the number of cores per cluster.

Returns
The number of cores per cluster.
43 {
44 return SNRT_CLUSTER_CORE_NUM;
45}

◆ snrt_cluster_dm_core_num()

uint32_t snrt_cluster_dm_core_num ( )
inline

Get the number of data mover (DM) cores per cluster.

Returns
The number of DM cores per cluster.
116 {
117 return SNRT_CLUSTER_DM_CORE_NUM;
118}

◆ snrt_cluster_idx()

uint32_t snrt_cluster_idx ( )
inline

Get the index of the current Snitch cluster in the system.

Returns
The index of the current cluster.
98 {
100}

◆ snrt_cluster_is_last_compute_core()

int snrt_cluster_is_last_compute_core ( )
inline

Check if the current core is the last compute core in the cluster.

Returns
True if the current core is the last compute core, false otherwise.
143 {
145}
uint32_t snrt_cluster_core_idx()
Get the index of the current Snitch core within the cluster.
Definition team.h:107
uint32_t snrt_cluster_compute_core_num()
Get the number of compute cores per cluster.
Definition team.h:125

◆ snrt_cluster_num()

uint32_t snrt_cluster_num ( )
inline

Get the number of Snitch clusters in the system.

Returns
The number of clusters.
34 {
35 return SNRT_CLUSTER_NUM;
36}

◆ snrt_global_compute_core_idx()

uint32_t snrt_global_compute_core_idx ( )
inline

Get the index of the current Snitch compute core in the system.

Returns
The index of the current Snitch compute core.
88 {
91}
uint32_t snrt_cluster_idx()
Get the index of the current Snitch cluster in the system.
Definition team.h:98

◆ snrt_global_compute_core_num()

uint32_t snrt_global_compute_core_num ( )
inline

Get the total number of Snitch compute cores in the system.

Returns
The total number of compute cores.
70 {
72}
uint32_t snrt_cluster_num()
Get the number of Snitch clusters in the system.
Definition team.h:34

◆ snrt_global_core_base_hartid()

uint32_t snrt_global_core_base_hartid ( )
inline

Get the hartid of the first Snitch core in the system.

Returns
The hartid of the first Snitch core in the system.
52 {
53 return SNRT_BASE_HARTID;
54}

◆ snrt_global_core_idx()

uint32_t snrt_global_core_idx ( )
inline

Get the index (!= hartid) of the current Snitch core in the system.

Returns
The index of the current Snitch core.
79 {
81}
uint32_t snrt_global_core_base_hartid()
Get the hartid of the first Snitch core in the system.
Definition team.h:52
uint32_t snrt_hartid()
Get the RISC-V hardware thread ID (hartid).
Definition team.h:23

◆ snrt_global_core_num()

uint32_t snrt_global_core_num ( )
inline

Get the total number of Snitch cores in the system.

Returns
The total number of cores.
61 {
63}

◆ snrt_hartid()

uint32_t snrt_hartid ( )
inline

Get the RISC-V hardware thread ID (hartid).

Returns
The hardware thread ID.
23 {
24 uint32_t hartid;
25 asm("csrr %0, mhartid" : "=r"(hartid));
26 return hartid;
27}

◆ snrt_is_compute_core()

int snrt_is_compute_core ( )
inline

Check if the current core is a compute core.

Returns
True if the current core is a compute core, false otherwise.

◆ snrt_is_dm_core()

int snrt_is_dm_core ( )
inline

Check if the current core is a data mover (DM) core.

Returns
True if the current core is a DM core, false otherwise.
152 {
153 return !snrt_is_compute_core();
154}
int snrt_is_compute_core()
Check if the current core is a compute core.
Definition team.h:134