diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2022-02-04 13:10:04 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2022-02-04 13:10:04 +0100 |
commit | b9d7ded1b4e1457d7f6bfa65868a04268e1907ef (patch) | |
tree | 360dd64048790d2a2e5d345af77c76ada9cc358a /applications | |
parent | 09d4945817ca235214a9b4f577b4b696f333ef00 (diff) | |
download | ethos-u-core-platform-b9d7ded1b4e1457d7f6bfa65868a04268e1907ef.tar.gz |
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
Diffstat (limited to 'applications')
-rw-r--r-- | applications/message_handler/message_handler.cpp | 7 |
1 files 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<int>(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); } |