13#ifndef SBL_SYSTEM_PROFILING_CYCLES_HPP_
14#define SBL_SYSTEM_PROFILING_CYCLES_HPP_
17#include <sbl/system/port/cycles.hpp>
22static_assert(port::cycles_port_valid<sbl::driver::Cycles>,
23 "SBL ERROR: the target's cycle port does not meet its contract");
26inline void init() { sbl::driver::Cycles::init(); }
33#ifdef SBL_PROFILING_ENABLED
39inline uint32_t
cycles() {
return sbl::driver::Cycles::read(); }
42inline constexpr uint32_t
cycle_rate() {
return sbl::driver::Cycles::rate(); }
50 volatile uint32_t& result_;
52 explicit CycleScope(
volatile uint32_t& out) : start_(
cycles()), result_(out) {}
The cycle port: what the profiling tools need from a target.
Profiling: the cycle counter, the audio budget, section profiles and reports.
void init_for_profiling()
constexpr uint32_t cycle_rate()