aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_pmu.c
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-26 12:06:14 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-26 13:11:06 +0200
commit1c893b540454ffd46e72cf0fce9e7e6d962195b5 (patch)
tree636075660e821a1b1bc563287975b4a4b9fd5773 /src/ethosu_pmu.c
parentc6fd88e37cacbdcb7adc470bc18e7f700a113e58 (diff)
downloadethos-u-core-driver-1c893b540454ffd46e72cf0fce9e7e6d962195b5.tar.gz
Optimizations21.05-rc3
Removing the ASSERT() makro using assert() instead. assert() is better controlled with the NDEBUG define. Using uintptr_t instead of uint32_t * for the NPU base address. This saves a division by 4 in the register read and write functions. Change-Id: I65a91fe35dc63666e50bdf7a756ad15b56dc66e9
Diffstat (limited to 'src/ethosu_pmu.c')
-rw-r--r--src/ethosu_pmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ethosu_pmu.c b/src/ethosu_pmu.c
index a88dfb6..5872d18 100644
--- a/src/ethosu_pmu.c
+++ b/src/ethosu_pmu.c
@@ -106,7 +106,7 @@ void ETHOSU_PMU_Disable(struct ethosu_driver *drv)
void ETHOSU_PMU_Set_EVTYPER(struct ethosu_driver *drv, uint32_t num, enum ethosu_pmu_event_type type)
{
- ASSERT(num < ETHOSU_PMU_NCOUNTERS);
+ assert(num < ETHOSU_PMU_NCOUNTERS);
uint32_t val = pmu_event_value(type);
LOG_DEBUG("%s: num=%u, type=%d, val=%u\n", __FUNCTION__, num, type, val);
ethosu_write_reg_shadow(&drv->dev, NPU_REG_PMEVTYPER(num), val, &drv->dev.pmu_evtypr[num]);
@@ -114,7 +114,7 @@ void ETHOSU_PMU_Set_EVTYPER(struct ethosu_driver *drv, uint32_t num, enum ethosu
enum ethosu_pmu_event_type ETHOSU_PMU_Get_EVTYPER(struct ethosu_driver *drv, uint32_t num)
{
- ASSERT(num < ETHOSU_PMU_NCOUNTERS);
+ assert(num < ETHOSU_PMU_NCOUNTERS);
uint32_t val = drv->dev.pmu_evtypr[num];
enum ethosu_pmu_event_type type = pmu_event_type(val);
LOG_DEBUG("%s: num=%u, type=%d, val=%u\n", __FUNCTION__, num, type, val);
@@ -208,7 +208,7 @@ void ETHOSU_PMU_Set_CCNTR(struct ethosu_driver *drv, uint64_t val)
uint32_t ETHOSU_PMU_Get_EVCNTR(struct ethosu_driver *drv, uint32_t num)
{
- ASSERT(num < ETHOSU_PMU_NCOUNTERS);
+ assert(num < ETHOSU_PMU_NCOUNTERS);
uint32_t val = ethosu_read_reg(&drv->dev, NPU_REG_PMEVCNTR(num));
LOG_DEBUG("%s: num=%u, val=%u, shadow=%u\n", __FUNCTION__, num, val, drv->dev.pmu_evcntr[num]);
@@ -226,7 +226,7 @@ uint32_t ETHOSU_PMU_Get_EVCNTR(struct ethosu_driver *drv, uint32_t num)
void ETHOSU_PMU_Set_EVCNTR(struct ethosu_driver *drv, uint32_t num, uint32_t val)
{
- ASSERT(num < ETHOSU_PMU_NCOUNTERS);
+ assert(num < ETHOSU_PMU_NCOUNTERS);
LOG_DEBUG("%s: num=%u, val=%u\n", __FUNCTION__, num, val);
ethosu_write_reg(&drv->dev, NPU_REG_PMEVCNTR(num), val);
}