Snitch Runtime
Loading...
Searching...
No Matches
snitch_cluster_memory.h
1// Copyright 2023 ETH Zurich and University of Bologna.
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5#include <stddef.h>
6#include <stdint.h>
7
8// Must return a pointer to the snitch_cluster_t struct
9// of the cluster alias.
10inline volatile snitch_cluster_t* snrt_cluster_alias() {
11 return &(snitch_cluster_addrmap.cluster_alias);
12}
13
14// Must return a pointer to the snitch_cluster_t struct
15// of the cluster selected by cluster_idx.
16inline volatile snitch_cluster_t* snrt_cluster(int cluster_idx) {
17 return &(snitch_cluster_addrmap.cluster) + cluster_idx;
18}
19
20// Must return a pointer to the snitch_cluster_t struct
21// of the cluster invoking the function.
22inline volatile snitch_cluster_t* snrt_cluster() {
23 return &(snitch_cluster_addrmap.cluster) + snrt_cluster_idx();
24}