diff --git a/include/bench/bench.h b/include/bench/bench.h index 4f2197f..9698f50 100755 --- a/include/bench/bench.h +++ b/include/bench/bench.h @@ -179,6 +179,8 @@ static inline void perf_reset(void) { perf_stop(); cpu_perf_setall(0); perf_start(); +#elif defined(__cv32e40p__) + cpu_perf_setall(0xffffffff); #endif // TODO this is failing on most targets, please include that also for specific ones #if 0 @@ -221,13 +223,13 @@ static inline void plp_power_init() { static inline void plp_power_start() { #if PULP_CHIP == CHIP_PULP4 - set_gpio_pin_value(PIN_CAM_I2S_SDI1+1, 1); + set_gpio_pin_value(PIN_CAM_I2S_SDI1+1, 1); #endif } static inline void plp_power_stop() { #if PULP_CHIP == CHIP_PULP4 - set_gpio_pin_value(PIN_CAM_I2S_SDI1+1, 0); + set_gpio_pin_value(PIN_CAM_I2S_SDI1+1, 0); #endif } diff --git a/include/hal/cv32e40p/cv32e40p.h b/include/hal/cv32e40p/cv32e40p.h index 59ae522..a65a136 100644 --- a/include/hal/cv32e40p/cv32e40p.h +++ b/include/hal/cv32e40p/cv32e40p.h @@ -59,7 +59,7 @@ static inline unsigned int hal_spr_read(unsigned int reg) #if defined(__LLVM__) #else - + #define hal_spr_read_then_clr(reg,val) \ ({ \ int state; \ @@ -255,7 +255,7 @@ static inline void hal_irq_enable() /* * PERFORMANCE COUNTERS - * + * * API for accessing performance counters registers. * Have a look at CV32E40P specifications. * We implement two not-configurable perf counters: MCYCLE and MISNTR plus a configurable counter @@ -320,19 +320,19 @@ static inline void cpu_perf_start() { * the rest of the config can be given through conf parameter */ static inline void cpu_perf_stop() { #ifndef PLP_NO_PERF_COUNTERS - asm volatile("csrs 0x320, %0" : : "r"(0xffffffff)); + asm volatile("csrw 0x320, %0" : : "r"(0xffffffff)); #endif } /* Set the specified counter to the specified value */ static inline void cpu_perf_set(unsigned int counterId, unsigned int value) { - + } /* Set all counters to the specified value */ static inline void cpu_perf_setall(unsigned int value) { #ifndef PLP_NO_PERF_COUNTERS - + asm volatile("csrw 0x320, %0" : : "r"(value)); #endif }