Functional Description
The high-precision wrap-around timer supports two types of clock input sources: external crystal (XTAL) or internal 32K clock. The two clock sources can be intelligently switched according to the system operating state. When the system is running normally, the high-precision crystal can be used to ensure timing accuracy; when the system enters sleep mode, the timer will automatically switch the clock source. Regardless of which clock source is used, the counter will automatically add 1 every 1 μs.
When the count value of the high-precision wrap-around timer reaches the maximum bit limit it supports, it will automatically wrap to 0 and start a new round of counting, achieving a cyclic counting effect without the need for manual zero reset. It should be noted that during the process of entering and exiting sleep mode, the clock source switching operation will cause a certain timing error to the timing operation. Therefore, in actual use of the timer, if it involves switching of sleep mode scenarios, the impact of this error must be considered in advance.
The high-precision wrap-around timer also supports configuration functions. Software can configure the counter start value as needed. After configuration, set the DBGT_CRV_SET bit; after waiting for 1 bus clock cycle and 3 timer clock cycles, the counter begins counting upward from the configured start value.
When the counter’s ENABLE bit is cleared and then set again, the counter will restart counting from 0.
The software-triggered counter is mainly used to debug various timing issues in multi-core SoC chips, accurately locating timing deviations and resource arbitration exceptions during multi-core operation. Through software triggering, efficient arbitration control is implemented at the bus level, optimizing multi-core contention scheduling logic.
The counter has two independent read windows. Different read addresses correspond to different counting rules: if a read operation is performed from the DBGT_ATOM_INC address, the software-triggered counter value will automatically increase by one; if a read operation is performed from the DBGT_ATOM address, the counter value remains unchanged and will not increment. By distinguishing read addresses, the count trigger logic can be flexibly controlled to adapt to different multi-core debugging scenarios.