diff options
author | Nir Ekhauz <nir.ekhauz@arm.com> | 2021-06-27 11:20:24 +0300 |
---|---|---|
committer | Nir Ekhauz <nir.ekhauz@arm.com> | 2021-09-01 13:44:44 +0300 |
commit | 4756bf12f9dbe6502b3831808d7e4f217586980a (patch) | |
tree | aaa39fd7e3f2d8e15e9ca6c6880477da83643463 /applications | |
parent | b62e944b466e41dce4495162210ef3af59dfcb29 (diff) | |
download | ethos-u-core-platform-4756bf12f9dbe6502b3831808d7e4f217586980a.tar.gz |
run_platform.py PMU configuration
Enable configuration of up to 4 PMU counters
Jira: MLBEDSW-4744
Change-Id: I08e9073d827033b3340bffd680288b1a83833d64
Diffstat (limited to 'applications')
-rw-r--r-- | applications/baremetal/main.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/applications/baremetal/main.cpp b/applications/baremetal/main.cpp index 8b1bc2b..af14e20 100644 --- a/applications/baremetal/main.cpp +++ b/applications/baremetal/main.cpp @@ -54,16 +54,34 @@ InferenceProcess::InferenceProcess inferenceProcess(TFLuTensorArena, TENSOR_AREN uint8_t outputData[sizeof(expectedOutputData)] __attribute__((aligned(16), section("output_data_sec"))); +#ifndef ETHOSU_PMU_EVENT_0 +#define ETHOSU_PMU_EVENT_0 ETHOSU_PMU_CYCLE +#endif +#ifndef ETHOSU_PMU_EVENT_1 +#define ETHOSU_PMU_EVENT_1 ETHOSU_PMU_NPU_ACTIVE +#endif +#ifndef ETHOSU_PMU_EVENT_2 +#define ETHOSU_PMU_EVENT_2 ETHOSU_PMU_NO_EVENT +#endif +#ifndef ETHOSU_PMU_EVENT_3 +#define ETHOSU_PMU_EVENT_3 ETHOSU_PMU_NO_EVENT +#endif + #ifdef ETHOSU constexpr int32_t EventComponentNo = 0x00; namespace { -std::vector<ethosu_pmu_event_type> pmuEventConfig{ETHOSU_PMU_CYCLE, ETHOSU_PMU_NPU_ACTIVE}; -std::vector<int32_t> eventRecMessageIds{EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_CYCLE), - EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_NPU_ACTIVE)}; +std::vector<ethosu_pmu_event_type> pmuEventConfig{ethosu_pmu_event_type(ETHOSU_PMU_EVENT_0), + ethosu_pmu_event_type(ETHOSU_PMU_EVENT_1), + ethosu_pmu_event_type(ETHOSU_PMU_EVENT_2), + ethosu_pmu_event_type(ETHOSU_PMU_EVENT_3)}; +std::vector<int32_t> eventRecMessageIds{EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_EVENT_0), + EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_EVENT_1), + EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_EVENT_2), + EventID(EventLevelDetail, EventComponentNo, ETHOSU_PMU_EVENT_3)}; const uint32_t delayMs = SystemCoreClock / 60ul; struct ethosu_driver *ethosuDrv; -EthosUMonitor ethosuMonitor(eventRecMessageIds, EthosUMonitor::Backend::EVENT_RECORDER); +EthosUMonitor ethosuMonitor(eventRecMessageIds, EthosUMonitor::Backend::PRINTF); } // namespace extern "C" { |