Skip to content

Commit

Permalink
Correct linting
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Aug 28, 2024
1 parent 7e34997 commit 35d7343
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions sw/snRuntime/src/alloc_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* @file
* @brief Defines functions to dynamically allocate the cluster's L1 memory.
*
*
* This file provides functions to dynamically allocate the cluster's L1
* memory. It includes functions for allocating memory for cluster-local
* variables, compute core-local variables, and for manipulating pointers to
Expand All @@ -16,21 +16,21 @@ extern __thread snrt_allocator_t l1_allocator_v2;

/**
* @brief Get a pointer to the L1 allocator.
*
*
* @return Pointer to the L1 allocator.
*/
inline snrt_allocator_t *snrt_l1_allocator_v2() { return &l1_allocator_v2; }

/**
* @brief Get the next pointer of the L1 allocator.
*
*
* @return The next pointer of the L1 allocator.
*/
inline void *snrt_l1_next_v2() { return (void *)snrt_l1_allocator_v2()->next; }

/**
* @brief Override the L1 allocator next pointer.
*
*
* @param next The new value for the next pointer.
*/
inline void snrt_l1_update_next_v2(void *next) {
Expand All @@ -48,11 +48,11 @@ inline void snrt_l1_alloc_check_bounds() {

/**
* @brief Allocate space for a variable in the cluster's L1 memory.
*
*
* This function dynamically allocates space for a variable of size `size` in
* the cluster's L1 memory.
* The allocation is aligned to the specified `alignment`.
*
*
* @param size The size of the variable to allocate.
* @param alignment The alignment of the allocation.
* @return Pointer to the allocated variable.
Expand All @@ -68,12 +68,12 @@ inline void *snrt_l1_alloc_cluster_local(size_t size, const size_t alignment) {

/**
* @brief Allocate space for N variables in the cluster's L1 memory.
*
*
* This function dynamically allocates space for N variables of size `size` in
* the cluster's L1 memory, where N is the number of compute cores in the
* cluster. The variables are allocated in a contiguous block of memory.
* The whole block is aligned to the specified `alignment`.
*
*
* @param size The size of each variable to allocate.
* @param alignment The alignment of the allocation.
* @return Pointer to the allocated variable for each compute core.
Expand All @@ -91,12 +91,12 @@ inline void *snrt_l1_alloc_compute_core_local(size_t size,

/**
* @brief Get a pointer to the same variable allocated by another core.
*
*
* This function takes a pointer to a variable allocated using
* `snrt_l1_alloc_compute_core_local` and returns a pointer to the same
* variable allocated by another core, as specified by `core_idx`.
* The `size` argument should be the same used during allocation.
*
*
* @param ptr Pointer to the variable allocated by the current core.
* @param core_idx Index of the core that allocated the variable.
* @param size The size of the variable.
Expand All @@ -110,11 +110,11 @@ inline void *snrt_compute_core_local_ptr(void *ptr, uint32_t core_idx,

/**
* @brief Get a pointer to the same offset in another cluster's L1 memory.
*
*
* This function takes a pointer to a variable in the calling (source)
* cluster's L1 memory and returns a pointer to the same offset in the target
* (destination) cluster's L1 memory.
*
*
* @param ptr Pointer to the variable in the source cluster's L1 memory.
* @param src_cluster_idx Index of the source cluster.
* @param dst_cluster_idx Index of the destination cluster.
Expand All @@ -128,10 +128,10 @@ inline void *snrt_remote_l1_ptr(void *ptr, uint32_t src_cluster_idx,

/**
* @brief Initialize the L1 allocator.
*
*
* This function initializes the L1 allocator by calculating the end address
* of the heap and setting the base, end, and next pointers of the allocator.
*
*
* @note This function should be called before using any of the allocation
* functions.
*/
Expand Down
1 change: 0 additions & 1 deletion sw/snRuntime/src/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
((funct7 << 25) | (rs2 << 20) | (rs1 << 15) | (funct3 << 12) | (rd << 7) | \
(opcode))


/// A DMA transfer identifier.
typedef uint32_t snrt_dma_txid_t;

Expand Down
19 changes: 9 additions & 10 deletions sw/snRuntime/src/ssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ inline void snrt_fpu_fence() {
* @brief The different SSRs.
*/
enum snrt_ssr_dm {
SNRT_SSR_DM0 = 0, /**< SSR data mover 0 */
SNRT_SSR_DM1 = 1, /**< SSR data mover 1 */
SNRT_SSR_DM2 = 2, /**< SSR data mover 2 */
SNRT_SSR_DM0 = 0, /**< SSR data mover 0 */
SNRT_SSR_DM1 = 1, /**< SSR data mover 1 */
SNRT_SSR_DM2 = 2, /**< SSR data mover 2 */
SNRT_SSR_DM_ALL = 31 /**< Write to all SSRs */
};

Expand All @@ -48,19 +48,19 @@ enum snrt_ssr_dim {
SNRT_SSR_1D = 0, /**< 1D stream */
SNRT_SSR_2D = 1, /**< 2D stream */
SNRT_SSR_3D = 2, /**< 3D stream */
SNRT_SSR_4D = 3 /**< 4D stream */
SNRT_SSR_4D = 3 /**< 4D stream */
};

/**
* @brief The SSR configuration registers.
*/
enum {
REG_STATUS = 0, /**< SSR status register */
REG_REPEAT = 1, /**< SSR repeat register */
REG_BOUNDS = 2, /**< SSR bounds register */
REG_STATUS = 0, /**< SSR status register */
REG_REPEAT = 1, /**< SSR repeat register */
REG_BOUNDS = 2, /**< SSR bounds register */
REG_STRIDES = 6, /**< SSR strides register */
REG_RPTR = 24, /**< SSR read pointer register */
REG_WPTR = 28 /**< SSR write pointer register */
REG_RPTR = 24, /**< SSR read pointer register */
REG_WPTR = 28 /**< SSR write pointer register */
};

/**
Expand Down Expand Up @@ -92,7 +92,6 @@ inline void snrt_ssr_disable() {
* @return The value of the register.
*/
inline uint32_t read_ssr_cfg(uint32_t reg, uint32_t dm) {

uint32_t value;
asm volatile("scfgri %[value], %[dm] | %[reg]<<5\n"
: [ value ] "=r"(value)
Expand Down
10 changes: 6 additions & 4 deletions sw/snRuntime/src/team.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

/**
* @file
* @brief This file contains functions and macros related to Snitch team management.
* @brief 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.
* 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.
*/

#pragma once
Expand Down

0 comments on commit 35d7343

Please sign in to comment.