From b9d7ded1b4e1457d7f6bfa65868a04268e1907ef Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Fri, 4 Feb 2022 13:10:04 +0100 Subject: PMU begin and end events Restore print format for PMU output. Use begin and end events to enable the PMU cycle counter. Change-Id: Iaf2d9b78b031f34c0cde0296b4248dea38f19860 --- applications/message_handler/message_handler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/message_handler/message_handler.cpp b/applications/message_handler/message_handler.cpp index f6135fc..817255f 100644 --- a/applications/message_handler/message_handler.cpp +++ b/applications/message_handler/message_handler.cpp @@ -260,11 +260,11 @@ void InferenceHandler::runInference(ethosu_core_inference_req &req, ethosu_core_ const int numEvents = std::min(static_cast(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_CORE_PMU_MAX); for (int i = 0; i < numEvents; i++) { - printf("ethos-u : ethosu_pmu_cntr%d : %" PRIu32 "\n", i, rsp.pmu_event_count[i]); + printf("ethosu_pmu_cntr%d : %" PRIu32 "\n", i, rsp.pmu_event_count[i]); } if (rsp.pmu_cycle_counter_enable) { - printf("ethos-u : cycle_cnt : %" PRIu64 " cycles\n", rsp.pmu_cycle_counter_count); + printf("ethosu_pmu_cycle_cntr : %" PRIu64 " cycles\n", rsp.pmu_cycle_counter_count); } /* @@ -424,6 +424,9 @@ extern "C" void ethosu_inference_begin(struct ethosu_driver *drv, void *userArg) // Enable cycle counter if (self->currentReq->pmu_cycle_counter_enable) { + ETHOSU_PMU_PMCCNTR_CFG_Set_Stop_Event(drv, ETHOSU_PMU_NPU_IDLE); + ETHOSU_PMU_PMCCNTR_CFG_Set_Start_Event(drv, ETHOSU_PMU_NPU_ACTIVE); + ETHOSU_PMU_CNTR_Enable(drv, ETHOSU_PMU_CCNT_Msk); ETHOSU_PMU_CYCCNT_Reset(drv); } -- cgit v1.2.1