Universal timestamp counter, universal timestamp counting method and electronic equipment

By designing an automatic startup universal timestamp counter in the on-chip system, the problem of software dependence in the traditional timestamp counting method during power-on and reset is solved, and independent counting and efficient timestamp acquisition are realized, suitable for complex control processes and performance statistics.

CN119065895APending Publication Date: 2024-12-03SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411008953.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Traditional timestamp counting methods rely on software configuration and cannot be used effectively during power-on, power-down or reset, especially in chip verification and application, where software initialization dependencies exist.

Method used

A universal timestamp counter is designed, which is connected to multiple registers through a hardware counting signal. It automatically starts counting the reference clock after powering on the on-chip system, and remains independent during reset, and is not affected by the central processor. The count value is It can be read at any time after the CPU is dereset.

Benefits of technology

It realizes that the timestamp can be obtained without software control in the system on chip, independent of software initialization and central processor clock, ensuring that the count value is not clear until the system completely powered down, suitable for synchronous operations in complex control processes and data flow processes and performance statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065895A_ABST
    Figure CN119065895A_ABST
Patent Text Reader

Abstract

The invention provides a universal timestamp counter, a universal timestamp counting method and electronic equipment, and relates to the field of systems on a chip. And the universal timestamp counter is arranged in a always electrified area of the system-on-chip, is connected with the plurality of registers through hardware counting signals, and is used for automatically starting to count the reference clock after the system-on-chip is electrified. The method does not depend on software control, and after power-on, on-chip system hardware automatically starts the general timestamp counter to time the reference clock. In the system reset period, the universal timestamp counter still keeps a working state and independently counts, and is not influenced by reset. A counting object is a reference clock, independent timing is achieved, and influences of an actual work clock of the central processing unit are avoided. And the count value of the general timestamp counter is not reset and keeps counting until the system on chip is completely powered down, so that all functional hardware integrated in the system on chip obtains the count value of the general timestamp counter at any stage or time point to serve as a time reference or a timestamp.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of embedded systems, in particular to a universal time stamp counter, a universal time stamp counting method and electronic equipment. Background Art

[0002] In the process of development and application of embedded system products, it is a very common debugging method to use timestamps to indicate key nodes. The so-called timestamp is the time mark corresponding to a certain event or timing node; the time mark can be absolute time or relative time. Using absolute time as a timestamp usually requires an independent timing chip; while using relative time as a timestamp usually requires a Timer (timer / counter).

[0003] However, whether it is a timestamp using a timing chip or a timestamp using a timer, the software dependency is high, that is, both require software configuration to start timing or counting. In the chip verification or application process, in some special applications, neither is applicable. For example: during power-on, power-off, and reset, traditional timestamps cannot be used. Summary of the invention

[0004] In view of the above problems, the present invention proposes a universal time stamp counter, a universal time stamp counting method and an electronic device.

[0005] An embodiment of the present invention provides a universal time stamp counter, which is arranged in an always-powered area of ​​a system on chip;

[0006] The universal time stamp counter is connected to a plurality of registers via a hardware counting signal;

[0007] The universal time stamp counter is connected to the functional hardware integrated in the system on chip through a hardware counting signal;

[0008] The universal time stamp counter is used to automatically start counting the reference clock after the system on chip is powered on.

[0009] Optionally, the universal timestamp counter is arranged in a system control unit in the system on chip.

[0010] Optionally, the universal timestamp counter is configured to be reset according to a power-on reset signal and start counting the reference clock from 0.

[0011] Optionally, the universal timestamp counter is configured to stop counting the reference clock after the system on chip is completely powered off.

[0012] Optionally, the universal timestamp counter is configured to continue counting during normal operation of the system on chip and during a system reset process until the system on chip is completely powered off or the system on chip is powered on and reset, and the universal timestamp counter stops counting the reference clock.

[0013] Optionally, the universal timestamp counter is connected to two registers via a hardware counting signal;

[0014] The two registers are used to store the count value obtained by the universal time stamp counter counting the reference clock;

[0015] The two registers are used in cascade; or, the two registers are used independently;

[0016] Each of the two registers is 4 bytes.

[0017] An embodiment of the present invention provides a universal timestamp counting method, which is implemented by using any universal timestamp counter as described above. The universal timestamp counting method includes:

[0018] The universal time stamp counter is in a reset state when the system on chip is powered on and the power-on reset signal remains valid;

[0019] The universal timestamp counter starts counting the reference clock after the power-on reset signal is released;

[0020] After the power-on reset signal is released, the system on chip continues the startup process and performs hardware initialization. During this period, the universal timestamp counter continues to count until the central processor is released, and then reads the count value of the universal timestamp counter to obtain the timestamp.

[0021] Optionally, the universal timestamp counter uses two registers to store a count value obtained by counting the reference clock.

[0022] Optionally, after the central processing unit is released, reading the count value of the universal timestamp counter includes:

[0023] After the central processing unit is released, the count value of the universal time stamp counter is read using BootROM interface software, a boot loader or firmware.

[0024] Optionally, the functional hardware integrated in the system on chip obtains the count value as a time reference or timestamp of the functional hardware by accessing the universal timestamp counter;

[0025] The functional hardware includes: programmable logic gate array, digital signal processing chip, customized IP, and ASIC.

[0026] Optionally, it also includes:

[0027] During the normal operation of the system on chip and during the system reset process, the universal timestamp counter continues to count until the system on chip is completely powered off or the system on chip is powered on and reset, and the universal timestamp counter stops counting the reference clock;

[0028] The system reset process includes: resetting the central processing unit, resetting the watchdog, and resetting the software.

[0029] An embodiment of the present invention further provides an electronic device, comprising: any universal time stamp counter as described above.

[0030] The universal time stamp counter provided by the present invention is arranged in the always-powered area of ​​the system on chip; the universal time stamp counter is connected with a plurality of registers through a hardware counting signal; the universal time stamp counter is used for automatically starting to count the reference clock after the system on chip is powered on.

[0031] The universal timestamp counter proposed in the present invention is different from the traditional timing chip and timer. It is located in the system on chip and does not rely on software control. After power-on, the system on chip hardware automatically starts the universal timestamp counter to time the reference clock. During the system reset (except the power-on reset of the system on chip), the central processing unit, various hardware, etc. are in the reset state, while the universal timestamp counter remains in the working state and counts independently, and is not affected by the reset. After the central processing unit is released from reset, the timestamp of the universal timestamp counter can be read at any time.

[0032] And because the counting object of the universal timestamp counter is the reference clock, it is independently timed and is not affected by the actual working clock of the central processor. It can work independently of software configuration and never reset, that is, the count value of the universal timestamp counter is not cleared and keeps counting until the system on chip is completely powered off. This allows the various functional hardware integrated inside the system on chip to obtain the count value of the universal timestamp counter as a time reference or timestamp at any stage or time point. In a complex control process or data flow process involving multiple IPs (Internet Protocol), each IP can perform synchronous operations and record timestamps through the universal timestamp counter at key nodes, or output timestamps by tracking, which is convenient for developers and testers to count performance or equal position problems, and has high practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0034] Figure 1 is a schematic diagram of the connection relationship between the universal time stamp counter and the system control unit in an embodiment of the present invention;

[0035] Figure 2 is a flow chart of a universal timestamp counting method according to an embodiment of the present invention;

[0036] Figure 3 is a power-on operation timing diagram of a universal time stamp counter in an embodiment of the present invention;

[0037] Figure 4 is a timing diagram of the reset process of the universal time stamp counter in an embodiment of the present invention;

[0038] Figure 5 is a schematic diagram of the working cycle of a universal timestamp counter in an embodiment of the present invention;

[0039] Figure 6 Schematic diagram of another working cycle of the universal time stamp counter in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, are only part of the embodiments of the present invention, not all of the embodiments, and are not used to limit the present invention.

[0041] The inventors have found that currently, using absolute time as a timestamp usually requires an independent timing chip; while using relative time as a timestamp usually requires a Timer.

[0042] For the timing chip method: the timing chip can directly provide the year, month, day, hour, minute, and second. When the timestamp accuracy requirement is not high, seconds can be used directly as the unit, and it can be easily converted to year, month, and day; when the timestamp accuracy requirement is high, the software can configure the timing chip to output pulses at regular intervals. For example, the timing chip outputs a pulse every 10uS or 1mS. Correspondingly, the CPU or SOC end uses the pulse as an interrupt input and counts it. The count value can be used as a timestamp with an accuracy of 10uS or 1mS.

[0043] For the Timer method: From complex systems on chip (System On Chip, abbreviated: SOC) to single-function microcontrollers, almost all of them integrate Timer; Timer can count by frequency division, and can also generate interrupts at regular intervals. After the Timer is configured and enabled, its counter will continuously count the target clock. In addition, there is a CPU tick counting method, which is integrated into the CPU (Central Processing Unit). It is essentially the same as the Timer, but the timing clock frequency is higher, and the corresponding timing accuracy is higher, up to nanosecond level. The software can read the registers related to the Timer or CPU Tick counting at any time and use its value as a timestamp.

[0044] The inventors further discovered that the use of a timing chip requires an independent power supply design (when the system is powered off, the timing chip can continue to work on the backup power supply), a physical communication path (such as I2C), and a dedicated interrupt pin, which is costly. At the same time, its software encapsulation is more complex, resulting in greater latency. For example, when the system is powered on, powered off, or reset, although it can always maintain a working state as an independent module, as the user of the timestamp: the CPU or SOC cannot respond to interrupts, let alone maintain communication.

[0045] The method of using a timer as a timestamp does not require an external physical period and communication interface, has low cost, simple software interface, and higher accuracy. However, it requires software configuration to take effect, that is, after the system is powered on, the CPU is reset and released, and the software configures the frequency division and enable switch of the Timer, the corresponding time counter will start counting, and it will start counting from 0. In addition, the timing chip also has this problem. After the CPU is reset and released, the software configures the interrupt and enable switch of the timing chip, and the corresponding time counter will start counting.

[0046] From this we can see that the use of traditional timestamps depends on software initialization, and software initialization depends on the CPU. If the CPU is not in working state, the timestamp cannot be enabled.

[0047] In view of the above problems, the inventor has creatively proposed a universal time stamp counter, a universal time stamp counting method and an electronic device of the present invention after extensive research and testing. The technical solution of the present invention is explained and illustrated in detail below.

[0048] The present invention provides a universal time stamp counter, which is different from the traditional timing chip and timer, and is set in the always-powered area of ​​the system on chip, and does not rely on software control. The universal time stamp counter is connected to multiple registers through hardware counting signals. It is used to automatically start counting the reference clock after the system on chip is powered on. It is connected to multiple registers through hardware counting signals, so that the software can access the count value.

[0049] A preferred setting location for the universal timestamp counter may be in the system control unit (SCU) in the system on chip. Since the SCU also has an always-powered area (generally called the Alwayson area), it may be preferably set in the Always on area of ​​the SCU.

[0050] Preferably, the universal timestamp counter is configured to be reset according to a power-on reset signal, which is a power-on reset for the entire on-chip system. When the power-on reset signal is valid, in addition to resetting all software and hardware in the on-chip system, the count value of the universal timestamp counter is cleared to 0, and then the reference clock is counted from 0. The universal timestamp counter is also configured to stop counting the reference clock after the on-chip system is completely powered off. Naturally, it is understandable that after the on-chip system is completely powered off, the entire on-chip system is equivalent to being powered off, all software and hardware lose power, and naturally the universal timestamp counter also loses power and cannot work, and naturally stops counting the reference clock.

[0051] Preferably, the universal time stamp counter is connected to two registers through a hardware counting signal; the two registers are used to store the count value obtained by the universal time stamp counter counting the reference clock. Preferably, the two registers can be used in cascade; or, the two registers can be used independently instead of in cascade. Each of the two registers is 4 bytes. When used in cascade, the maximum count value can reach 2 to the power of 64.

[0052] In order to better understand the universal timestamp counter of the present invention, refer to Figure 1 The schematic diagram of the connection relationship between the universal time stamp counter and the system control unit shown in FIG. Figure 1 The example in which the universal time stamp counter is set in the system control unit is shown as an example. Figure 1 The universal timestamp counter is connected to the register interface through a hardware counting signal. The register interface is an interface of multiple registers in the system control unit. That is, through the register interface, the universal timestamp counter can store the count value in the corresponding register.

[0053] The general time stamp counter also passes the hardware count signal ( Figure 1The hardware count signal low bit and hardware count signal high bit are expressed as: hardware count signal low bit [32:0]_o, hardware count signal high bit [32:0]_o) are connected to other hardware, such as FPGA, DSP, custom IP (intellectual property), ASIC and other hardware ( Figure 1 The universal time stamp counter is connected to other hardware via a hardware counting signal, so that the hardware can access the counting value.

[0054] In addition, the register and the universal time stamp counter are reset by a synchronous reset device. The synchronous reset device receives a reset signal and a reference clock, and generates a power-on reset signal, which is simultaneously given to the universal time stamp counter and the register (sent to the register by the register interface), so that the count values ​​of the universal time stamp counter and the register are reset to zero.

[0055] The reference clock signal is also transmitted to the universal time stamp counter so that the universal time stamp counter can count the reference clock. Some devices in the on-chip system, such as the central processing unit, generally read the count value stored in the register through the advanced high-performance bus and register interface.

[0056] There are many implementation forms of the universal timestamp counter, such as an accumulator, various types of counters, etc. Take the accumulator as an example: it can use the rising edge of the reference clock as the accumulation standard, and accumulate the value 1 every time a rising edge is received, thereby realizing the counting function.

[0057] It can be seen from the above description that the universal timestamp counter mentioned in the present invention is different from the traditional timing chip and timer. It is located in the always-powered area of ​​the system on chip and does not rely on software control. After power-on, the system on chip hardware automatically starts the universal timestamp counter to time the reference clock. During the system reset (except for the power-on reset of the system on chip), the central processing unit, various hardware, etc. are in a reset state, while the universal timestamp counter remains in a working state and counts independently, and is not affected by the reset. After the central processing unit is released from reset, the timestamp of the universal timestamp counter can be read at any time. And because the counting object of the universal timestamp counter is the reference clock, its independent timing leads to the fact that it is not affected by the actual working clock of the central processing unit.

[0058] Based on the above universal timestamp counter, an embodiment of the present invention further proposes a universal timestamp counting method, which is implemented by using any universal timestamp counter described above. Figure 2 The flowchart of the universal timestamp counting method shown includes:

[0059] Step 201: The universal time stamp counter is in a reset state when the system on chip is powered on and the power-on reset signal remains valid.

[0060] If the universal timestamp counter is located in the SCU (System Control Unit), it does not rely on software control. After power-on, the SCU hardware automatically starts the universal timestamp counter to time the reference clock. When the system is reset (except for the power-on reset of the system on chip), the count value of the universal timestamp counter is not cleared and the count is maintained. If the universal timestamp counter is located in the system on chip (System On Chip, SOC), it does not rely on software control. After power-on, the system on chip automatically starts the universal timestamp counter to time the reference clock. When the system is reset (except for the power-on reset of the system on chip), the count value of the universal timestamp counter is not cleared and the count is maintained.

[0061] Therefore, the universal time stamp counter is in a reset state when the system on chip is powered on and the power-on reset signal remains valid. At this time, the entire system on chip is in a reset state, including the SCU and the universal time stamp counter.

[0062] Step 202: After the power-on reset signal is released, the universal time stamp counter starts counting the reference clock.

[0063] After the power-on reset signal is released, that is, after the on-chip system reset is completed, the SCU starts working and first starts the universal timestamp counter to count the reference clock. Preferably, since the universal timestamp counter uses two registers to output its count value, and each register has 4 bytes, the two registers can be cascaded (no configuration is required), so its maximum count value can reach 2 to the power of 64, which fully meets the timestamp counting requirements.

[0064] Step 203: After the power-on reset signal is released, the system on chip continues the startup process and performs hardware initialization. During this period, the universal timestamp counter continues to count until the central processor is released, and then reads the count value of the universal timestamp counter to obtain the timestamp.

[0065] After the power-on reset signal is released, the on-chip system continues the startup process, usually the SCU continues the startup process and performs hardware initialization. During this period, the universal timestamp counter continues to count until the central processing unit CPU is released, and then reads the count value of the universal timestamp counter to obtain the timestamp.

[0066] A better method for reading and putting the count value of the universal timestamp counter includes: after the central processing unit is released, using BootROM interface software (BootRom software generally refers to: a ROM embedded in the processor chip, which contains the first code executed by the processor when it is powered on or reset), boot loader (BootLoader, also known as: startup loader, generally refers to: in an embedded operating system, a program that runs before the operating system kernel runs. It can initialize hardware devices and establish a memory space mapping map, thereby bringing the system's hardware and software environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel.) or firmware to read the count value of the universal timestamp counter.

[0067] The above process can refer to Figure 3 The power-on timing diagram shown in the figure is more intuitive to understand. Figure 3 In which CLK represents reference clock, PORST (Power On Reset) represents power-on reset signal, UTS (Universal Timer Stamp) represents universal time stamp counter, HW INIT represents hardware initialization, CPU RST represents central processing unit reset, eFuse represents one-time programmable memory, and common Reset Logic represents common reset logic.

[0068] It can be seen from this that the universal timestamp counter can start counting after the power-on reset signal is released, and is completely out of software control. The central processing unit can obtain the duration from the power-on of the system-on-chip SOC to the reset release of the central processing unit CPU by reading the timestamp of the universal timestamp counter. Without measuring with an oscilloscope, the startup performance and delay characteristics of the system-on-chip SOC can be obtained.

[0069] The preferred universal timestamp counting method also includes: during the normal operation of the on-chip system and during the system reset process, the universal timestamp counter continues to count until the on-chip system is completely powered off or the on-chip system is powered on and reset, and the universal timestamp counter stops counting the reference clock. Among them, the system reset process includes: CPU reset, watchdog reset, and software reset.

[0070] The above process can refer to Figure 4 The reset process timing diagram shown in the figure can be more intuitively understood. Figure 4 Zhongyu Figure 3 It can be seen that during the CPU RST process of the central processing unit reset, the universal time stamp counter continues to count and does not stop counting the reference clock.

[0071] The count value of the universal timestamp counter as a timestamp completely covers the count period of the traditional timer as a timestamp, and covers various reset scenarios. Figure 5 The working cycle diagram of the universal time stamp counter shown in the figure, Power On means that the power of the on-chip system is turned on, and then the power-on reset (that is, PORST is valid). After the reset, PORST is released, and the UTS count means that the universal time stamp counter starts to count the reference clock continuously. At the same time, the hardware is initialized ( Figure 5 The example is represented by reset logic IO / PLL / CLK / eFuse Sensing, CPU Reset Release). After that, if the BootRom and BootLoader Firmware need to be reset, they are reset separately. The Timer count starts counting. It ends counting when Power Off (complete power off). It can be seen from this:

[0072] The universal timestamp counter automatically counts and advances the counting start point of the timestamp to the power-on reset signal, that is, the PORST release moment. In the normal power-on or reset startup process of the on-chip system, there is a complex hardware initialization process, such as specific pin status latching, eFuse sense, reset counting, internal function IP reset, etc., until the CPU Reset is released, the CPU can enter the working state. When the CPU starts working, the universal timestamp counter has actually counted for a period of time (possibly hundreds of microseconds to tens of milliseconds). In actual use, the software can obtain the timestamp through the universal timestamp counter at any time without considering the timestamp initialization problem; BootRom is the first software program executed after the CPU is released. It can obtain the duration of the on-chip system from power-on to CPU reset release by reading the timestamp. Without measuring with an oscilloscope, the on-chip system startup performance and delay characteristics can be obtained.

[0073] Moreover, during system reset (except power-on reset of system on chip), CPU, Timer, etc. are in reset state, while universal timestamp counter still keeps working and counts independently, and is not affected by reset; after CPU is released from reset, software can read the timestamp obtained by universal timestamp counter at any time.

[0074] The universal timestamp counter counts the reference clock, which is independent and not affected by the actual working clock of the CPU. The clocks commonly used by CPUs, timers, etc. are obtained through PLL (phase-locked loop) frequency multiplication and division. Different scenarios (such as low-power scenarios, high-performance scenarios, etc.) or different users may use different clock frequencies, especially in complex on-chip systems, which may integrate multiple CPUs, and each CPU has a different operating frequency. In this case, the timestamp obtained by the timer needs to be further converted into standard time through the actual frequency used. The universal timestamp counter only counts the reference clock and is not affected by changes in the CPU clock and peripheral clock. Its counting frequency is constant and the unit is unified. The timestamps obtained by all users in all scenarios using the universal timestamp counter count are the same timing units.

[0075] Preferably, each functional hardware integrated in the system on chip can obtain the count value as the time reference or timestamp of each functional hardware by accessing the universal timestamp counter. Among them, each functional hardware includes: Field Programmable Gate Array (FPGA), Digital Signal Processing (DSP), custom IP, ASIC (Application Specific Integrated Circuit, which is considered to be an integrated circuit designed for a specific purpose in the integrated circuit industry).

[0076] Reference Figure 6 Another working cycle diagram of the universal time stamp counter is shown in the figure. Power On means that the power of the on-chip system is turned on, and then the power-on reset (that is, PORST is valid). After the reset, PORST is released, and the UTS count means that the universal time stamp counter starts to count the reference clock continuously. At the same time, the hardware is initialized ( Figure 6 The example is represented by reset logic IO / PLL / CLK / eFuse Sensing). Multiple CPU0 / 1 / …, FPGA / DSP / …, custom IP0 / 1 / …, ASIC0 / 1 / …, etc. integrated in the system on chip can access the universal timestamp counter to obtain the count value as their respective time base or timestamp. Until Power Off (complete power off) ends the counting. It can be seen that:

[0077] The universal timestamp counter can work independently of software configuration and never reset, so the FPGA, DSP, custom IP, etc. integrated in the on-chip system can obtain the count value of the universal timestamp counter at any stage or time point as a time reference or timestamp. In a complex control process or data flow process involving multiple IPs, each IP can synchronize operations and record timestamps through the universal timestamp counter at key nodes, or output the timestamp obtained by the universal timestamp counter through trace, which is convenient for developers and testers to count performance or equal position problems.

[0078] In addition, in terms of power consumption, since the universal timestamp counter itself has extremely simple functions and its working clock is a reference clock with a low frequency, the universal timestamp counter consumes extremely low power. The universal timestamp counter can be placed in the Always On power domain in the SCU. In the process that requires power-off protection, the software performs power-off protection processing within a limited time. When conventional peripherals have been powered off, the universal timestamp counter can still work normally with extremely low power consumption, providing timestamps for debugging the power-off process, so as to analyze the performance and timing of power-off protection (such as key data backup time statistics, etc.).

[0079] The universal timestamp counter uses two registers to output its count value. The software can freely choose 4-byte timestamp or 8-byte timestamp, and only needs to encapsulate different software interfaces. Taking a 50MHz reference clock as an example, the time range that can be represented by the low 4-byte count is about 85 seconds. When the two registers are cascaded, the universal timestamp counter can count a time period of more than 4.27 million years.

[0080] Based on the above universal timestamp counter, an embodiment of the present invention further provides an electronic device, the electronic device comprising: any universal timestamp counter as described above.

[0081] In summary, the universal timestamp counter provided by the present invention is set in the always-powered area of ​​the system on chip; the universal timestamp counter is connected to multiple registers through hardware counting signals; the universal timestamp counter is used to automatically start counting the reference clock after the system on chip is powered on. The universal timestamp counter is in a reset state when the system on chip is powered on and the power-on reset signal remains valid; after the power-on reset signal is released, it starts counting the reference clock; after the power-on reset signal is released, the system on chip continues the startup process and performs hardware initialization work. During this period, the universal timestamp counter continues to count until the central processing unit is released, and the count value of the universal timestamp counter is read to obtain the timestamp.

[0082] The universal timestamp counter proposed in the present invention is different from the traditional timing chip and timer. It is located in the system on chip and does not rely on software control. After power-on, the system on chip hardware automatically starts the universal timestamp counter to time the reference clock. During the system reset (except the power-on reset of the system on chip), the central processing unit, various hardware, etc. are in the reset state, while the universal timestamp counter remains in the working state and counts independently, and is not affected by the reset. After the central processing unit is released from reset, the timestamp of the universal timestamp counter can be read at any time.

[0083] The universal timestamp counter automatically counts and advances the counting start point of the timestamp to the power-on reset signal, that is, the PORST release moment. In the normal power-on or reset startup process of the on-chip system, there is a complex hardware initialization process, such as specific pin status latching, eFuse sense, reset counting, internal function IP reset, etc., until the CPU Reset is released, the CPU can enter the working state. When the CPU starts working, the universal timestamp counter has actually counted for a period of time (possibly hundreds of microseconds to tens of milliseconds). In actual use, the software can obtain the timestamp through the universal timestamp counter at any time without considering the timestamp initialization problem; BootRom is the first software program executed after the CPU is released. It can obtain the duration of the on-chip system from power-on to CPU reset release by reading the timestamp. Without measuring with an oscilloscope, the on-chip system startup performance and delay characteristics can be obtained.

[0084] Moreover, during system reset (except power-on reset of system on chip), CPU, Timer, etc. are in reset state, while universal timestamp counter still keeps working and counts independently, and is not affected by reset; after CPU is released from reset, software can read the timestamp obtained by universal timestamp counter at any time.

[0085] The universal timestamp counter counts the reference clock, which is independent and not affected by the actual working clock of the CPU. The clocks commonly used by CPUs, timers, etc. are obtained through PLL (phase-locked loop) frequency multiplication and division. Different scenarios (such as low-power scenarios, high-performance scenarios, etc.) or different users may use different clock frequencies, especially in complex on-chip systems, which may integrate multiple CPUs, and each CPU has a different operating frequency. In this case, the timestamp obtained by the timer needs to be further converted into standard time through the actual frequency used. The universal timestamp counter only counts the reference clock and is not affected by changes in the CPU clock and peripheral clock. Its counting frequency is constant and the unit is unified. The timestamps obtained by all users in all scenarios using the universal timestamp counter count are the same timing units.

[0086] The universal timestamp counter can work independently of software configuration and never reset, so that the FPGA, DSP, custom IP, ASIC, etc. integrated in the on-chip system can obtain the count value of the universal timestamp counter at any stage or time point as a time reference or timestamp. In a complex control process or data flow process involving multiple IPs, each IP can synchronize operations and record timestamps through the universal timestamp counter at key nodes, or output the timestamp obtained by the universal timestamp counter through trace, which is convenient for developers and testers to count performance or equal position problems.

[0087] In addition, in terms of power consumption, since the universal timestamp counter itself has extremely simple functions and its working clock is a reference clock with a low frequency, the universal timestamp counter consumes extremely low power. The universal timestamp counter can be placed in the Always On power domain in the SCU. In the process that requires power-off protection, the software performs power-off protection processing within a limited time. When conventional peripherals have been powered off, the universal timestamp counter can still work normally with extremely low power consumption, providing a timestamp for debugging the power-off process, so as to analyze the performance and timing of the power-off protection. The universal timestamp counter proposed in the present invention has high practicality.

[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0089] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0090] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A universal timestamp counter, characterized in that: The universal time stamp counter is arranged in an always-powered area of ​​the system on chip; The universal time stamp counter is connected to a plurality of registers via a hardware counting signal; The universal time stamp counter is connected to the functional hardware integrated in the system on chip through a hardware counting signal; The universal time stamp counter is used to automatically start counting the reference clock after the system on chip is powered on.

2. The universal timestamp counter according to claim 1, characterized in that: The universal time stamp counter is arranged in a system control unit of the system on chip.

3. The universal timestamp counter according to claim 1, characterized in that: The universal time stamp counter is configured to be reset according to a power-on reset signal and to count the reference clock from 0.

4. The universal timestamp counter according to claim 1, characterized in that: The universal time stamp counter is configured to stop counting the reference clock after the system on chip is completely powered off.

5. The universal timestamp counter according to claim 1, characterized in that: The universal timestamp counter is configured to continue counting during normal operation of the system on chip and during a system reset process until the system on chip is completely powered off or the system on chip is powered on and reset, and the universal timestamp counter stops counting the reference clock.

6. The universal timestamp counter according to claim 1, characterized in that: The universal time stamp counter is connected to two registers via a hardware counting signal; The two registers are used to store the count value obtained by the universal time stamp counter counting the reference clock; The two registers are used in cascade connection; or, the two registers are used independently. Each of the two registers is 4 bytes.

7. A universal timestamp counting method, characterized in that: The universal timestamp counting method is implemented by using the universal timestamp counter according to any one of claims 1 to 6, and the universal timestamp counting method includes: The universal time stamp counter is in a reset state when the system on chip is powered on and the power-on reset signal remains valid; The universal timestamp counter starts counting the reference clock after the power-on reset signal is released; After the power-on reset signal is released, the system on chip continues the startup process and performs hardware initialization. During this period, the universal timestamp counter continues to count until the central processor is released, and then reads the count value of the universal timestamp counter to obtain the timestamp.

8. The universal timestamp counting method according to claim 7, characterized in that: The universal time stamp counter uses two registers to store the count value obtained by counting the reference clock.

9. The universal timestamp counting method according to claim 7, characterized in that: After the central processing unit is released, the count value of the universal time stamp counter is read, including: After the central processing unit is released, the count value of the universal time stamp counter is read using BootROM interface software, a boot loader or firmware.

10. The universal timestamp counting method according to claim 7, characterized in that: The functional hardware integrated in the system on chip obtains the count value as a time reference or a timestamp of the functional hardware by accessing the universal timestamp counter; The functional hardware includes: programmable logic gate array, digital signal processing chip, customized IP, and ASIC.

11. The universal timestamp counting method according to claim 7, characterized in that: Also includes: During the normal operation of the system on chip and during the system reset process, the universal timestamp counter continues to count until the system on chip is completely powered off or the system on chip is powered on and reset, and the universal timestamp counter stops counting the reference clock; The system reset process includes: resetting the central processing unit, resetting the watchdog, and resetting the software.

12. An electronic device, characterized in that: The electronic device comprises: a universal timestamp counter as described in any one of claims 1-6.

Citation Information

Cited By

  • Working state processing method of timestamp counter, electronic equipment and program product

    CN120196516A

  • Method for Processing Working State of Timestamp Counter, Electronic Device, and Program Product

    CN120196516B