diff --git a/GorgonMeducer.perf_counter.pdsc b/GorgonMeducer.perf_counter.pdsc index 677d5cb..b5d15e8 100644 --- a/GorgonMeducer.perf_counter.pdsc +++ b/GorgonMeducer.perf_counter.pdsc @@ -16,8 +16,8 @@ https://github.com/GorgonMeducer/perf_counter.git - - - Add Coremark + + - Update stop_cycle_counter prototype to solve return-value-overflow issue - Add Coremark @@ -271,12 +271,12 @@ - + Coremark - - + + diff --git a/benchmark/coremark_port/core_portme.c b/benchmark/coremark_port/core_portme.c index 6366601..a14386b 100644 --- a/benchmark/coremark_port/core_portme.c +++ b/benchmark/coremark_port/core_portme.c @@ -65,7 +65,7 @@ volatile ee_s32 seed5_volatile = 0; extern uint32_t SystemCoreClock; -static volatile CORE_TICKS s_nCycleElapsed = 0; +static volatile CORE_TICKS s_tCycleElapsed = 0; /* Function : start_time This function will be called right before starting the timed portion of @@ -91,7 +91,7 @@ start_time(void) void stop_time(void) { - s_nCycleElapsed = stop_cycle_counter(); + s_tCycleElapsed = stop_cycle_counter(); } /* Function : get_time Return an abstract "ticks" number that signifies time on the system. @@ -105,7 +105,7 @@ stop_time(void) CORE_TICKS get_time(void) { - return s_nCycleElapsed; + return s_tCycleElapsed; } /* Function : time_in_secs Convert the value returned by get_time to seconds. diff --git a/benchmark/coremark_port/core_portme.h b/benchmark/coremark_port/core_portme.h index 327e328..20d0c0a 100644 --- a/benchmark/coremark_port/core_portme.h +++ b/benchmark/coremark_port/core_portme.h @@ -76,7 +76,7 @@ Original Author: Shay Gal-on /* Configuration : CORE_TICKS Define type of return from the timing functions. */ -typedef int32_t CORE_TICKS; +typedef int64_t CORE_TICKS; /* Definitions : COMPILER_VERSION, COMPILER_FLAGS, MEM_LOCATION Initialize these strings per platform diff --git a/cmsis-pack/GorgonMeducer.perf_counter.2.0.0.pack b/cmsis-pack/GorgonMeducer.perf_counter.2.1.0-dev2.pack similarity index 84% rename from cmsis-pack/GorgonMeducer.perf_counter.2.0.0.pack rename to cmsis-pack/GorgonMeducer.perf_counter.2.1.0-dev2.pack index 5c24c14..20b3ac8 100644 Binary files a/cmsis-pack/GorgonMeducer.perf_counter.2.0.0.pack and b/cmsis-pack/GorgonMeducer.perf_counter.2.1.0-dev2.pack differ diff --git a/cmsis-pack/GorgonMeducer.perf_counter.pdsc b/cmsis-pack/GorgonMeducer.perf_counter.pdsc index 7c73301..b5d15e8 100644 --- a/cmsis-pack/GorgonMeducer.perf_counter.pdsc +++ b/cmsis-pack/GorgonMeducer.perf_counter.pdsc @@ -16,7 +16,10 @@ https://github.com/GorgonMeducer/perf_counter.git - + + - Update stop_cycle_counter prototype to solve return-value-overflow issue + + - Add Coremark @@ -227,7 +230,7 @@ --> - + A dedicated performance counter for Cortex-M systick. documents/Doxygen/html/index.html @@ -268,12 +271,12 @@ - + Coremark - - + + diff --git a/lib/perf_counter.h b/lib/perf_counter.h index b2670e0..7720cb4 100644 --- a/lib/perf_counter.h +++ b/lib/perf_counter.h @@ -424,11 +424,11 @@ void start_cycle_counter(void) * \return int32_t the elapsed cycle count */ __STATIC_INLINE -int32_t stop_cycle_counter(void) +int64_t stop_cycle_counter(void) { - int32_t nTemp = (int32_t)(get_system_ticks() - g_lLastTimeStamp); + int64_t lTemp = (get_system_ticks() - g_lLastTimeStamp); - return nTemp - g_nOffset; + return lTemp - g_nOffset; } /*! diff --git a/perf_counter.h b/perf_counter.h index b2670e0..7720cb4 100644 --- a/perf_counter.h +++ b/perf_counter.h @@ -424,11 +424,11 @@ void start_cycle_counter(void) * \return int32_t the elapsed cycle count */ __STATIC_INLINE -int32_t stop_cycle_counter(void) +int64_t stop_cycle_counter(void) { - int32_t nTemp = (int32_t)(get_system_ticks() - g_lLastTimeStamp); + int64_t lTemp = (get_system_ticks() - g_lLastTimeStamp); - return nTemp - g_nOffset; + return lTemp - g_nOffset; } /*!