Skip to content

applications/src/utils/utils.h

Functions

Name
uint32_t benchmark_get_cycle()
returns cycle number and injects marker to track performance
void snrt_dma_start_tracking()
start tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed
void snrt_dma_stop_tracking()
stop tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed
uint32_t check_layer(const conv_layer * l, double * checksum)
checks correctness of feature map
void dma_memset(void * ptr, uint8_t value, uint32_t len)
fast memset function performed by DMA

Functions Documentation

function benchmark_get_cycle

uint32_t benchmark_get_cycle()

returns cycle number and injects marker to track performance

Return: uint32_t

function snrt_dma_start_tracking

void snrt_dma_start_tracking()

start tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed

function snrt_dma_stop_tracking

void snrt_dma_stop_tracking()

stop tracking of dma performance region. Does not have any implications on the HW. Only injects a marker in the DMA traces that can be analyzed

function check_layer

uint32_t check_layer(
    const conv_layer * l,
    double * checksum
)

checks correctness of feature map

Parameters:

  • l layer struct (Conv2d, BatchNorm, Maxpool)
  • checksum checksum to compare against, reduced over input channels

Return: uint32_t

function dma_memset

void dma_memset(
    void * ptr,
    uint8_t value,
    uint32_t len
)

fast memset function performed by DMA

Parameters:

  • ptr pointer to the start of the region
  • value value to set
  • len number of bytes, must be multiple of DMA bus-width

Source code

// Copyright 2020 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "layer.h"
#include "snrt.h"

uint32_t benchmark_get_cycle();

void snrt_dma_start_tracking();

void snrt_dma_stop_tracking();

uint32_t check_layer(const conv_layer* l, double* checksum);

void dma_memset(void* ptr, uint8_t value, uint32_t len);

Updated on 2023-06-19 at 09:43:56 +0000