This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Generic Timer in Cortex A-53

  1. What is the input & output of system counter? What is it's purpose? How to start/stop it?
  2. What is the input & output of Physical counter? What is it's purpose? How to start/stop it?
  3. What are the differences between Physical Counter & Physical Timer?
  4. What are the differences between System Counter & Physical Counter?
Parents
  • There's the Generic Timer and the System Counter.


    The System Counter generates a "count", which is exported to all the processors in the system.  This is an incrementing fixed frequency count.  The system counter will, typically, have a memory mapped interface giving registers to initialize the count on reset.  But you aren't really expected to stop it again.

    Each processor will implement the Generic Timer.  The Generic Timer is a group of timers, which compare a value against the count provided by the System Counter.  When the system count is equal to/greater than the compare value, the timer fires.  Generating an interrupt.

    The Generic Timer (and by extension, the System Counter) are used by things, such as the OS's scheduler.  The advantage of having a shared global count is that it gives a common reference time on all the cores/processors.  So for example, by setting different compare values on each core, the OS ensures that the scheduler runs at a different time on each core.  Thus avoiding contention.

    The "physical" part is a reference to virtualization.  The count provided by the System Counter is the "physical count", and the "physical" timers compare against this value.  A hypervisor can generate a "virtual" count for use by virtual machines.  The "virtual" timers use this virtual count, rather than the physical count direct from the System Counter.

Reply
  • There's the Generic Timer and the System Counter.


    The System Counter generates a "count", which is exported to all the processors in the system.  This is an incrementing fixed frequency count.  The system counter will, typically, have a memory mapped interface giving registers to initialize the count on reset.  But you aren't really expected to stop it again.

    Each processor will implement the Generic Timer.  The Generic Timer is a group of timers, which compare a value against the count provided by the System Counter.  When the system count is equal to/greater than the compare value, the timer fires.  Generating an interrupt.

    The Generic Timer (and by extension, the System Counter) are used by things, such as the OS's scheduler.  The advantage of having a shared global count is that it gives a common reference time on all the cores/processors.  So for example, by setting different compare values on each core, the OS ensures that the scheduler runs at a different time on each core.  Thus avoiding contention.

    The "physical" part is a reference to virtualization.  The count provided by the System Counter is the "physical count", and the "physical" timers compare against this value.  A hypervisor can generate a "virtual" count for use by virtual machines.  The "virtual" timers use this virtual count, rather than the physical count direct from the System Counter.

Children