Skip to content

Commit

Permalink
Correct linting
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Aug 21, 2024
1 parent 7004316 commit a722b17
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions sw/snRuntime/src/alloc_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ inline void snrt_l1_update_next_v2(void *next) {
// exception otherwise
inline void snrt_l1_alloc_check_bounds() {
if (snrt_l1_allocator_v2()->next > snrt_l1_allocator_v2()->end)
asm volatile ("ecall \n");
asm volatile("ecall \n");
}

// Dynamically allocate space for a variable of size `size` in the cluster's L1
// memory. This function should be invoked by every core in a cluster. Every
// core receives a pointer to the allocated variable.
inline void *snrt_l1_alloc_cluster_local(size_t size, const size_t alignment) {
snrt_l1_allocator_v2()->next = ALIGN_UP(snrt_l1_allocator_v2()->next, alignment);
snrt_l1_allocator_v2()->next =
ALIGN_UP(snrt_l1_allocator_v2()->next, alignment);
void *retval = snrt_l1_next_v2();
snrt_l1_allocator_v2()->next += size;
snrt_l1_alloc_check_bounds();
Expand All @@ -40,7 +41,8 @@ inline void *snrt_l1_alloc_cluster_local(size_t size, const size_t alignment) {
// return value for the DM core is undefined.
inline void *snrt_l1_alloc_compute_core_local(size_t size,
const size_t alignment) {
snrt_l1_allocator_v2()->next = ALIGN_UP(snrt_l1_allocator_v2()->next, alignment);
snrt_l1_allocator_v2()->next =
ALIGN_UP(snrt_l1_allocator_v2()->next, alignment);
void *retval = snrt_l1_next_v2() + size * snrt_cluster_core_idx();
snrt_l1_allocator_v2()->next += size * snrt_cluster_compute_core_num();
snrt_l1_alloc_check_bounds();
Expand All @@ -65,7 +67,7 @@ inline void *snrt_remote_l1_ptr(void *ptr, uint32_t src_cluster_idx,
(dst_cluster_idx - src_cluster_idx) * SNRT_CLUSTER_OFFSET);
}

inline void snrt_alloc_init_v2() {
inline void snrt_alloc_init_v2() {
// Calculate end address of the heap. The top of the TCDM address space is
// reserved for the cluster-local storage (CLS) and the stack of every
// core. We further provision a safety margin of 128B. The rest of the
Expand Down
4 changes: 2 additions & 2 deletions sw/snRuntime/src/omp/omp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static inline void initTeam(omp_t *_this, omp_team_t *team) {
void omp_init(void) {
if (snrt_cluster_core_idx() == 0) {
// allocate space for kmp arguments
kmpc_args =
(_kmp_ptr32 *)snrt_l1_alloc(sizeof(_kmp_ptr32) * KMP_FORK_MAX_NARGS);
kmpc_args = (_kmp_ptr32 *)snrt_l1_alloc(sizeof(_kmp_ptr32) *
KMP_FORK_MAX_NARGS);
#ifndef OMPSTATIC_NUMTHREADS
omp_p = (omp_t *)snrt_l1_alloc(sizeof(omp_t));
unsigned int nbCores = snrt_cluster_compute_core_num();
Expand Down
2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/runtime/banshee/src/snrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "printf.h"
#include "riscv.h"
#include "snitch_cluster_global_interrupts.h"
#include "ssr.h"
#include "snitch_cluster_start.h"
#include "ssr.h"
#include "sync.h"
#include "team.h"
#include "types.h"
2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/runtime/rtl/src/snrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "printf.h"
#include "riscv.h"
#include "snitch_cluster_global_interrupts.h"
#include "ssr.h"
#include "snitch_cluster_start.h"
#include "ssr.h"
#include "sync.h"
#include "team.h"
#include "types.h"

0 comments on commit a722b17

Please sign in to comment.