Debug Timer
Overview
The debug timer is a high-precision wrap-around timer that automatically starts after the chip is powered up and begins continuous timing. It provides a unified high-precision time reference for all on-chip processors, ensuring time synchronization in multi-core scenarios. In addition, the debug timer is equipped with a software-triggered counter specifically designed to solve competition issues between cores, assisting in debugging timing conflicts and resource preemption during multi-core operation. It is a key component for chip multi-core debugging and timing calibration.
Features
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
High-precision
{{IC_PARAM_DEBUG_TIMER_WIDTH}}wrap-around timer1μs timing precision, with each counter increment corresponding to a timing duration of 1 microsecond
Automatically starts after power-up, no software configuration required for enablement
A software-triggered counter
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 1us.
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, the counter
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 competition 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.
Registers
The following table lists the memory map of the debug timer registers.
Base Address: 0x41015000
Name |
Address offset |
Access |
Description |
|---|---|---|---|
000h |
R/W |
This register contains the configuration of debug timer’s clock and enable signal. |
|
004h |
R/W |
||
008h |
R |
Atom count adds 1. |
|
00Ch |
R/W |
||
010h |
R/W |
This register is user-defined. |
|
014h |
R/W |
REG_DBGT_CTRL
Name: Debug Timer control register
Size: 32
Address offset: 000h
Read/write access: R/W
This register contains the configuration of debug timer’s clock and enable signal.
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:1 |
RSVD |
R |
- |
Reserved |
0 |
ENABLE |
R/W |
1h |
Debug timer enable.
|
REG_DBGT_CRV
Name: Debug Timer count register
Size: 32
Address offset: 004h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_CRV |
R/W |
0h |
Continue to count from 0 once it’s reached 32’hFFFFFFFF. |
REG_DBGT_ATOM_INC
Name: Debug Timer atom read increase register
Size: 32
Address offset: 008h
Read/write access: R
Atom count adds 1.
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM_INC |
R |
0h |
Each read will increase 1 and return to the increased value to bus. |
REG_DBGT_ATOM
Name: Debug Timer atom register
Size: 32
Address offset: 00Ch
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM |
R/W |
0h |
Return the last increased value of atom counter. |
REG_DBGT_SCRATCH
Name: Debug Timer scratch register
Size: 32
Address offset: 010h
Read/write access: R/W
This register is user-defined.
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_SCRATCH |
R/W |
0h |
Reserved |
REG_DBGTIM_DUMMY
Name: Debug Timer Dummy Register
Size: 32
Address offset: 014h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DUMMY |
R/W |
ffffh |
Dummy register |
Base Address: 0x4011E000
Name |
Address offset |
Access |
Description |
|---|---|---|---|
000h |
R/W |
This register contains the configuration of debugtimer’s clock and enable signal. |
|
004h |
R/W |
Timestamp count |
|
008h |
R |
Atom count adds 1. |
|
00Ch |
R/W |
Atom count value |
|
010h |
R/W |
User-defined register |
|
014h |
R/W |
REG_DBGT_CTRL
Name: debugtimer control register
Size: 32
Address offset: 000h
Read/write access: R/W
This register contains the configuration of debugtimer’s clock and enable signal.
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:16 |
RSVD |
R |
- |
Reserved |
15:4 |
DIV |
R/W |
28h |
The default value can used to divide 40M XTAL to 1M |
3:1 |
CLKSEL |
R/W |
0h |
Clock source selection
|
0 |
ENABLE |
R/W |
1h |
Debug timer enable
|
REG_DBGT_CRV
Name: debugtimer count register
Size: 32
Address offset: 004h
Read/write access: R/W
Timestamp count
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_CRV |
R/W |
0h |
Continue to count from 0 once it’s reached 32’hFFFFFFFF |
REG_DBGT_ATOM_INC
Name: debugtimer atom read increase register
Size: 32
Address offset: 008h
Read/write access: R
Atom count adds 1.
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM_INC |
R |
0h |
Each read will increase 1 and return to the increased value to bus. |
REG_DBGT_ATOM
Name: debugtimer atom register
Size: 32
Address offset: 00Ch
Read/write access: R/W
Atom count value
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM |
R/W |
0h |
Return the last increased value of atom counter |
REG_DBGT_SCRATCH
Name: debugtimer scratch register
Size: 32
Address offset: 010h
Read/write access: R/W
User-defined register
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_SCRATCH |
R/W |
0h |
Reserved for users |
REG_DBGTIM_DUMMY
Name: Debug Timer Dummy Register
Size: 32
Address offset: 014h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DUMMY |
R/W |
ffffh |
Dummy register |
REGISTER_CONTENTS=RTL8720E
REGISTER_CONTENTS=RTL8720E
Base Address: 0x42009000
Name |
Address offset |
Access |
Description |
|---|---|---|---|
000h |
R/W |
||
004h |
R/W |
||
008h |
R |
||
00Ch |
R/W |
||
010h |
R/W |
REG_DBGT_CTRL
Name: debugtimer control register
Size: 32
Address offset: 000h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:16 |
RSVD |
R |
- |
Reserved |
15:4 |
DIV |
R/W |
28h |
The default value can used to divide 40M Xtal to 1M |
3:1 |
CLKSEL |
R/W |
0h |
Clock source select
|
0 |
ENABLE |
R/W |
1h |
Debug timer enable.
|
REG_DBGT_CRV
Name: debugtimer count register
Size: 32
Address offset: 004h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_CRV |
R/W |
0h |
Continuing to count from 0 once it’s reached 32’hFFFFFFFF |
REG_DBGT_ATOM_INC
Name: debugtimer atom read increase
Size: 32
Address offset: 008h
Read/write access: R
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM_INC |
R |
0h |
Each read will increase 1 and return to the increased value to bus. |
REG_DBGT_ATOM
Name: debugtimer atom
Size: 32
Address offset: 00Ch
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM |
R/W |
0h |
Return the last increased value of atom counter |
REG_DBGT_SCRATCH
Name: debugtimer scratch
Size: 32
Address offset: 010h
Read/write access: R/W
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_SCRATCH |
R/W |
0h |
Reserved for user use |
Base Address: 0x40817000
Name |
Address offset |
Access |
Description |
|---|---|---|---|
000h |
R/W |
This register contains the configuration of debugtimer’s clock and enable signal |
|
004h |
R/W |
Timestamp count |
|
008h |
R/W |
Timestamp count |
|
00Ch |
R |
Atom count add 1 |
|
010h |
R/W |
Atom count value |
|
014h |
R/W |
User defined register |
|
018h |
R/W |
Dummy register |
REG_DBGT_CTRL
Name: debugtimer control register
Size: 32
Address offset: 000h
Read/write access: R/W
This register contains the configuration of debugtimer’s clock and enable signal
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:2 |
RSVD |
R |
- |
Reserved |
1 |
DBGT_CRV_SET |
R/W |
0h |
Set dbgt_crv0/1 to dbgtcnt |
0 |
ENABLE |
R/W |
1h |
Debug timer enable.
|
REG_DBGT_CRV0
Name: debugtimer count register
Size: 32
Address offset: 004h
Read/write access: R/W
Timestamp count
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_CRV0 |
R/W |
0h |
Dbgtcnt[31:0].Continuing to count from 0 once it’s reached 32’Hffffffff |
REG_DBGT_CRV1
Name: debugtimer count register
Size: 32
Address offset: 008h
Read/write access: R/W
Timestamp count
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_CRV1 |
R/W |
0h |
Dbgtcnt[63:32].Continuing to count from 0 once it’s reached 32’hFFFFFFFF |
REG_DBGT_ATOM_INC
Name: debugtimer atom read increase
Size: 32
Address offset: 00Ch
Read/write access: R
Atom count add 1
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM_INC |
R |
0h |
Each read will increase 1 and return to the increased value to bus. |
REG_DBGT_ATOM
Name: debugtimer atom
Size: 32
Address offset: 010h
Read/write access: R/W
Atom count value
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_ATOM |
R/W |
0h |
Return the last increased value of atom counter |
REG_DBGT_SCRATCH
Name: debugtimer scratch
Size: 32
Address offset: 014h
Read/write access: R/W
User defined register
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DBGT_SCRATCH |
R/W |
0h |
Reserved for user use |
REG_DBGTIM_DUMMY
Name: Debug TimerDummy Register
Size: 32
Address offset: 018h
Read/write access: R/W
Dummy register
Bit |
Symbol |
Access |
INI |
Description |
|---|---|---|---|---|
31:0 |
DUMMY |
R/W |
ffffh |
Dummy register |