I am new to ARM.
I am using Xilinx RFSOC which in particular comprises 4 A53 cores (Armv8-A) running Linux in SMP configuration.
I need a real-time clock with 1 us (or better) resolution that can be accessed from user-level code (running in AArch64 mode) and yield consistent readings across all cores.
I would like to be able to read the clock from application (EL0) code with minimal overhead, which implies that such reads should not be trapped by the O/S.
Preferably the counter should be readable via an atomic 64-bit read.
Browsing the various documents I found on the net, it seems that the ARM system counter provides the necessary functionality. The question is how to read it from user code. I found the following registers:
CNTCV, (supports reads via CNTReadBase)
CNTVCT, (accessible via 32-bit reads?)
CNTPCT_EL0 (probably trapped by the O/S?)
I have the following questions:
a) Does any of the above counters comply with my requirements (i.e. it is directly readable from EL0 code and provides consistent time stamps across the 4 A53 cores)? If not, is there another counter that I could use?
b) How exactly do I read the counter from user-level C code running under Linux?
Thanks,