summaryrefslogtreecommitdiff
path: root/source/hal/include
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-01 14:43:53 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-05 09:30:23 +0100
commitda2ec067da418d3d80b2829b111df25bd901eb5c (patch)
tree0ccba5c7655ad042bd21f71ffd59c0f52c163f62 /source/hal/include
parent8bc863dd6a7d0937aa66df655a7fe0e235dd2d4f (diff)
downloadml-embedded-evaluation-kit-da2ec067da418d3d80b2829b111df25bd901eb5c.tar.gz
MLECO-3096: Removing "timer" from HAL profile.
Attempting to have timer functionality contained within the platform drivers "package" as it should (in line with the refactoring work done so far under HAL). This will ensure that we don't need two timer implementations under HAL "profiles" and therefore, this whole directory can be removed. This change also addressed issue with the applicatio level Profiler code knowing about how the PMU has been set up by the platform code. This link has been removed completely. This will make it much easier to add/amend the Ethos-U PMU event counters types and give each platform the capability of populating their relvant counters. The application level Profiler doesn't know which metrics it is displaying but just calculates and maintains statistics for whatever PMU counters it receives from the HAL level. A fix for timing adapter issue introduced in the last CR is also included. Change-Id: Ia46e03a06e7b8e42b9ed2ba8f2af2dcd2229c110 Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'source/hal/include')
-rw-r--r--source/hal/include/timer.h46
1 files changed, 6 insertions, 40 deletions
diff --git a/source/hal/include/timer.h b/source/hal/include/timer.h
index 4429388..9910fcf 100644
--- a/source/hal/include/timer.h
+++ b/source/hal/include/timer.h
@@ -17,54 +17,20 @@
#ifndef HAL_TIMER_H
#define HAL_TIMER_H
-#include "platform_timer.h"
-
-/** Struct for describing the capabilities available for
- * the timer provided by HAL */
-typedef struct _platform_timer_capability {
- uint32_t npu_cycles: 1;
- uint32_t cpu_cycles: 1;
- uint32_t duration_ms: 1;
- uint32_t duration_us: 1;
-} timer_capability;
+#include "platform_drivers.h" /* Platform package API */
+#include "user_input.h" /* PMU structs and API */
/* Structure to hold a platform specific timer implementation */
typedef struct _platform_timer {
- int inited; /**< initialised or not */
- timer_capability cap; /**< capability of this timer */
-
- /* reset the timer */
- void (* reset)(void);
-
- /* Gets the current time counter. */
- time_counter (* get_time_counter)(void);
-
- /* Gets the duration in milliseconds. */
- time_t (* get_duration_ms)(time_counter *start, time_counter *end);
-
- /* Gets duration in microseconds. */
- time_t (* get_duration_us)(time_counter *start, time_counter *end);
-
- /* Gets difference in CPU cycle counts. */
- 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,
- uint64_t* pmu_counters_values, size_t size);
-
- /* Wraps get_time_counter function with additional profiling
- * initialisation, if required. */
- time_counter (* start_profiling)(void);
-
- /* Wraps get_time_counter function along with additional instructions when
- * profiling ends, if required. */
- time_counter (* stop_profiling)(void);
+ int inited; /**< Initialised or not. */
+ void (* reset)(void); /**< Reset the timer. */
+ pmu_counters (* get_counters)(void); /**< Gets the current time counter. */
} platform_timer;
/**
* @brief Initialise the timer available for the platform.
**/
-void init_timer(platform_timer *timer);
+void init_timer(platform_timer* timer);
#endif /* HAL_TIMER_H */