• generic timer


    1.Introduction

      The Generic Timer in the Armv8-A can schedule events and trigger interrupts based on an incrementing counter value. It provides:

    • Generation of timer events as interrupt outputs.
    • Generation of event streams.

    1.1.The Generic Timer

    Provides a system counter, that measures the passing of time in real-time.
    Supports virtual counters that measure the passing of virtual-time. That is, a virtual counter can measure the passing of time on a particular virtual machine.
    Timers, that can trigger events after a period of time has passed. The timers:

    • Can be used as count-up or as count-down timers.
    • Can operate in real-time or in virtual-time.

      ARM generic timer的硬件block主要是SOC上的System counter(多个process共享,用来记录时间的流逝)以及附着在各个processor上的Timer(用于触发timer event)组成,其他的generic timer的硬件电路主要是用来进行交流generic time event的。例如各个processor中的timer和system counter外设进行交互,各个processor中的timer进行信息交互。System counter的功能很简单,就是计算输入时钟已经过了多少个clock,开始的时候是0,每一个clock,System counter会加一。System counter的counter value需要分发到各个timer中,也就是说,从各个timer的角度看,system counter value应该是一致的。Timer其实就是定时器,它可以定义一段指定的时间,当时间到了,就会assert一个外部的输出信号(可以输出到GIC,作为一个interrupt source)。

      从power domain来看,ARM generic timer分成两个部分:System counter和各个Multiprocessor系统中的Timer_x、接口电路等。之所以这么分原因很明显:功耗方面(电源管理)的考量。在power saving mode下,可以shutdown各个processor系统的供电,但是可以保持system counter的供电,这样,至少系统时间可以保持住。

      和power domain类似,clock domain也是不同的,system counter和processor工作在不同的clock下,软件修改了CPU的频率也不会影响system counter的工作节奏,从而也不会改变timer的行为。
     

    2. 手册 timer关键点整理

     

  • 相关阅读:
    求解汉诺塔问题【修改版】
    python读写excel文件
    【全志T113-S3_100ask】10-使用内核驱动点灯(控制继电器)
    Vue3自定义指令
    Ultra Math Preview : VSCode上的LaTeX公式实时预览插件
    电脑重装系统后Win11用户名怎么更改
    vue + vant van-pull-refresh 列表页记录滚动条位置,详情再返回列表页后还原记录的滚动条位置
    MongoDB聚合运算符:$cond
    基于UDP协议搭建的简单客户端与服务器(UDP协议)
    哨兵模式(sentinel)
  • 原文地址:https://blog.csdn.net/xuelin273/article/details/126380759