diff options
-rw-r--r-- | include/pmu_ethosu.h | 6 | ||||
-rw-r--r-- | src/ethosu_device.h | 1 | ||||
-rw-r--r-- | src/ethosu_driver.c | 2 | ||||
-rw-r--r-- | src/ethosu_pmu.c | 5 |
4 files changed, 13 insertions, 1 deletions
diff --git a/include/pmu_ethosu.h b/include/pmu_ethosu.h index 0c1475d..1a9bfd8 100644 --- a/include/pmu_ethosu.h +++ b/include/pmu_ethosu.h @@ -154,6 +154,12 @@ void ETHOSU_PMU_Disable(struct ethosu_driver *drv); void ETHOSU_PMU_Set_EVTYPER(struct ethosu_driver *drv, uint32_t num, enum ethosu_pmu_event_type type); /** + * \brief Get number of PMU event counters + * \return Number of event counters + */ +uint32_t ETHOSU_PMU_Get_NumEventCounters(void); + +/** * \brief Get event to count for PMU eventer counter * \param [in] num Event counter (0-ETHOSU_PMU_NCOUNTERS) to configure * \return type Event to count diff --git a/src/ethosu_device.h b/src/ethosu_device.h index 2f41d5c..cc9ea8b 100644 --- a/src/ethosu_device.h +++ b/src/ethosu_device.h @@ -35,6 +35,7 @@ extern "C" { * Defines ******************************************************************************/ +// NOTE: Deprecated #ifndef ETHOSU_PMU_NCOUNTERS #define ETHOSU_PMU_NCOUNTERS 4 #endif diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c index 522f3e8..fedb2a1 100644 --- a/src/ethosu_driver.c +++ b/src/ethosu_driver.c @@ -285,7 +285,7 @@ static struct ethosu_driver *ethosu_find_and_reserve_driver(void) drv = drv->next; } - LOG_DEBUG("No NPU driver handle available.", drv); + LOG_WARN("No NPU driver handle available."); return NULL; } diff --git a/src/ethosu_pmu.c b/src/ethosu_pmu.c index 647f3b0..e11636a 100644 --- a/src/ethosu_pmu.c +++ b/src/ethosu_pmu.c @@ -101,6 +101,11 @@ void ETHOSU_PMU_Disable(struct ethosu_driver *drv) set_clock_and_power_request(drv, ETHOSU_PMU_REQUEST, ETHOSU_CLOCK_Q_ENABLE, ETHOSU_POWER_Q_ENABLE); } +uint32_t ETHOSU_PMU_Get_NumEventCounters(void) +{ + return NPU_REG_PMEVCNTR_ARRLEN; +} + void ETHOSU_PMU_Set_EVTYPER(struct ethosu_driver *drv, uint32_t num, enum ethosu_pmu_event_type type) { assert(num < ETHOSU_PMU_NCOUNTERS); |