summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-14 17:34:09 +0100
committerAlexander Efremov <alexander.efremov@arm.com>2021-05-19 08:49:22 +0000
commita3d87702b743e4e2d2ef08f0210445b01a86c87c (patch)
treeb954a48a4a0f74289fbd09e2362c86de7d50c798
parent958133d49b121e997b63ad81f96db90fdd2a3e45 (diff)
downloadml-embedded-evaluation-kit-a3d87702b743e4e2d2ef08f0210445b01a86c87c.tar.gz
MLECO-1910: Fix for CPU counter difference
Fixed the CPU counter being truncated by the diff function's return type. Change-Id: I9417dbc9da357f8593b67c3a94620ac6e62eddbf
-rw-r--r--.gitignore4
-rw-r--r--source/application/hal/include/timer.h2
-rw-r--r--source/application/hal/platforms/bare-metal/timer/baremetal_timer.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 2a80d95..70914be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,8 +10,8 @@ resources_downloaded
# Build files
CMakeFiles
-build
-cmake-build-*
+build*/
+cmake-build-*/
# Virtual environments
scripts/py/env*
diff --git a/source/application/hal/include/timer.h b/source/application/hal/include/timer.h
index 4a09fd4..426a42f 100644
--- a/source/application/hal/include/timer.h
+++ b/source/application/hal/include/timer.h
@@ -54,7 +54,7 @@ typedef struct _platform_timer {
time_t (* get_duration_us)(time_counter *start, time_counter *end);
/* Gets difference in CPU cycle counts. */
- uint32_t (* get_cpu_cycle_diff)(time_counter *start, time_counter *end);
+ uint64_t (* get_cpu_cycle_diff)(time_counter *start, time_counter *end);
/* Gets the difference in terms of cycle counts for collected pmu counters. */
int (* get_npu_cycles_diff)(time_counter *start, time_counter *end,
diff --git a/source/application/hal/platforms/bare-metal/timer/baremetal_timer.c b/source/application/hal/platforms/bare-metal/timer/baremetal_timer.c
index 64f2376..cd17a60 100644
--- a/source/application/hal/platforms/bare-metal/timer/baremetal_timer.c
+++ b/source/application/hal/platforms/bare-metal/timer/baremetal_timer.c
@@ -146,7 +146,7 @@ static time_counter bm_stop_profiling(void);
* @return CPU cycle difference between given time counters expressed
* as unsigned 32 bit integer.
**/
-static uint32_t bm_get_cpu_cycles_diff(time_counter *st, time_counter *end);
+static uint64_t bm_get_cpu_cycles_diff(time_counter *st, time_counter *end);
/**
* @brief Initialiser for bare metal timer.
@@ -335,7 +335,7 @@ static time_counter bm_stop_profiling(void)
return bm_get_time_counter();
}
-static uint32_t bm_get_cpu_cycles_diff(time_counter *st, time_counter *end)
+static uint64_t bm_get_cpu_cycles_diff(time_counter *st, time_counter *end)
{
return get_cycle_count_diff(&(st->counter), &(end->counter));
}