aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_pmu.c
AgeCommit message (Collapse)Author
2021-04-12Clock request disabled when PMU enabledAnton Moberg
Currently clock request is enabled, which means NPU will only request clock when working. When NPU is going into idle it will no longer request clock and thus PMU won't be clocked either, and thus affect the cycle counter. Added: enum for request clients (PMU or INFERENCE). Added: clock_request added to driver struct (bit 0: PMU, bit 1: INFERENCE) which keeps track of which client requests clock. Added: power_request added to driver struct (bit 0: PMU, bit 1: INFERENCE) which keeps track of which client requests power. Added set_clock_and_power_request(...) updates clock_request and power_request depending on which client calls it. Sets clock and power if both PMU and INFERENCE requests it. Added: Call set_clock_and_power_request(...) from PMU. Changed: replace ethosu_set_clock_and_power(...) with set_clock_and_power_request(...) in ethosu_init and ethosu_invoke Change-Id: Ie7d8aee639d4abbf879b05e9a82035d7c0d40d40
2021-03-16Use event enum for configuring cycle counterPer Åstrand
The pmu configuration API expects the internal configuration values, and not the exported enum. Update the API to instead use the enums to be able to configure them correctly. Change-Id: I038b1841f2459baec4a62a6a4389ea4b5f4822f2
2021-01-27MLBEDSW-3796 Ethos-U driver interface multiple NPUs21.02-rc221.02-rc1Anton Moberg
---ethosu_driver--- Modified: Declarations for the driver interfaces to support multiNPU (takes *drv) Added: ethosu_register_driver(...) to allow for a specific NPU driver to be instantiated Added: ethosu_deregister_Driver(...) to allow for a specific NPU driver to be de-registered Added: ethosu_reserve_driver(...) to reserve & return the first NPU driver instance available Added: ethosu_release_driver(...) to release a specific NPU driver instance and make it available again Added: *registered_drivers - A static linked list of drivers ready be used ---ethosu_pmu--- Modified: Declarations for pmu interfaces to support multiNPU (takes *drv) ---ethosu_device--- Modified: Resolved a circular include dependency (Remove include and add ETHOSU_PMU_NCOUNTERS macro) Change-Id: Iede41cd41bb0d5d483bd9d929d1b6c9ca5d3c48e
2020-10-23Incorrect PMU cycle counterKristofer Jonsson
The low and high PMU cycle counter registers were not combined correctly. Change-Id: I6b311b33527557f459fd87ebd5d4d3228625106a
2020-10-20PMU counter shadowKristofer Jonsson
Storing PMU counters in shadow variables, in case the PMU was powered off or soft reset. Change-Id: I64ccf3fb6195f9be2d8315891ec612bb75404885
2020-09-28Silence gcc > 7 type-limits warningPer Åstrand
GCC > 7 warns that the selected type of the enum makes the comparisson unneccesary. Since the selected enum fits in an integer, the input parameter is casted to an integer to make the comparison valid and asserts that the enum is within valid enum values (which we know are monotonically growing). Change-Id: Id81799e2ac43a83b998541ce7531d2039202cd62
2020-09-28Add default switch statementPer Åstrand
Change-Id: I591284c1b06b660fc303bb5b4fa282d403ee42c0
2020-09-23Resetting cached cycle counterKristofer Jonsson
Change-Id: Ia2a0ac76fca0fd12efee305a2ea2ebd5b2055b2d
2020-08-26Save and restore PMU settings and counters20.08-rc220.08Kristofer Jonsson
Change-Id: I54a1927fef998bc97f5507f2de9faf7d4a7960f5
2020-07-03MLBEDSW-2378 Set NPU base address in ethosu_initBhavik Patel
Change-Id: I1145834000ff81d6e497a8fa77bf997478a80372
2020-07-02Move PMU functions from pmu_ethosu.h to ethosu_pmu.cBhavik Patel
This change is done as a prerequisite to be able to set base address for NPU through ethosu_init(). So instead of using a mamory mapped struct we use the same functions to read/write PMU registers as the rest of the ethos-u driver. Change-Id: Ie1f6e6af4627cbe9375e2b2d079ba8017b6294d3
2020-05-08MLBEDSW-2194 Updating PMU filesKristofer Jonsson
Moving PMU files from ethosu_pmu to include and src. Adding extern "C" to PMU header. Removing CMake generated file. Updating default path to CMSIS. Removing timing adapter. Change-Id: I4834c5361c14efe629c5cb36a17013d02cc765c8