Power consumption detection method and chip

By sampling and flipping value calculation of the signal of each functional module in the chip, combined with power consumption correction parameters, the problem of insufficient accuracy of chip power consumption evaluation in the existing technology is solved, and higher evaluation accuracy and cost-effectiveness are achieved.

CN120629882APending Publication Date: 2025-09-12CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510846313.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing chip power consumption evaluation methods rely on selected observation signals, resulting in insufficient evaluation accuracy, especially when different modules have different design criteria, resulting in large errors.

Method used

By sampling each signal of each functional module of the chip within a preset time, the flip value is obtained, the power consumption is calculated using the flip value and the preset conversion coefficient, and then corrected using the power consumption correction parameter to ensure the accuracy of the evaluation.

Benefits of technology

It improves the accuracy of chip power consumption assessment, reduces manpower and time costs, reduces chip area occupation, and improves flexibility and convenience of layout and routing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120629882A_ABST
    Figure CN120629882A_ABST
Patent Text Reader

Abstract

The invention provides a power consumption detection method and a chip, and relates to the technical field of chips. The power consumption detection method comprises the following steps: for each functional module in a chip, sampling each signal in the functional module within a preset duration to obtain a flip value corresponding to each signal; wherein the turnover value represents the magnitude of the signal turnover speed; obtaining the power consumption corresponding to the function module based on the flip value corresponding to each signal in the function module and a preset conversion coefficient of the flip value and the power consumption; and summing the power consumption values corresponding to all the function modules, and correcting the power consumption obtained by summing based on a pre-obtained power consumption correction parameter to obtain the power consumption of the chip. The power consumption obtained by summing the power consumption values corresponding to all the function modules is corrected through the power consumption correction parameter, so that the finally obtained detection power consumption is more fit with the actual power consumption of the chip, and the accuracy of power consumption detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of chips, and in particular to a power consumption detection method and a chip. Background Art

[0002] As semiconductor manufacturing processes move toward nanometer scale, major chip design and manufacturing companies continue to push the limits of Moore's Law, making chip power consumption assessment increasingly important. During chip operation, power consumption is monitored to provide feedback and determine whether the operating device needs to reduce frequency or control power to protect the circuit.

[0003] Existing chip power consumption assessment methods typically use selected observation signals to estimate the chip's power consumption. However, the accuracy of this assessment method depends on the selected observation signals, and the design criteria of different modules within the chip may vary, resulting in a large error between the final estimated chip power consumption and the actual power consumption. Summary of the Invention

[0004] The present application provides a power consumption detection method and a chip to improve the accuracy of evaluating chip power consumption.

[0005] In the first aspect, the present application provides a power consumption detection method, comprising: for each functional module in a chip: within a preset time length, sampling each signal in the functional module separately to obtain a flip value corresponding to each signal; wherein the flip value represents the magnitude of the signal flip speed; based on the flip value corresponding to each signal in the functional module, and the preset conversion coefficient of the flip value and the power consumption, obtaining the power consumption corresponding to the functional module; summing the power consumption values ​​corresponding to all functional modules, and correcting the power consumption obtained by the sum based on the power consumption correction parameter obtained in advance to obtain the power consumption of the chip.

[0006] In the embodiment of the present application, since the flip value represents the magnitude of the signal flip speed, and within a preset time period, the faster the signal flip speed, the greater the power consumption of the signal, the flip value of each signal is collected as a condition for power consumption evaluation. In addition, the power consumption obtained by summing the power consumption values ​​corresponding to all functional modules is corrected using the power consumption correction parameter, so that the final detected power consumption is more closely aligned with the actual power consumption of the chip, thereby improving the accuracy of the power consumption detection.

[0007] In combination with the technical solution provided in the first aspect above, in some possible implementations, the power consumption corresponding to the functional module is obtained based on the flip value corresponding to each signal flowing through the functional module, and the preset conversion coefficient of the flip value and the power consumption, including: performing weighted summation based on the flip value corresponding to each signal in the functional module and the conversion coefficient corresponding to each signal to obtain the power consumption corresponding to the functional module.

[0008] In combination with the technical solution provided in the first aspect above, in some possible implementations, each signal in the functional module is sampled separately to obtain a flip value corresponding to each signal, including: for each signal in the functional module, sampling the signal within a preset time length; when the signal flips n times, adding one to the flip value corresponding to the signal; wherein n is an integer greater than or equal to 1.

[0009] In the embodiment of the present application, since the flip value corresponding to the signal is increased by 1 every time the signal flips n times, the more times the signal flips, the larger the corresponding flip value, so that the flip value can reflect the magnitude of the signal flip speed.

[0010] In combination with the technical solution provided in the first aspect above, in some possible implementations, the conversion coefficient corresponding to each signal in each functional module is obtained in the following manner: in each of the preset multiple application scenarios: for each functional module in the chip, each signal in the functional module is tested and sampled separately to obtain the test flip value corresponding to each signal in each application scenario; power consumption simulation is performed on each functional module in the chip to obtain the simulated power consumption value corresponding to each functional module; fitting is performed based on the simulated power consumption value corresponding to the functional module in each application scenario and the test flip value corresponding to each signal in each application scenario to obtain the conversion coefficient corresponding to each signal in the functional module.

[0011] In combination with the technical solution provided in the first aspect above, in some possible implementations, the method also includes: when the operating voltage of the chip changes, for each functional module in the chip: for the simulated power consumption value corresponding to each application scenario, based on the ratio of the square value of the operating voltage value to the square value of the changed operating voltage value, and the simulated power consumption value corresponding to the functional module, determine the new simulated power consumption value corresponding to the functional module in the application scenario after the operating voltage changes; based on the new simulated power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, fit is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0012] In the embodiment of the present application, since power consumption is proportional to the square of the operating voltage, the new simulated power consumption value corresponding to the functional module after the operating voltage change can be determined by taking the ratio of the square of the operating voltage value to the square of the changed operating voltage value, and the simulated power consumption value corresponding to the functional module. A new fitting can then be performed to obtain a new conversion coefficient. This eliminates the need to perform power consumption simulation on the chip again, reducing workload, manpower, and time costs.

[0013] In combination with the technical solution provided in the first aspect above, in some possible implementations, the method also includes: when the frequency of the chip changes, for each functional module in the chip: for each application scenario, each signal in the functional module is re-tested and sampled to obtain a new test flip value corresponding to each signal; for the simulation power consumption value corresponding to each application scenario, based on the ratio of the frequency before the change to the frequency after the change, and the simulation power consumption value corresponding to the functional module, the new simulation power consumption value corresponding to the functional module in each application scenario after the frequency change is determined; based on the corresponding new simulation power consumption value in each application scenario and the test flip value corresponding to each signal in the functional module, fitting is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0014] In the embodiment of the present application, since the power consumption and frequency satisfy the ratio of the power consumption before the change to the power consumption after the change, which is equal to the ratio of the frequency before the change to the frequency after the change, based on the ratio of the frequency before the change to the frequency after the change, and the simulated power consumption value corresponding to the functional module, the new simulated power consumption value corresponding to the functional module after the frequency change can be determined. This eliminates the need to perform power consumption simulation on the chip again, reducing workload, manpower, and time costs.

[0015] In combination with the technical solution provided in the first aspect above, in some possible implementations, the method further includes: when the bandwidth of the chip changes, for each functional module in the chip: for each application scenario, based on the ratio of the bandwidth before the change to the bandwidth after the change, and the simulated power consumption value corresponding to the functional module, determine the new simulated power consumption value corresponding to the functional module in the application scenario after the bandwidth changes; based on the new simulated power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, fit is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0016] In the embodiment of the present application, since the power consumption and bandwidth satisfy the ratio of the power consumption before the change to the power consumption after the change, which is equal to the ratio of the bandwidth before the change to the bandwidth after the change, the new simulated power consumption value corresponding to the functional module after the bandwidth change can be determined based on the ratio of the bandwidth before the change to the bandwidth after the change, and the simulated power consumption value corresponding to the functional module. This eliminates the need to perform power consumption simulation on the chip again, reducing workload, manpower, and time costs.

[0017] In combination with the technical solution provided in the first aspect above, in some possible implementations, the power consumption correction parameter is obtained by: obtaining the actual power consumption of the chip and the detected power consumption of the chip; the detected power consumption is: the sum of the power consumption obtained based on the flip value and the conversion coefficient of each functional module in the chip; calculating the ratio of the actual power consumption and the detected power consumption, and the ratio is the power consumption correction parameter.

[0018] In the embodiment of the present application, since the power consumption correction parameter is the ratio of the actual power consumption to the detected power consumption, the power consumption correction parameter can reflect the difference between the detected power consumption and the actual power consumption. Therefore, the power consumption estimated based on the conversion coefficient can be corrected through the power consumption correction parameter to improve the accuracy of power consumption detection.

[0019] In the second aspect, the present application provides a chip, comprising: multiple functional modules and a power consumption detection circuit, wherein the power consumption detection circuit is connected to each of the functional modules; the power consumption detection circuit is used for each module in the chip: within a preset time length, each signal in the functional module is sampled separately to obtain a flip value corresponding to each signal; wherein the flip value represents the magnitude of the signal flip speed; based on the flip value corresponding to each signal in the functional module, and the preset conversion coefficient between the flip value and the power consumption, the power consumption corresponding to the functional module is obtained; the power consumption values ​​corresponding to all functional modules are summed, and the power consumption obtained by the sum is corrected based on the pre-acquired power consumption correction parameters to obtain the power consumption of the chip.

[0020] In the embodiment of the present application, the power consumption of each module is detected by a power consumption detection circuit connected to each functional module, thereby obtaining the overall power consumption of the chip. Since the flip value represents the magnitude of the signal flip speed, and within a preset time period, the faster the signal flip speed, the greater the power consumption of the signal, the flip value of each signal is collected as a condition for power consumption evaluation. In addition, the power consumption obtained by summing the power consumption values ​​corresponding to all functional modules is corrected using a power consumption correction parameter, so that the final detected power consumption is more closely aligned with the actual power consumption of the chip, thereby improving the accuracy of the power consumption detection.

[0021] In combination with the technical solution provided in the second aspect above, in some possible implementations, the power consumption detection circuit includes a power consumption detection main module and multiple power consumption detection sub-modules; each of the power consumption detection sub-modules is connected to at least one of the functional modules; each of the power consumption detection sub-modules is used to sample the signal of the functional module corresponding to itself to obtain the flip value corresponding to each signal; based on the flip value corresponding to each signal in the functional module, and the conversion coefficient of the preset flip value and power consumption, the power consumption corresponding to the functional module is obtained; the power consumption detection main module is used to obtain the power consumption corresponding to each of the functional modules, and sum the power consumption values ​​corresponding to all the functional modules, and correct the power consumption obtained by the sum based on the pre-acquired power consumption correction parameters to obtain the power consumption of the chip.

[0022] In the embodiment of the present application, multiple power consumption detection submodules are used to detect the power consumption of different functional modules, thereby facilitating the layout and wiring of the chip. At the same time, the power consumption of each functional module can be accurately obtained, thereby improving the accuracy of the final chip power consumption.

[0023] In combination with the technical solution provided in the second aspect above, in some possible implementations, the power consumption detection circuit includes a power consumption detection main module and multiple sampling modules; each sampling module is connected to at least one of the functional modules; each sampling module is used to sample the signal of the functional module corresponding to itself to obtain the flip value corresponding to each signal; the power consumption detection main module is used to obtain the flip value corresponding to each signal in each functional module, and based on the flip value corresponding to each signal in the functional module, and the preset flip value and power consumption conversion coefficient, obtain the power consumption corresponding to the functional module; the power consumption values ​​corresponding to all the functional modules are summed, and the power consumption obtained by the sum is corrected based on the pre-acquired power consumption correction parameter to obtain the power consumption of the chip.

[0024] In the embodiment of the present application, multiple sampling modules are used to sample signals from different modules. Finally, the power consumption of each module is calculated using the flip values ​​obtained through sampling by the power consumption detection module, and ultimately the power consumption of the chip is obtained. This method concentrates the modules that calculate power consumption in the power consumption detection module, thereby reducing the chip area occupied. At the same time, the method of sampling through multiple sampling modules can be more flexible in layout and wiring, improving the flexibility of this solution.

[0025] In combination with the technical solution provided in the second aspect above, in some possible implementations, the same signal flowing through multiple functional modules is sampled by the same sampling module.

[0026] In the embodiment of the present application, the same signal flowing through multiple functional modules is sampled by the same sampling module, thereby reducing repeated sampling of the same signal, thereby reducing the number of sampling modules and reducing the chip area occupied. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without any creative work.

[0028] Figure 1 A schematic diagram of a power consumption detection method according to an embodiment of the present application; Figure 2 This is a schematic diagram showing the connections between different functional modules in a chip according to an embodiment of the present application; Figure 3 This is a structural block diagram of a chip shown in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0030] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in the subsequent figures. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "comprise a..." do not exclude the presence of other identical elements in the process, method, article or equipment including the elements.

[0031] In the description of this application, unless otherwise clearly specified or limited, the terms "disposed" and "connected" should be understood in a broad sense. For example, it can be directly connected, indirectly connected through an intermediate medium, or internally connected between two elements.

[0032] The technical solution of this application will be described in detail below with reference to the accompanying drawings.

[0033] See also Figure 1 , Figure 1 This is a power consumption detection method shown in the embodiment of the present application. Figure 1 Describe the steps it involves.

[0034] S100: For each functional module in the chip: within a preset time period, each signal in the functional module is sampled respectively to obtain a flip value corresponding to each signal.

[0035] The flip value represents the magnitude of the signal flip speed.

[0036] The preset duration can be set according to actual needs, for example, it can be 10 milliseconds, 20 milliseconds, 30 milliseconds, 40 milliseconds, 1 second, etc. The specific value of the preset duration is not limited here.

[0037] Functional modules can be, for example, PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) modules connected to graphics cards, SSDs (Solid State Disks), modules connected to memory, and modules that exchange data with cores (CPU cores, etc.).

[0038] Optionally, the sampled signal may be, for example, wr_signal (a signal for controlling a write operation), rd_signal (a signal for controlling a read operation), request_signal (a signal representing request information), response_signal (a signal representing response information), or the like.

[0039] If the signal is a bidirectional transmission signal, it is necessary to sample both bidirectional signals of the signal.

[0040] Sampling can be the number of times the collected signal flips, that is, when the signal flips from 0 (low-level signal) to 1 (high-level signal), the number of flips increases by one; when the signal flips from 1 to 0, the number of flips increases by one.

[0041] In one implementation, when sampling each signal in the functional module, it is necessary to ensure that the sampling foreground conditions are the same, for example, all are in a low power consumption state, or all are in a normal working state.

[0042] In one embodiment, each signal in the functional module is sampled separately to obtain a corresponding flip value for each signal. A specific method may be: for each signal in the functional module, the signal is sampled within a preset time period. Every time the signal flips n times, the corresponding flip value of the signal is incremented by one, where n is an integer greater than or equal to 1.

[0043] For example, when n is 1, that is, each time the signal flips, the flip value increases by one.

[0044] When n is 5, the flip value increases by 1 every time the signal flips five times. If, by the end of the preset time period, the number of flips of the signal is 5a+b, and b is a value among 1, 2, 3, and 4, then the flip value is a. This example is only for ease of understanding and should not be construed as a limitation of this application.

[0045] Optionally, each signal in the functional module is sampled separately to obtain the corresponding flip value of each signal by detecting the number of flips of the signal within a preset time period, and then dividing the number of flips by the preset time period to obtain the flip value.

[0046] The flip value obtained by dividing the flip count by the preset duration may be a decimal, or the integer part of the quotient of the flip count divided by the preset duration may be used as the flip value.

[0047] Because the same signal may flow through multiple functional modules, sampling of this signal can be performed in only one module. When subsequently calculating the power consumption of other functional modules, the sampled flipped values ​​can be reused to reduce repeated sampling.

[0048] For ease of understanding, Figure 2 The module connection shown is taken as an example.

[0049] Since modules A, B, C, and F all point to DRAM (Dynamic Random Access Memory) after interacting with module D, and modules A, B, and C are all connected only to module D, the signals in modules A, B, and C must flow into module D. Therefore, in this case, all signals from modules A, B, C, and D can be sampled in module D. In other words, only the signals in module D need to be sampled, and the flipped values ​​of the signals in modules A, B, and C can be taken from the flipped values ​​sampled in module D.

[0050] Module F transmits signals to both modules G and D. Therefore, all signals in module G can be sampled in module F, while signals transmitted between modules F and D are sampled in module D or module F. This way, each signal only needs to be sampled once, reducing repeated sampling.

[0051] The examples here are only for ease of understanding and should not be construed as limiting this application.

[0052] S200: For each functional module in the chip: based on the flip value corresponding to each signal in the functional module and a preset conversion coefficient between the flip value and the power consumption, obtain the power consumption corresponding to the functional module.

[0053] In one embodiment, based on the flip value corresponding to each signal in the functional module and the preset conversion coefficient of the flip value and the power consumption, the specific method of obtaining the power consumption corresponding to the functional module can be: based on the flip value corresponding to each signal in the functional module and the conversion coefficient corresponding to each signal, weighted summation is performed to obtain the power consumption corresponding to the functional module.

[0054] For ease of understanding, p represents power consumption, cac k Indicates the flip value of the kth signal, wt k Indicates the conversion coefficient corresponding to the kth signal, k ranges from 0 to m, then the power consumption Where m is the number of signals in the module minus 1 (since k in the formula starts at 0, m is the number of signals in the module minus 1).

[0055] In one embodiment, the conversion coefficient corresponding to each signal in each functional module is obtained in the following manner: in each of a plurality of preset application scenarios: first, for each functional module in the chip, each signal in the functional module is tested and sampled separately to obtain the test flip value corresponding to each signal in each application scenario. Then, power consumption simulation is performed on each functional module in the chip to obtain the simulated power consumption value corresponding to each functional module. Finally, based on the simulated power consumption value corresponding to the functional module in each application scenario and the test flip value corresponding to each signal in each application scenario, fitting is performed to obtain the conversion coefficient corresponding to each signal in the functional module.

[0056] Among them, in the process of obtaining the conversion coefficient, the specific method of testing and sampling each signal in each functional module in the chip is the same as the specific method of sampling each signal in the functional module mentioned above. For the sake of brief description, it will not be repeated here.

[0057] The specific method of performing power consumption simulation on each functional module in the chip can be selected according to actual needs and can be any type of existing simulation method, and its specific method is not limited here.

[0058] Optionally, the least non-negative square method may be used to fit the simulation power consumption value corresponding to the functional module and the test flip value corresponding to each signal in the functional module.

[0059] The least squares method can be understood as a process of solving m equations and n unknowns. The unknowns are the conversion coefficients corresponding to each signal.

[0060] C 01 W0+ C oz W1+ C 03 W2= y0 С 11 W0+ С 12 W1+ С 13 W2= у1 C 21 W0+ C 22 W1+ C 23 W2=y2 a represents the ath application scenario, b represents the bth signal, C ab That is, sampling the flip value of the bth signal in scene a, W b is the weight value of the bth signal to be obtained, y a The simulation tool obtains the simulated power consumption value in scenario a.

[0061] The flip values ​​obtained in different simulation scenarios (C ab ) are different, and after being substituted into the equation, the conversion coefficient (W b ) value.

[0062] In one embodiment, the number of application scenarios is greater than or equal to the number of signals in the functional module, so that the system of equations obtained by the least squares method can be solved.

[0063] Optionally, the number of application scenarios is greater than or equal to twice the number of signals in the functional module.

[0064] Optionally, when the chip is not transmitting data, each signal in each functional module in the chip can be sampled separately to obtain a calibration rollover value corresponding to each signal. Then, power consumption simulation is performed on each functional module in the chip to obtain a calibrated power consumption value corresponding to each functional module. Finally, the fitting results are calibrated based on the calibrated power consumption values ​​and the calibrated rollover values.

[0065] Optionally, a specific method for calibrating the fitting results based on the calibrated power consumption value and the calibrated flip value can be to sample the clk signal (clock signal) in each functional module in the chip when the chip is not transmitting data, and obtain the power consumption of the functional module in an idle state with no data transmission, when only the clk signal is flipped and all other sampled signals are 0. Then, multiple power consumption simulations with data transmission are performed on each functional module in the chip to obtain a calibrated power consumption value corresponding to each functional module. Finally, the fitting results are optimized based on this calibrated power consumption value and the calibrated power consumption value.

[0066] In actual use, the chip's operating voltage, frequency, and bandwidth may be adjusted based on actual conditions. Therefore, to reduce the workload of re-determining the conversion coefficients corresponding to each signal caused by these adjustments, the following methods are provided for re-determining the conversion coefficients in several situations.

[0067] In one embodiment, when the operating voltage of a chip changes, for each functional module in the chip, the following can be done: first, for each application scenario, based on the ratio of the square of the operating voltage value to the square of the changed operating voltage value, and the simulated power consumption value corresponding to the functional module, a new simulated power consumption value corresponding to the functional module in the application scenario after the operating voltage change is determined. Then, based on the new simulated power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, a fit is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0068] The relationship between the square value of the operating voltage value, the square value of the changed operating voltage value, the simulated power consumption value corresponding to the functional module, and the new simulated power consumption value corresponding to the functional module after the operating voltage changes can be expressed as follows: Where p0 represents the simulated power consumption value, p1 represents the new simulated power consumption value corresponding to the functional module after the operating voltage changes, v0 represents the operating voltage value, and v1 represents the operating voltage value after the change. Therefore, if the square of the operating voltage value, the square of the operating voltage value after the change, and the simulated power consumption value corresponding to the functional module are known, the new simulated power consumption value corresponding to the functional module after the operating voltage changes can be obtained.

[0069] The specific method of fitting based on the new simulation power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module to obtain the new conversion coefficient corresponding to each signal in the functional module is the same as the aforementioned specific method of fitting based on the simulation power consumption value corresponding to the functional module and the test flip value corresponding to each signal in the functional module to obtain the conversion coefficient corresponding to each signal in the functional module. For the sake of brief description, it will not be repeated here.

[0070] In one embodiment, when the frequency of a chip changes, for each functional module in the chip: first, for each application scenario, each signal in the functional module is retested and sampled to obtain a new test flip value corresponding to each signal. Then, for the simulation power consumption value corresponding to each application scenario, based on the ratio of the frequency before the change to the frequency after the change, and the simulation power consumption value corresponding to the functional module, the new simulation power consumption value corresponding to the functional module in each application scenario after the frequency change is determined. Finally, based on the corresponding new simulation power consumption value in each application scenario and the test flip value corresponding to each signal in the functional module, fitting is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0071] Since the flip speed of the signal may change when the frequency changes, it is necessary to sample the signal again to obtain the test flip value corresponding to each signal in the functional module after the frequency changes.

[0072] The relationship between the frequency before the change, the frequency after the change, the simulated power consumption value corresponding to the functional module, and the new simulated power consumption value corresponding to the functional module after the frequency change can be expressed as follows: Here, p0 represents the simulated power consumption value, p1 represents the new simulated power consumption value corresponding to the functional module after the frequency change, f0 represents the frequency before the change, and f1 represents the frequency after the change. Therefore, if the frequency before the change, the frequency after the change, and the simulated power consumption value corresponding to the functional module are known, the new simulated power consumption value corresponding to the functional module after the frequency change can be obtained.

[0073] The specific method of fitting based on the new simulated power consumption value and the test flip value corresponding to each signal in the functional module to obtain the new conversion coefficient corresponding to each signal in the functional module is the same as the aforementioned specific method of fitting based on the simulated power consumption value corresponding to the functional module and the test flip value corresponding to each signal in the functional module to obtain the conversion coefficient corresponding to each signal in the functional module. For the sake of brief description, it will not be repeated here.

[0074] In one embodiment, when the bandwidth of a chip changes, for each functional module in the chip: first, for each application scenario, based on the ratio of the bandwidth before the change to the bandwidth after the change, and the simulated power consumption value corresponding to the functional module, a new simulated power consumption value corresponding to the functional module in the application scenario after the bandwidth change is determined. Then, based on the new simulated power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, a fit is performed to obtain a new conversion coefficient corresponding to each signal in the functional module.

[0075] The relationship between the bandwidth before the change, the bandwidth after the change, the simulated power consumption value corresponding to the functional module, and the new simulated power consumption value corresponding to the functional module after the bandwidth change can be expressed as follows: Here, p0 represents the simulated power consumption value, p1 represents the new simulated power consumption value corresponding to the functional module after the bandwidth change, bw0 represents the bandwidth before the change, and bw1 represents the bandwidth after the change. Therefore, by determining the bandwidth before and after the change, and the simulated power consumption value corresponding to the functional module, the new simulated power consumption value corresponding to the functional module after the bandwidth change can be determined.

[0076] The specific method of fitting based on the new simulated power consumption value and the test flip value corresponding to each signal in the functional module to obtain the new conversion coefficient corresponding to each signal in the functional module is the same as the aforementioned specific method of fitting based on the simulated power consumption value corresponding to the functional module and the test flip value corresponding to each signal in the functional module to obtain the conversion coefficient corresponding to each signal in the functional module. For the sake of brief description, it will not be repeated here.

[0077] S300: Sum the power consumption values ​​corresponding to all functional modules, and correct the power consumption obtained by the sum based on a pre-acquired power consumption correction parameter to obtain the power consumption of the chip.

[0078] After obtaining the power consumption value corresponding to each functional module, the power consumption values ​​corresponding to all functional modules are summed up and corrected using the power consumption correction parameter to obtain the power consumption value of the chip.

[0079] The power consumption correction parameter may be used to perform correction by multiplying the power consumption correction parameter by the sum of the power consumption values ​​corresponding to all functional modules.

[0080] In one implementation, the power consumption correction parameter may be directly obtained from a third-party device.

[0081] Alternatively, the power consumption correction parameter may be obtained by first obtaining the actual power consumption of the chip and the detected power consumption of the chip. The detected power consumption is the sum of the power consumption of each functional module in the chip based on the flip value and the conversion coefficient. The ratio of the actual power consumption to the detected power consumption is then calculated, and the ratio is used as the power consumption correction parameter.

[0082] For ease of understanding, Wx represents actual power consumption, and Wy represents detected power consumption, and the power consumption correction parameter can be expressed as Wx / Wy.

[0083] Optionally, the actual power consumption and the detected power consumption of the chip are obtained in the same application scenario.

[0084] Optionally, the detection power consumption can be obtained by: for each functional module in the chip: sampling each signal in the functional module within a preset duration to obtain a rollover value corresponding to each signal. Based on the rollover value corresponding to each signal in the functional module and a preset conversion coefficient between the rollover value and power consumption, the power consumption corresponding to the functional module is obtained. Finally, the power consumption values ​​corresponding to all functional modules are summed to obtain the detection power consumption.

[0085] The method of obtaining the flip value corresponding to each signal and the method of obtaining the power consumption corresponding to each functional module have been clearly described in the previous text and will not be repeated here for the sake of simplicity.

[0086] Optionally, the actual power consumption of the chip may be the power consumption of the chip obtained by measuring the current and voltage on the chip (eg, a current measurement method).

[0087] Based on the same technical concept, the present application also provides a chip 100. Figure 3 As shown, the chip 100 includes multiple functional modules 110 and a power consumption detection circuit 120 , wherein the power consumption detection circuit 120 is connected to each functional module 110 .

[0088] The functional module 110 may be, for example, a PCIE module, a module connected to a memory, a module for exchanging data with a core, etc. The specific type of the functional module 110 is not limited herein.

[0089] The power consumption detection circuit 120 is used to sample each module in the chip 100: within a preset time period, sample each signal in the functional module 110 separately to obtain a flip value corresponding to each signal; wherein the flip value represents the magnitude of the signal flip speed; based on the flip value corresponding to each signal in the functional module 110, and the preset conversion coefficient between the flip value and the power consumption, obtain the power consumption corresponding to the functional module 110; sum the power consumption values ​​corresponding to all functional modules 110, and correct the power consumption obtained by the sum based on the power consumption correction parameter obtained in advance to obtain the power consumption of the chip 100.

[0090] The specific method for obtaining the conversion coefficient between the flip value and the power consumption corresponding to each signal in the functional module 110 has been clearly described above and will not be repeated here for the sake of brevity.

[0091] Optionally, the chip 100 may be, for example, a CPU (Central Processing Unit) system with an x86 architecture, an ARM (Advanced RISC Machines), a MIPS (Million Instructions Per Second), a RISC-V (RISC-V instruction set architecture), a single-core / multi-core CPU system, a multi-core / multi-core GPU (Graphics Processing Unit) system, etc.

[0092] In one implementation, the power consumption detection circuit 120 includes a power consumption detection main module and a plurality of power consumption detection sub-modules; each power consumption detection sub-module is correspondingly connected to at least one functional module 110 .

[0093] Each power consumption detection submodule is used to sample the signal of the functional module 110 corresponding to itself to obtain the flip value corresponding to each signal; based on the flip value corresponding to each signal in the functional module 110 and the preset conversion coefficient between the flip value and the power consumption, the power consumption corresponding to the functional module 110 is obtained.

[0094] The power consumption detection module is used to obtain the power consumption corresponding to each functional module 110, sum the power consumption values ​​corresponding to all functional modules 110, and correct the summed power consumption based on the pre-acquired power consumption correction parameters to obtain the power consumption of the chip 100.

[0095] Optionally, the power consumption detection module may be a dedicated calculation circuit composed of an adder, etc., so as to sum the power consumption values ​​corresponding to all functional modules 110 to obtain the power consumption of the chip 100 .

[0096] Alternatively, the power consumption detection module may also be a computing core (such as a Core, etc.) with computing capabilities within the multiplexing chip 100 .

[0097] Optionally, the power consumption detection submodule may include a sampling unit, a counting unit, a storage unit and a calculation unit.

[0098] The sampling unit is used to detect the rising edge and / or falling edge of the signal. Every time the signal is detected to have flipped n times, the counting unit increases by 1. The value of the counting unit is the flip value of the signal.

[0099] After the preset time period, the pre-stored conversion coefficient can be read from the storage unit, and the power consumption corresponding to the functional module 110 can be obtained by calculation through the calculation unit.

[0100] For example, the storage unit may pre-store the conversion coefficient corresponding to each signal in the module. After obtaining the flip value corresponding to each signal, the calculation unit may calculate the flip value corresponding to each signal in the functional module 110 and the conversion coefficient corresponding to each signal, perform weighted summation, and obtain the sum value to obtain the power consumption corresponding to the functional module 110.

[0101] After obtaining the flip value of each signal in the module, the calculation unit calculates the product of the flip value of each signal and the corresponding constant to obtain the power consumption of each signal. Then, the sum of the power consumption corresponding to all signals in the functional module 110 is calculated to obtain the power consumption corresponding to the functional module 110.

[0102] The storage unit may be an electronic component with a storage function, such as a register, a DDR (double data rate synchronous dynamic random access memory), or the like.

[0103] The sampling unit may be an electronic component such as a JK flip-flop, a T flip-flop, or the like.

[0104] The counting unit may be an electronic component such as a counter.

[0105] The specific circuit structure of the calculation unit can be set according to actual needs, as long as it can achieve the corresponding calculation function, and its specific structure is not limited here.

[0106] In one implementation, a power consumption detection submodule may be provided for each functional module 110 in the chip 100 .

[0107] Alternatively, one power consumption detection submodule may be used to sample signals in multiple functional modules 110 and calculate the power consumption of each of the multiple functional modules 110 .

[0108] Since the same signal may flow through multiple functional modules 110, for such signals, only one power consumption detection submodule can be used to sample and obtain the flip value of the signal. When power consumption calculation is required later, the different functional modules 110 through which the signal flows can reuse this flip value.

[0109] In one implementation, the power consumption detection circuit 120 may include a power consumption detection main module and a plurality of sampling modules; each sampling module is correspondingly connected to at least one functional module 110 .

[0110] Each sampling module is used to sample the signal of the functional module 110 corresponding to itself to obtain a flip value corresponding to each signal.

[0111] Optionally, the sampling module may include a sampling unit and a counting unit.

[0112] The sampling unit is used to detect the rising and / or falling edges of the signal. Every time n flips of the signal are detected, the counting unit increments by one. The value of the counting unit is the flip value of the signal. Where n is an integer greater than or equal to 1.

[0113] Optionally, the sampling unit may be an electronic component such as a JK flip-flop (a basic digital circuit storage unit), a T flip-flop, or the like.

[0114] Optionally, the counting unit may be an electronic component such as a counter.

[0115] The power consumption detection module is used to obtain the flip value corresponding to each signal in each functional module 110, and obtain the power consumption corresponding to the functional module 110 based on the flip value corresponding to each signal in the functional module 110 and the preset conversion coefficient between the flip value and the power consumption; sum the power consumption values ​​corresponding to all functional modules 110, and correct the power consumption obtained by the sum based on the power consumption correction parameter obtained in advance to obtain the power consumption of the chip 100.

[0116] The power consumption detection module may include a storage unit and a calculation unit. After obtaining the flipped value of each signal within the module sent by the sampling unit, the power consumption detection module reads the pre-stored conversion coefficient from the storage unit and calculates the power consumption corresponding to the functional module 110 through the calculation unit. After obtaining the power consumption corresponding to each functional module 110, the power consumption of the chip 100 is calculated.

[0117] Among them, the specific implementation method and principle of the storage unit are the same as the implementation method of the storage unit included in the aforementioned power consumption detection sub-module. The difference is that the storage unit included in the power consumption detection total module needs to store the conversion coefficient corresponding to each signal in all modules.

[0118] The specific circuit structure of the calculation unit can be set according to actual needs, as long as it can achieve the corresponding calculation function, and its specific structure is not limited here.

[0119] In one implementation, a sampling module may be provided for each functional module 110 in the chip 100 .

[0120] Alternatively, the signals in the multiple functional modules 110 may be sampled by one sampling module.

[0121] Since the same signal may flow through multiple functional modules 110, such a signal can be sampled by only one sampling module to obtain the flip value of the signal. When power consumption calculation is required later, the different functional modules 110 through which the signal flows can reuse this flip value.

[0122] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A power consumption detection method, characterized in that: include: For each functional module in the chip: Within a preset time period, each signal in the functional module is sampled respectively to obtain a flip value corresponding to each signal; wherein the flip value represents the magnitude of the signal flip speed; Based on the flip value corresponding to each signal in the functional module and a preset conversion coefficient between the flip value and the power consumption, the power consumption corresponding to the functional module is obtained; The power consumption values ​​corresponding to all functional modules are summed, and the power consumption obtained by the sum is corrected based on the power consumption correction parameter obtained in advance to obtain the power consumption of the chip.

2. The method according to claim 1, characterized in that Based on the flip value corresponding to each signal flowing through the functional module and a preset conversion coefficient between the flip value and the power consumption, the power consumption corresponding to the functional module is obtained, including: The power consumption corresponding to the functional module is obtained by performing weighted summation based on the flip value corresponding to each signal in the functional module and the conversion coefficient corresponding to each signal.

3. The method according to claim 1, characterized in that Each signal in the functional module is sampled separately to obtain the corresponding flip value of each signal, including: For each signal in the functional module, the signal is sampled within a preset time period; When the signal flips n times, the flip value corresponding to the signal is increased by one; wherein n is an integer greater than or equal to 1.

4. The method according to claim 1, wherein The conversion coefficient corresponding to each signal in each functional module is obtained in the following way: In each of the preset application scenarios: For each functional module in the chip, test sampling is performed on each signal in the functional module to obtain a test flip value corresponding to each signal in each application scenario; Performing power consumption simulation on each functional module in the chip to obtain a simulated power consumption value corresponding to each functional module; Based on the simulated power consumption value corresponding to the functional module in each application scenario and the test flip value corresponding to each signal in each application scenario, fitting is performed to obtain the conversion coefficient corresponding to each signal in the functional module.

5. The method according to claim 4, characterized in that The method further comprises: When the operating voltage of the chip changes, for each functional module in the chip: For each application scenario, the simulated power consumption value corresponding to the functional module is determined based on the ratio of the square of the operating voltage value to the square of the changed operating voltage value and the simulated power consumption value corresponding to the functional module in the application scenario after the operating voltage changes. Based on the new simulation power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, a new conversion coefficient corresponding to each signal in the functional module is obtained.

6. The method according to claim 4, characterized in that The method further comprises: When the frequency of the chip changes, for each functional module in the chip: For each application scenario, each signal in the functional module is re-tested and sampled to obtain a new test flip value corresponding to each signal; For each application scenario, the simulated power consumption value corresponding to the functional module is determined based on the ratio of the frequency before the change to the frequency after the change, and the simulated power consumption value corresponding to the functional module. A new simulated power consumption value corresponding to the functional module in each application scenario after the frequency change is determined. Based on the corresponding new simulation power consumption value in each application scenario and the test flip value corresponding to each signal in the functional module, a new conversion coefficient corresponding to each signal in the functional module is obtained.

7. The method according to claim 4, characterized in that The method further comprises: When the bandwidth of the chip changes, for each functional module in the chip: For each application scenario, based on the ratio of the bandwidth before the change to the bandwidth after the change, and the simulated power consumption value corresponding to the functional module, determine a new simulated power consumption value corresponding to the functional module in the application scenario after the bandwidth changes; Based on the new simulation power consumption value corresponding to each application scenario and the test flip value corresponding to each signal in the functional module, a new conversion coefficient corresponding to each signal in the functional module is obtained.

8. The method according to claim 1, characterized in that The power consumption correction parameter is obtained by: Obtaining actual power consumption of the chip and detected power consumption of the chip; the detected power consumption is: the sum of power consumptions obtained based on the flip value and the conversion coefficient of each functional module in the chip; A ratio of the actual power consumption to the detected power consumption is calculated, where the ratio is used as the power consumption correction parameter.

9. A chip, characterized in that: include: A plurality of functional modules and a power consumption detection circuit, wherein the power consumption detection circuit is connected to each of the functional modules; The power consumption detection circuit is used to sample each signal in each module of the chip within a preset time period to obtain a flip value corresponding to each signal; wherein the flip value represents the magnitude of the signal flip speed; based on the flip value corresponding to each signal in the functional module and a preset conversion coefficient between the flip value and the power consumption, obtain the power consumption corresponding to the functional module; The power consumption values ​​corresponding to all functional modules are summed, and the power consumption obtained by the sum is corrected based on the power consumption correction parameter obtained in advance to obtain the power consumption of the chip.

10. The chip according to claim 9, characterized in that The power consumption detection circuit includes a power consumption detection main module and a plurality of power consumption detection submodules; each of the power consumption detection submodules is connected to at least one of the functional modules; Each of the power consumption detection submodules is configured to sample the signal of the corresponding functional module to obtain a flip value corresponding to each signal; based on the flip value corresponding to each signal in the functional module and the conversion coefficient between the preset flip value and the power consumption, obtain the power consumption corresponding to the functional module; The power consumption detection module is used to obtain the power consumption corresponding to each of the functional modules, sum the power consumption values ​​corresponding to all the functional modules, and correct the power consumption obtained by the sum based on the power consumption correction parameters obtained in advance to obtain the power consumption of the chip.

11. The chip according to claim 9, characterized in that The power consumption detection circuit includes a power consumption detection main module and a plurality of sampling modules; each of the sampling modules is connected to at least one of the functional modules; Each of the sampling modules is used to sample the signal of the functional module corresponding to itself to obtain the flip value corresponding to each signal; The power consumption detection module is used to obtain the flip value corresponding to each signal in each functional module, and obtain the power consumption corresponding to the functional module based on the flip value corresponding to each signal in the functional module and the preset conversion coefficient between the flip value and the power consumption; sum the power consumption values ​​corresponding to all the functional modules, and correct the power consumption obtained by the sum based on the pre-acquired power consumption correction parameter to obtain the power consumption of the chip.

12. The chip according to claim 11, characterized in that The same signal flowing through the plurality of functional modules is sampled by the same sampling module.