[PATCH v3 08/32] target/hexagon: Add representation to count cycles

Brian Cain posted 32 patches 3 weeks, 6 days ago
[PATCH v3 08/32] target/hexagon: Add representation to count cycles
Posted by Brian Cain 3 weeks, 6 days ago
From: Brian Cain <bcain@quicinc.com>

The PCYCLE register can be enabled to indicate accumulated clock cycles.

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 target/hexagon/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
index 1a3c9014455..ee2e5eeece2 100644
--- a/target/hexagon/cpu.h
+++ b/target/hexagon/cpu.h
@@ -129,7 +129,7 @@ typedef struct CPUArchState {
     target_ulong stack_start;
 
     uint8_t slot_cancelled;
-
+    uint64_t t_cycle_count;
 #ifndef CONFIG_USER_ONLY
     /* Some system registers are per thread and some are global. */
     uint32_t t_sreg[NUM_SREGS];
-- 
2.34.1

Re: [PATCH v3 08/32] target/hexagon: Add representation to count cycles
Posted by Taylor Simpson 3 weeks, 5 days ago
On Tue, Mar 10, 2026 at 10:08 PM Brian Cain <brian.cain@oss.qualcomm.com>
wrote:

> From: Brian Cain <bcain@quicinc.com>
>
> The PCYCLE register can be enabled to indicate accumulated clock cycles.
>
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  target/hexagon/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
> index 1a3c9014455..ee2e5eeece2 100644
> --- a/target/hexagon/cpu.h
> +++ b/target/hexagon/cpu.h
> @@ -129,7 +129,7 @@ typedef struct CPUArchState {
>      target_ulong stack_start;
>
>      uint8_t slot_cancelled;
> -
> +    uint64_t t_cycle_count;
>

Should this be guarded by #ifndef CONFIG_USER_ONLY?

Otherwise
Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>