Incorrect PMU cycle counter
The low and high PMU cycle counter registers were not combined
correctly.
Change-Id: I6b311b33527557f459fd87ebd5d4d3228625106a
diff --git a/src/ethosu_pmu.c b/src/ethosu_pmu.c
index f7cb957..57edacd 100644
--- a/src/ethosu_pmu.c
+++ b/src/ethosu_pmu.c
@@ -164,12 +164,12 @@
uint64_t ETHOSU_PMU_Get_CCNTR(void)
{
- uint32_t val_lo = ethosu_read_reg(ðosu_drv.dev, NPU_REG_PMCCNTR_HI);
- uint32_t val_hi = ethosu_read_reg(ðosu_drv.dev, NPU_REG_PMCCNTR_LO);
+ uint32_t val_lo = ethosu_read_reg(ðosu_drv.dev, NPU_REG_PMCCNTR_LO);
+ uint32_t val_hi = ethosu_read_reg(ðosu_drv.dev, NPU_REG_PMCCNTR_HI);
uint64_t val = ((uint64_t)val_hi << 32) | val_lo;
uint64_t shadow = ((uint64_t)ethosu_drv.dev.pmccntr[1] << 32) | ethosu_drv.dev.pmccntr[0];
- LOG_DEBUG("%s: val=%llu, shadow=%llu\n", __FUNCTION__, val, shadow);
+ LOG_DEBUG("%s: val=%" PRIu64 ", shadow=%" PRIu64 "\n", __FUNCTION__, val, shadow);
// Return the shadow variable in case the NPU was powered off and lost the cycle count
if (shadow > val)