IP event counting device and method, equipment and storage medium
By using a combination of a counter register, a counter mirror register, and a base register in the system-on-a-chip, the problem of counter reset after IP module restart is solved, accurate counting of IP events is achieved, and the resource consumption of the power management system is reduced.
Patent Information
- Application Number
- CN202610056289.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-16
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2046-01-16
AI Technical Summary
In on-chip systems, the power management system cannot accurately count the number of events of IP function modules, especially when the counter is reset after the IP module restarts, resulting in inaccurate power consumption estimation.
By employing a combination of a counter register, a counter mirror register, and a base register, connected via hardware wiring, the count value is accumulated when the IP function module is powered off, and the target count value is periodically updated when powered on, ensuring the continuity and accuracy of the count.
It reduces the consumption of power management system hardware and software resources, improves the accuracy of IP event counting, and ensures the continuity and accuracy of counting during IP module restart.
Smart Images

Figure CN121523735A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of electronic information technology, and in particular to an IP event counting device, method, equipment and storage medium. BACKGROUND
[0002] In a system on chip (SOC), a power management system estimates IP (Intellectual Property) power consumption according to counting of various IP events in a period of time. The power management system generally reads the count of a specific IP event at a fixed frequency, calculates the difference between two consecutive counts, and the difference is the number of occurrences of the IP event in the period of time, so as to calculate the power consumption of the IP function module in the period of time. In actual operation, the IP function module will be turned off and restarted as needed, and after restarting, all counts of the IP will be restarted from 0. At this time, the two consecutive counts cannot reflect the real number of events.
[0003] When the power management system is responsible for the power-on and power-off of the IP, there will be no problem, because the power management system can obtain the time when the counter is reset to zero. When the power-on and power-off of the IP is responsible by other systems, the power management system cannot know when the counter will be 0. In order to solve this problem, the IP needs to send a signal to the power management system before and after each restart, and the power management system calculates the count value of the event in the two cases (whether restarted) by different methods. SUMMARY
[0004] Embodiments of the present application provide an IP event counting device, method, equipment and storage medium, which can reduce the occupation of software and hardware resources of the power management system, and improve the accuracy of IP event counting.
[0005] In a first aspect, embodiments of the present application provide an IP event counting device, comprising: an IP function module and a power management module; the IP function module comprises a counting register; the power management module comprises a counting mirror register and a base register;
[0006] The counting register and the counting mirror register are connected by hardware connection. The counting register is used to store a first count value. The counting mirror register is used to store a second count value. The base register is used to store a third count value. The first count value represents the number of occurrences of a preset IP event in the IP function module. The second count value is equal to the first count value, and the second count value is synchronized from the counting register.
[0007] When the IP function module is powered off, the IP function module reads the first count value from the count register and the third count value from the base register, accumulates the first count value and the third count value, and writes the accumulation result into the base register as a new third count value;
[0008] When the IP function module is powered on, the power management module reads the second count value from the count mirror register every set time length, accumulates the read second count value and the third count value through an adder, and determines the accumulation result as a target count value of the preset IP event.
[0009] In a second aspect, an embodiment of the present application further provides an IP event counting method, which is executed by the IP event counting device.
[0010] When the IP function module is powered off, the IP function module reads the first count value from the count register and the third count value from the base register, accumulates the first count value and the third count value, and writes the accumulation result into the base register as a new third count value;
[0011] When the IP function module is powered on, the power management module reads the second count value from the count mirror register every set time length, accumulates the read second count value and the third count value through an adder, and determines the accumulation result as a target count value of the preset IP event.
[0012] In a third aspect, an embodiment of the present application further provides an electronic device, which comprises:
[0013] at least one processor; and
[0014] a memory connected with the at least one processor in communication; wherein
[0015] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the IP event counting method.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores computer instructions for enabling a processor to execute the IP event counting method when the processor executes the computer instructions.
[0017] The embodiment of the present application discloses an IP event counting device, method, equipment and storage medium. The device comprises an IP function module and a power management module; the IP function module comprises a counting register; the power management module comprises a counting mirror register and a base register; the counting register and the counting mirror register are connected by hardware wiring; the counting register is used for storing a first counting value; the counting mirror register is used for storing a second counting value; the base register is used for storing a third counting value; wherein the first counting value represents the number of times of a preset IP event in the IP function module, the second counting value is equal to the first counting value, and the second counting value is synchronized from the counting register; when the IP function module is powered off, the IP function module reads the first counting value from the counting register and the third counting value from the base register, adds the first counting value and the third counting value, and writes the addition result into the base register as a new third counting value; when the IP function module is in a power-on state, the power management module reads the second counting value from the counting mirror register every set time length, adds the read second counting value and the third counting value through an adder, and determines the addition result as a target counting value of the preset IP event. The IP event counting device provided by the embodiment of the present application can obtain the count of the IP event without considering whether the IP function module has experienced a restart, can reduce the software complexity of the power management module, can reduce the occupation of the software and hardware resources of the power management system, and can improve the accuracy of IP event counting. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a structural schematic diagram of an IP event counting device in the embodiment one of the present application;
[0019] Figure 2 is a structural schematic diagram of an IP event counting device in the embodiment one of the present application;
[0020] Figure 3 is a flow chart of an IP event counting method in the embodiment two of the present application;
[0021] Figure 4 is a structural schematic diagram of an electronic equipment in the embodiment three of the present application. DETAILED DESCRIPTION
[0022] In order to enable the persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor should belong to the protection scope of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0025] Example 1
[0026] Figure 1 This is a schematic diagram of the structure of an IP event counting device provided in Embodiment 1 of the present invention, as shown below. Figure 1 As shown, the device includes: an IP function module 110 and a power management module 120; the IP function module 110 includes a counter register 111; the power management module includes a counter mirror register 121 and a base register 122.
[0027] The counter register 111 and the counter mirror register 121 are connected via hardware wiring. The counter register 111 stores a first count value; the counter mirror register 121 stores a second count value; and the base register 122 stores a third count value. The first count value represents the number of times a preset IP event has occurred in the IP function module, and the second count value is equal to the first count value, which is synchronized from the counter register.
[0028] When the IP function module 110 is powered off, the IP function module 110 reads the first count value from the counter register 111 and the third count value from the base register 122, accumulates the first count value and the third count value, and writes the accumulation result into the base register 122 as the new third count value.
[0029] When the IP function module is powered on, the power management module reads the second count value from the counter mirror register every set time interval, and adds the read second count value to the third count value through an adder, and determines the accumulated result as the target count value of the preset IP event.
[0030] In the embodiment, when the IP function module 110 is powered on, the first count value in the count register 111 is initialized to 0; then the number of preset IP events occurring in real time is recorded. The count mirror register 121 in the power management module 120 keeps the same value as the count register 111 through hardware connection. When the power management module 120 is powered on, the third count value in the base register 122 is initialized to 0.
[0031] In the embodiment, when the IP function module is powered off, the corresponding driver reads the first count value Rc from the count register 111 and the third count value Rb from the base register 122, and writes their sum into the base register 122 as a new third count value Rb (i.e. Rb = Rc + Rb). When the IP is powered on again, the target count value (Rm + Rb) read by the power management module is still continuous, and is completely unaffected by the IP power-off and power-on process and the number of times.
[0032] Optionally, Figure 2 is a structural schematic diagram of an IP event counting device provided by the embodiment of the application, as Figure 2 The power management module further includes a signal monitor 123; the signal monitor 123 is used to receive the state signal of the IP function module. The state signal includes a high-level signal and a low-level signal.
[0033] The state signal of the IP function module can be directly sent to the signal monitor by other power management modules supplying power to the IP function module or forwarded to the signal monitor by the IP function module.
[0034] In the embodiment, when the IP function module is powered on, the state signal of the IP is a high-level signal, and when the IP is powered off, the state signal of the IP is a low-level signal. The state signal is an input signal of the power management module 120, and the time when the state signal is sent to the signal monitor 123 is earlier than the time when the IP function module really enters the power-on and power-off state, so that the power management module has time to update the third count value in the base register 122.
[0035] In the embodiment, when the signal monitor receives the low-level signal, the power management module 120 reads the second count value from the count mirror register 121 and the third count value from the base register 122, and adds the second count value and the third count value, and writes the addition result into the base register 122 as a new third count value.
[0036] Specifically, when the signal monitor detects the falling edge of the IP state signal, the first count value Rc is read from the count register 111 and the third count value Rb is read from the base register 122, and their sum is written into the base register 122 as a new third count value Rb (i.e. Rb = Rc + Rb). When the IP is powered on to count next time, the count (Rm + Rb) read by the power management module is still continuous, and is completely unaffected by the IP power-off, power-on process and the number of times.
[0037] In the embodiment, the difference between the two adjacent target count values is determined, and the power consumption of the preset IP event within the set time length is determined based on the difference.
[0038] In the embodiment, when the IP function module is powered off, the third count value Rb in the base register is updated to Rm + Rb or Rc + Rb, and when the IP is powered on to count next time, the count (Rm + Rb) read by the power management module is still continuous, and is completely unaffected by the IP power-off, power-on process and the number of times.
[0039] The IP event counting device provided in the embodiment includes an IP function module and a power management module; the IP function module includes a count register; the power management module includes a count mirror register and a base register; the count register and the count mirror register are connected by hardware wiring; the count register is used to store a first count value; the count mirror register is used to store a second count value; the base register is used to store a third count value; wherein the first count value represents the number of times of occurrence of a preset IP event in the IP function module, the second count value is equal to the first count value, and the second count value is synchronized from the count register; when the IP function module is powered off, the IP function module reads the first count value from the count register and the third count value from the base register, and adds the first count value and the third count value, and writes the addition result into the base register as a new third count value; when the IP function module is in a power-on state, the power management module reads the second count value from the count mirror register every set time length, and adds the read second count value and the third count value through an adder, and determines the addition result as a target count value of the preset IP event. The IP event counting device provided in the embodiment can obtain the count of the IP event without considering whether the IP function module has experienced a restart, can reduce the software complexity of the power management module, can reduce the occupation of the software and hardware resources of the power management system, and can improve the accuracy of the IP event count.
[0040] Embodiment two
[0041] Figure 3 is a flowchart of an IP event counting method provided in the embodiment two of the present application, and the method is executed by the IP event counting device of the embodiment of the present application, as shown inFigure 3 The method comprises the following steps of:
[0042] S310, when the IP function module is powered off, the IP function module reads the first count value from the count register and reads the third count value from the base register; the first count value and the third count value are accumulated; and the accumulation result is written into the base register as a new third count value.
[0043] S320, when the IP function module is in a powered-on state, the power management module reads the second count value from the count mirror register every set time length, and the read second count value and the third count value are accumulated through an adder, and the accumulation result is determined as a target count value of the preset IP event.
[0044] Optionally, the method further comprises the following steps: when the signal monitor in the power management module receives a low-level signal, the power management module reads the second count value from the count mirror register and reads the third count value from the base register; the second count value and the third count value are accumulated; and the accumulation result is written into the base register as a new third count value.
[0045] Optionally, the method further comprises the following steps: determining the difference between two adjacent target count values, and determining the power consumption of the preset IP event within the set time length based on the difference.
[0046] The technical scheme of the embodiment, when the IP function module is powered off, the IP function module reads the first count value from the count register and reads the third count value from the base register; the first count value and the third count value are accumulated; and the accumulation result is written into the base register as a new third count value; when the IP function module is in a powered-on state, the power management module reads the second count value from the count mirror register every set time length, and the read second count value and the third count value are accumulated through an adder, and the accumulation result is determined as a target count value of the preset IP event. The IP event counting device provided by the embodiment can reduce the software complexity of the power management module, reduce the occupation of the software and hardware resources of the power management system, and improve the accuracy of IP event counting.
[0047] Embodiment three
[0048] Figure 4A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0049] As shown in Figure 4 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected to the at least one processor 11 in communication, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0050] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0051] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the counting method of IP events.
[0052] In some embodiments, the counting method of IP events can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, portions of the computer program or all of the computer program can be loaded onto the electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the counting method of IP events as described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the counting method of IP events by other any suitable means, e.g., by way of firmware.
[0053] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0054] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the computer or other programmable data processing apparatus, enables the systems and methods as claimed in the claims to be implemented. The computer program can be executed entirely on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0055] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0056] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0057] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.
[0058] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0059] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0060] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A counting device for IP events, characterized in that, include: An IP function module and a power management module; the IP function module includes a counter register; the power management module includes a counter mirror register and a base register; The counting register and the counting mirror register are connected via hardware wiring; the counting register is used to store a first count value; the counting mirror register is used to store a second count value; the base register is used to store a third count value; wherein, the first count value represents the number of times a preset IP event occurs in the IP function module, the second count value is equal to the first count value, and the second count value is synchronized from the counting register; When the IP function module is powered off, the IP function module reads the first count value from the counter register and the third count value from the base register, accumulates the first count value and the third count value, and writes the accumulation result into the base register as the new third count value; When the IP function module is powered on, the power management module reads the second count value from the counter mirror register at set intervals, and adds the read second count value to the third count value through an adder, and determines the accumulated result as the target count value of the preset IP event.
2. The apparatus according to claim 1, characterized in that, The power management module also includes a signal monitor; the signal monitor is used to receive status signals from the IP function module; wherein the status signals include high-level signals and low-level signals.
3. The apparatus according to claim 2, characterized in that, When the signal monitor receives a low-level signal, the power management module reads the second count value from the counter mirror register and the third count value from the base register, accumulates the second count value and the third count value, and writes the accumulation result into the base register as the new third count value.
4. The apparatus according to claim 1 or 2, characterized in that, Determine the difference between two adjacent target count values, and determine the power consumption of the preset IP event within the set duration based on the difference.
5. The apparatus according to claim 1, characterized in that, When the IP function module is powered on, the first count value in the counter register is initialized to 0; when the power management module is powered on, the third count value in the base register is initialized to 0.
6. A method for counting IP events, characterized in that, The method is performed by the IP event counting device according to any one of claims 1-5, and includes: When the IP function module is powered off, the IP function module reads a first count value from the counter register and a third count value from the base register; accumulates the first count value and the third count value; and writes the accumulation result into the base register as a new third count value. When the IP function module is powered on, the power management module reads the second count value from the counter mirror register at set intervals, and adds the read second count value to the third count value through an adder, and determines the accumulated result as the target count value of the preset IP event.
7. The method according to claim 6, characterized in that, Also includes: When the signal monitor in the power management module receives a low-level signal, the power management module reads a second count value from the counter mirror register and a third count value from the base register. The second count value and the third count value are summed. The accumulated result is written to the base register as a new third count value.
8. The method according to claim 6, characterized in that, Also includes: Determine the difference between two adjacent target count values, and determine the power consumption of the preset IP event within the set duration based on the difference.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the IP event counting method according to any one of claims 6-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the method for counting IP events according to any one of claims 6-8.
Citation Information
Patent Citations
Low-power-consumption control circuit based on level detection
CN104793723A
Detection of known workload patterns
CN113544625A
Devices, systems, and methods for concurrently storing multiple PMON counts in single register
CN114661350A
Method of analyzing a usage amount of information processing device, information processing system and computer readable recording medium
US20130117596A1
Power monitoring for a processing platform
US20200201408A1
Cited By
Timer and system-on-chip
CN121807774A
Event counting method and device, electronic equipment and storage medium
CN121832735A
An event counting method, apparatus, electronic device, and storage medium
CN121832735B