Optimizations

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
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_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 @@
 
 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 @@
 
 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 @@
 
 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);
 }