Leakage power consumption calculation method, device, electronic device, storage medium and computer program product
By combining the input and output states of the logic unit, adjusting the logical expression and calculating the probability value, the problem of inaccurate calculation of the logic unit power consumption in the prior art is solved, and a more accurate leakage power consumption calculation is achieved.
Patent Information
- Application Number
- CN202411207653.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing leakage power consumption calculation methods are not accurate enough in the power consumption calculation of logic units, especially in advanced processes, which fail to fully consider the impact of output signals on power consumption, resulting in inaccurate calculation results.
By combining the input and output states of the target logic unit, a logical expression of all state combinations is generated, the logical expression is adjusted to exclude the output state, the probability value of each state combination is calculated, and the probability value is determined based on the static power consumption value and probability value. Leaked power consumption value.
It improves the calculation accuracy of the power consumption of the logic unit leaks, and is suitable for logic units in advanced processes, ensuring the accuracy and reliability of the calculation results.
Smart Images

Figure CN118709645B_ABST
Abstract
Description
Technical Field
[0001] The present application generally relates to the field of integrated circuit technology, and more specifically, to a leakage power consumption calculation method, device, electronic device, storage medium and computer program product. Background Art
[0002] With the advancement of manufacturing technology and design technology, the design methods of electronic systems have undergone profound changes, from computer-aided design (CAD), computer-aided engineering (CAE) to electronic design automation (EDA), the degree of design automation is getting higher and higher, and the complexity of design is getting stronger and stronger.
[0003] Integrated circuit EDA refers to the design method that uses computer-aided design software to complete the functional design, synthesis, verification, physical design (including layout, wiring, layout, design rule checking, etc.) of ultra-large-scale integrated circuit chips. At present, EDA technology has become a powerful tool for modern electronic design. Without the support of EDA technology, it is unimaginable to complete the design and manufacture of ultra-large-scale integrated circuits. Integrated circuit designers need to use EDA tools to design complex integrated circuits with hundreds of thousands to tens of billions of transistors to reduce design deviations, improve the success rate of tape-out and save tape-out costs.
[0004] With the improvement of chip design technology, there is a higher demand for the calculation accuracy of leakage power consumption of logic units in integrated circuits. However, the calculation results of existing leakage power consumption calculation methods are not accurate enough. Therefore, a method that can calculate leakage power consumption more accurately is needed. Summary of the invention
[0005] An exemplary embodiment of the present application provides a leakage power consumption calculation method, device, electronic device, storage medium and computer program product, which can effectively improve the calculation accuracy of the leakage power consumption of a logic unit.
[0006] According to a first aspect of an embodiment of the present application, a leakage power consumption calculation method is provided, comprising: obtaining logical expressions of all state combinations by combining various input states and various output states of a target logic unit, wherein each state combination comprises: an input state and an output state of the target logic unit, and each input state of the target logic unit comprises: an input state corresponding to at least one input pin of the target logic unit; determining a static power consumption value of the target logic unit under each state combination according to the logical expressions of each state combination; adjusting the logical expression of each state combination according to a function of the target logic unit so that the adjusted logical expression of each state combination does not include an expression of the output state; calculating a probability value of the target logic unit appearing in the state combination based on the adjusted logical expression of each state combination; determining a leakage power consumption value of the target logic unit based on the static power consumption value and probability value corresponding to each state combination.
[0007] According to a second aspect of an embodiment of the present application, a leakage power consumption calculation device is provided, comprising: a combination unit, configured to obtain logic expressions of all state combinations by combining various input states and various output states of a target logic unit, wherein each state combination comprises: an input state and an output state of the target logic unit, and each input state of the target logic unit comprises: an input state corresponding to at least one input pin of the target logic unit; a power consumption value determination unit, configured to determine the static power consumption value of the target logic unit under each state combination according to the logic expressions of each state combination; an adjustment unit, configured to adjust the logic expression of each state combination according to the function of the target logic unit so that the adjusted logic expression of each state combination does not include the expression of the output state; a probability calculation unit, configured to calculate the probability value of the state combination occurring in the target logic unit based on the adjusted logic expression of each state combination; and a determination unit, configured to determine the leakage power consumption value of the target logic unit based on the static power consumption value and the probability value corresponding to each state combination.
[0008] According to a third aspect of an embodiment of the present application, a computer-readable storage medium storing instructions is provided. When the instructions are executed by a processor of an electronic device, the electronic device can execute the leakage power consumption calculation method as described above.
[0009] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the leakage power consumption calculation method as described above.
[0010] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer executable instructions, which, when executed by at least one processor, implement the leakage power consumption calculation method as described above.
[0011] According to the leakage power consumption calculation method, device, electronic device, storage medium and computer program product of the exemplary embodiments of the present application, it is possible to effectively improve the calculation accuracy of the leakage power consumption of a logic unit.
[0012] Other aspects and / or advantages of the general inventive concept of the present application will be set forth in part in the following description, and some will be clear from the description or may be learned through practice of the general inventive concept of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other objects and features of the exemplary embodiments of the present application will become more apparent through the following description in conjunction with the accompanying drawings which exemplarily illustrate the embodiments, wherein:
[0014] Figure 1 An example showing the effect of the output signal state of a logic cell on leakage power consumption;
[0015] Figure 2 A flow chart showing a leakage power consumption calculation method according to an exemplary embodiment of the present application;
[0016] Figure 3 An example of a logical expression for obtaining all state combinations according to an exemplary embodiment of the present application is shown;
[0017] Figure 4 An example of determining a static power consumption value of a target logic unit under various state combinations according to an exemplary embodiment of the present application is shown;
[0018] Figure 5 An example of adjusting the logic expression of each state combination according to the function of the target logic unit according to an exemplary embodiment of the present application is shown;
[0019] Figure 6 An example of calculating a probability value of a state combination occurring in a target logic unit based on an adjusted logic expression for each state combination according to an exemplary embodiment of the present application is shown;
[0020] Figure 7 An example of determining a leakage power consumption value of a target logic unit based on static power consumption values and probability values corresponding to each state combination according to an exemplary embodiment of the present application is shown;
[0021] Figure 8A structural block diagram of a leakage power consumption calculation device according to an exemplary embodiment of the present application is shown;
[0022] Fig. 9 A structural block diagram of an electronic device according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] Reference will now be made in detail to embodiments of the present application, examples of which are shown in the accompanying drawings, wherein like reference numerals refer to like parts throughout. The embodiments will be described below with reference to the accompanying drawings in order to explain the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0025] It should be noted that the phrase "at least one of the items" in this application includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0026] For ease of understanding, the terms involved in the exemplary embodiments of the present application are explained below.
[0027] Leakage power: also known as leakage power or leakage power, refers to the power consumption generated by leakage current when the circuit is in a waiting or inactive state. This power consumption is very small in magnitude, but it is a major component of the circuit's static power and is usually equivalent to static power consumption when calculated.
[0028] Lib file: A library file in chip design that contains information about various components used in the chip design process, such as logic gates, triggers, storage cells, etc. These components can be used by designers to build digital circuits to achieve specific functions and logic.
[0029] when condition: A description of the characteristics and behaviors of a component contained in the library file, and a logical expression consisting of different states of each signal.
[0030] cell: A basic logic unit in a library file, which can be a standard logic gate, register, trigger, or other basic digital logic element.
[0031] prob: The library file is used to describe the probability of a specific state. It is calculated by the probabilities of all signals that determine the state. The prob value is also referred to as the probability value below.
[0032] leakage value: static power consumption of logic unit in different working states.
[0033] Default leakage value: the default static power consumption of the logic cell.
[0034] function: A description of the logical function of a logic unit. These descriptions define the behavior of various gates in a digital logic circuit and are usually given in the form of a logical expression or truth table.
[0035] On the one hand, with the improvement of chip design technology, in order to ensure that EDA tools can calculate leakage power consumption more accurately, the description of leakage power consumption in the library file is no longer a constant value, but a when condition (function of input state). This function is usually determined by the combinatorial logic relationship of the input and output pins of the logic unit defined in the library file, and the probability value and static power consumption value required for the calculation of leakage power consumption of each logic unit are related to the combinatorial logic relationship corresponding to the logic unit.
[0036] Since the when condition needs to take all situations into consideration to ensure that the probability values of all when conditions add up to 1, in the library files corresponding to advanced processes (such as 14nm process), especially for logic units with latch structures or other feedback loop structures, there will be some when conditions that do not have corresponding static power consumption values. At this time, the default static power consumption value defined in the library file will be used to calculate the leakage power consumption. Since this calculation method will also take some non-existent when conditions into consideration, when there is a problem with the definition of the default static power consumption value, the leakage power consumption finally calculated will be inaccurate.
[0037] The present application takes into account the following problems in the traditional leakage power calculation process that needs to consider both the input signal and the output signal of the logic unit: (1) When calculating the probability value of the when condition, all signals are considered as independent signals (i.e., the signal is not affected by other signals). However, since there is an output signal in the when condition, and the output signal is actually generated by the input signal, there is a dependency relationship between it and the input signal. Therefore, when calculating the probability value of the when condition, it is unreasonable to directly substitute the probability value of the output signal into the calculation. (2) Since the output signal in the when condition is considered as an independent signal, when listing all the when conditions, there must be some when conditions that will not occur under normal circumstances. It is actually unreasonable to add these when conditions that will not occur under normal circumstances to the calculation process. (3) For when conditions that do not define static power consumption values, the default static power consumption value will be used for calculation, which puts forward requirements on the accuracy of the default static power consumption value. When the default static power consumption value is not accurate enough, the calculation result of the leakage power consumption will be affected.
[0038] On the other hand, this application takes into account that in fact, in the library files corresponding to advanced processes (such as 14nm), it is necessary to consider the state of the output signal, because the leakage path of the current is different when the output state is different. Therefore, if the influence of the output signal is not considered, it will not be applicable to the leakage power calculation of advanced processes. For example, Figure 1 An example of the effect of the output signal state on the leakage power consumption is shown, taking a single-input inverter as an example, the input is , the output is , the input signal controls a PMOS and an NMOS at the same time to realize the switching of the output signal. When the input is 0, the output is 1, and the leakage path of the current is through the NMOS; when the input is 1, the output is 0, and the leakage path of the current is through the PMOS. The different doping principles of NMOS and PMOS lead to different leakage currents, so their influence needs to be taken into account in advanced processes. In summary, in order to obtain more accurate leakage power consumption, the output signal needs to be considered in the calculation.
[0039] In order to avoid the influence of the output signal in the when condition on the leakage power consumption calculation and ensure that the output signal is also considered when calculating the leakage power consumption, the present application provides a leakage power consumption calculation method. Figures 2 to 9 Provide detailed explanation.
[0040] Figure 2A flow chart of a leakage power calculation method according to an exemplary embodiment of the present application is shown. The leakage power calculation method can be implemented by a computer program, and as an example, the leakage power calculation method can be executed by application software (eg, EDA tool) installed in an electronic device.
[0041] Reference Figure 2 In step S100, by combining various input states and various output states of the target logic unit, the logical expressions of all state combinations are obtained. That is, for the target logic unit, all whenconditions are obtained.
[0042] The target logic unit is a basic logic unit in the target circuit whose leakage power consumption is to be calculated.
[0043] Each state combination includes: an input state and an output state of the target logic unit. Each input state of the target logic unit includes: an input state corresponding to at least one input pin of the target logic unit.
[0044] It should be understood that the target logic unit may have one or more input pins. When the target logic unit has multiple input pins, each input state of the target logic unit includes: one input state corresponding to each of the multiple input pins. Different state combinations are at least partially different, and different input states of the target logic unit are at least partially different.
[0045] An input state corresponding to an input pin can be understood as a state (e.g., 0 state or 1 state) of an input signal corresponding to the input pin (i.e., a signal input to a target logic unit via the input pin), and an output state of a target logic unit can be understood as a state (e.g., 0 state or 1 state) of an output signal corresponding to an output pin of the target logic unit (i.e., a signal output by the target logic unit via the output pin). In addition, as an example, the identifier of an input signal corresponding to an input pin can be consistent with the identifier of the input pin, for example, the input signal corresponding to input pin A is input signal A.
[0046] Since the when condition is a logical expression composed of the different states of each signal, and in logic algebra, signals only have two states: 0 or 1, there are only two states for the expression of signal A: A and !A. By combining these two states of all signals, we can get all the when conditions.
[0047] Reference Figure 3, taking the target logic unit as a 2-input AND gate as an example, the input signals corresponding to the two input pins are A1 and A2 respectively, and the output signal is Z. Each input state of the target logic unit may include: an input state of the input signal A1 (A1 or !A1) and an input state of the input signal A2 (A2 or !A2). The various input states of the target logic unit include: input state 1 (expression: A1&A2), input state 2 (expression: !A1&A2), input state 3 (expression: A1&!A2), input state 4 (expression: !A1&!A2).
[0048] According to the input and output signals of the target logic unit, list all when conditions. That is, consider all input and output signals as independent signals, list all their combinational logics, and a total of 8 when conditions (that is, the logical expressions of all state combinations) can be listed, namely: A1&A2&Z, !A1&A2&!Z, A1&!A2&!Z, !A1&!A2&!Z, A1&A2&!Z, !A1&A2&Z, A1&!A2&Z, !A1&A2&Z, A1&!A2&Z, !A1&!A2&Z. Among them, 4 when conditions (i.e., A1&A2&Z, !A1&A2&!Z, A1&!A2&!Z, !A1&!A2&!Z) have been defined in the library file, while the other 4 when conditions (i.e., A1&A2&!Z, !A1&A2&Z, A1&!A2&Z, !A1&!A2&Z) are undefined in the library file because they are states that will not occur under normal circumstances.
[0049] In step S200, the static power consumption value of the target logic unit in each state combination is determined according to the logic expression of each state combination.
[0050] As an exemplary embodiment, the static power consumption value of the target logic unit in each state combination may be determined from the library file according to the logic expression of each state combination of the target logic unit.
[0051] As an exemplary embodiment, step S200 may include: taking each state combination of the target logic unit as the target state combination, traversing the library file, and matching the logical expression of the target state combination with the state combination defined in the library file; and determining the static power consumption value of the target logic unit under the target state combination based on the matching situation.
[0052] As an example, if the logical expression for a certain state combination is recorded in the library file (for example, Figure 4In the library file, if the logical expression following when is included in the state combination and the static power consumption value corresponding to the state combination is included in the library file, the state combination can be considered to have been defined in the library file. Accordingly, the logical expression of the state combination recorded in the library file is a logical expression of a state combination defined in the library file.
[0053] As an example, if the logic expression of the target state combination is consistent with or logically equivalent to the logic expression of any state combination defined in the library file, the static power consumption value corresponding to the defined state combination in the library file will be used as the static power consumption value of the target logic unit under the target state combination; if the logic expression of the target state combination is inconsistent with the logic expression of the state combination defined in the library file and is not logically equivalent, the default static power consumption value corresponding to the target logic unit defined in the library file will be used as the static power consumption value of the target logic unit under the target state combination. For example, taking the target logic unit as a 2-input AND gate as an example, Figure 4 The 0.300911 in the figure is the default static power consumption value corresponding to the target logic unit. Regarding logical equivalence, specifically, it is not limited to the two logic expressions being completely consistent in string form. As long as the logic functions represented by the two are the same, the two can be considered to be logically equivalent.
[0054] In other words, find the static power consumption value corresponding to each when condition in the library file. The acquisition of static power consumption value includes defined parts and undefined parts. The undefined part uses the default static power consumption value. In the library file, each logic unit will contain the static power consumption value corresponding to some defined when conditions. Therefore, all the combinational logics listed above can be traversed and compared with the defined when conditions in the library file. If they exist, the corresponding static power consumption value can be obtained. If the when condition is not matched in the library file, the default static power consumption value will be used for calculation.
[0055] Reference Figure 4 , match each listed when condition in the library file. If the match succeeds, obtain the static power consumption value corresponding to the when condition. If the match fails, obtain the default static power consumption value. For example, the static power consumption value of A1&A2&Z obtained from the library file is 0.870259, the static power consumption value of !A1&A2&!Z is 0.523569, the static power consumption value of A1&!A2&!Z is 0.540763, the static power consumption value of !A1&!A2&!Z is 0.469053, and the static power consumption values of A1&A2&!Z, !A1&A2&Z, A1&!A2&Z, and !A1&!A2&Z are all 0.300911 (that is, the default static power consumption value).
[0056] According to the present exemplary embodiment, it is possible to improve the accuracy and flexibility of determining the static power consumption value of the target logic unit under various state combinations.
[0057] As another exemplary embodiment, step S200 may include: associating a type tag for each state combination, wherein the type tag includes a first tag and a second tag, the first tag is used to indicate that the corresponding state combination has been defined in the library file, and the second tag is used to indicate that the corresponding state combination is not defined in the library file; traversing the library file, matching the logical expression of each state combination associated with the first tag with the state combination defined in the library file, and using the static power consumption value corresponding to the matched state combination in the library file as the static power consumption value of the target logic unit under the state combination; using the default static power consumption value corresponding to the target logic unit defined in the library file as the static power consumption value of the target logic unit under each state combination associated with the second tag.
[0058] For example, Figure 4 As shown, A1&A2&Z, !A1&A2&!Z, A1&!A2&!Z, !A1&!A2&!Z are associated with the first label (defined), and A1&A2&!Z, !A1&A2&Z, A1&!A2&Z, !A1&!A2&Z are associated with the second label (undefined). Then, the library file is traversed to match A1&A2&Z, !A1&A2&!Z, A1&!A2&!Z, !A1&!A2&!Z with the logical expressions of the state combinations defined in the library file respectively, and the static power consumption value corresponding to the matched state combination in the library file is used as the static power consumption value of the target logic unit in the state combination; the default static power consumption value (0.300911) corresponding to the target logic unit defined in the library file is used as the static power consumption value of the target logic unit in each state combination associated with the second label (undefined).
[0059] According to the present exemplary embodiment, by simplifying the process of traversing the library file, the efficiency of determining the static power consumption value of the target logic unit under various state combinations can be improved.
[0060] In step S300, the logic expression of each state combination is adjusted according to the function of the target logic unit, so that the adjusted logic expression of each state combination does not include the expression of the output state.
[0061] As an exemplary embodiment, step S300 may include: determining a logical expression for representing the function of the target logical unit; and replacing the expression of the output state in the logical expression of each state combination with the expression of the input state corresponding to the output state according to the logical expression for representing the function of the target logical unit.
[0062] The logic expression (function) used to represent the function of the target logic unit reflects the corresponding relationship between the input state and the output state of the target logic unit. That is, the relationship between the output signal and the input signal in the logic unit is represented by the function, and the function uses a logic expression to reflect that the combination of input signals can obtain the target output signal under certain circumstances. For example, taking the above-mentioned target logic unit as a 2-input AND gate as an example, the function is: Z=A1&A2, and accordingly, the expression Z of the output state in the logic expression of the state combination can be replaced by: the expression A1&A2 of the input state corresponding to the output state (that is, the target logic unit can obtain the output state under the input state), and the expression !Z of the output state in the logic expression of the state combination can be replaced by: the expression !(A1&A2) of the input state corresponding to the output state, so that the expression of the output state no longer appears in the logic expression of the adjusted state combination, but the expression of the corresponding input state is used to represent the output state, that is, the logic expression of the adjusted state combination is only composed of the expression of the input state.
[0063] When listing all when conditions, all signals will be processed as independent signals, but because the waveform of the output signal is determined by the waveform of the input signal, the output signal needs to be specially processed. The output signal itself can be replaced by the function corresponding to the output signal in the when condition, so that it can be ensured that only the input signal is included in the when condition, and the input signals are independent of each other, so it can be ruled out that there is a dependency between the signals in the when condition, which leads to inaccurate leakage power calculation.
[0064] As an exemplary embodiment, the step of determining a logic expression for representing the function of the target logic unit may include: traversing a library file, and determining a logic expression for representing the function of the target logic unit in the library file according to an output pin of the target logic unit.
[0065] For example, refer to Figure 5, according to the output pin (pin Z) of the target logic unit, find the logic expression corresponding to the pin in the library file (that is, the logic expression function used to represent the function of the target logic unit), and replace the expression of the output signal in the original when condition (that is, the raw when condition) with the corresponding function to obtain a new when condition (that is, the new when condition, that is, the adjusted whencondition). For example, find the function "(A1&A2)" corresponding to the output pin Z in the library file, and bring it into A1&A2&Z to obtain A1&A2&(A1&A2).
[0066] In addition, as an example, the expression of one of the output states of the target logic unit can be matched with the pin defined in the library file. If the match is successful, the direction of the pin defined in the library file is determined. If the direction is determined to be output, the function expression of the pin defined in the library file is determined as the logic expression used to represent the function of the target logic unit. Figure 5 As shown, taking the expression of the output state as Z or !Z as an example, it successfully matches the pin Z defined in the library file. Next, the direction of the pin Z defined in the library file is determined. If the direction is determined to be output, the function expression of the pin Z defined in the library file (function: A1&A2) is determined as the logical expression used to represent the function of the target logic unit.
[0067] According to exemplary embodiments of the present disclosure, a logical expression for expressing a function of a target logical unit can be determined conveniently.
[0068] In the library files corresponding to advanced processes, especially for logic units with latch structures or other feedback loop structures, the input signal and the output signal need to be considered simultaneously in the when condition. The reason why the when condition without a static power consumption value is generated is that the output signal is processed as an independent signal during calculation, but in fact there is a dependency between the output signal and the input signal. Therefore, this application proposes to replace the expression of the output signal in the when condition with the expression of the input signal to ensure the independence of the signals in the when condition.
[0069] In step S400 , based on the adjusted logic expression of each state combination, the probability value of the state combination occurring in the target logic unit is calculated.
[0070] As an exemplary embodiment, step S400 may include: for each state combination, performing logical simplification on the adjusted logical expression of the state combination; and calculating the probability value of the state combination occurring in the target logic unit based on the logical expression after logical simplification and the probability value of each input pin occurring the input state defined in the state combination.
[0071] As an exemplary embodiment, if the logical expression after logical simplification is 0, the probability value of the target logic unit appearing in the state combination is determined to be 0; if the logical expression after logical simplification is not 0, the probability value of each input pin appearing in the input state defined in the state combination is substituted into the logical expression after logical simplification to obtain the probability value of the target logic unit appearing in the state combination.
[0072] As an exemplary embodiment, if any input pin is directly connected to the input port of the target circuit where the target logic unit is located, the probability value of each input state of the input pin may be 0.5, that is, the probability value of the 0 state is 0.5, and the probability value of the 1 state is 0.5.
[0073] As another exemplary embodiment, if any input pin is directly connected to the output pin of other logic units in the target circuit, the probability value of each output state of the output pin is used as the probability value of the corresponding input state of the input pin. For example, if the probability value of the output pin being in the 0 state is X and the probability value of the output pin being in the 1 state is Y, then the probability value of the input pin being in the 0 state is X and the probability value of the input pin being in the 1 state is Y.
[0074] According to an exemplary embodiment of the present application, after replacing the expression of the output signal in the when condition with its corresponding function, all the signals are independent input signals, so the probability value can be calculated using the method of logical algebra. By simplifying the formula of logical algebra, the results of some whenconditions that do not exist under normal circumstances will become a constant of 0, so that the subsequent calculation of leakage power consumption will not take this part of the whencondition into account, thereby making the calculation of leakage power consumption more accurate.
[0075] Reference Figure 6 After replacing the output signal expression Z in the raw when condition with its corresponding function, each new when condition is further logically simplified to obtain the simplified when condition (i.e. simplified when condition). For example, A1&A2&Z is finally simplified to A1&A2, and A1&A2&!Z is finally simplified to 0.
[0076] Next, substitute the probability values of A1 and A2 (i.e., the probability value of input state A1 and the probability value of input state A2, both assumed to be 0.5) into each simplified when condition, and use the method of logical algebra to calculate, so as to calculate the probability value corresponding to each when condition. For example, for A1&A2&Z, the logical expression after logical simplification is: A1&A2, and the probability value of input state A1 is 0.5, and the probability value of input state A2 is 0.5, so the probability value of A1&A2&Z is A1&A2=0.5 0.5=0.25, the probability value of A1&A2&!Z is directly 0. In contrast, since Z=A1&A2, the probability value of Z is 0.5 0.5=0.25, the probability value of !Z is 1-0.25=0.75. If the probability value of the when condition is calculated according to the traditional technology, the probability value of A1&A2&Z is 0.5 0.5 0.25=0.0625, and the probability value of A1&A2&!Z is 0.5 0.5 0.75=0.1875, which is obviously unreasonable.
[0077] The present application replaces the expression of the output signal in the when condition with its corresponding function, thereby avoiding the inaccurate calculation of leakage power consumption caused by adding the when condition that does not normally occur into the calculation, thereby improving the accuracy of the leakage power consumption calculation.
[0078] In step S500 , the leakage power consumption value of the target logic unit is determined based on the static power consumption value and the probability value corresponding to each state combination.
[0079] As an exemplary embodiment, step S500 may include: multiplying the static power consumption value and the probability value corresponding to each state combination to obtain a product; and accumulating the products corresponding to each state combination to obtain the leakage power consumption value of the target logic unit. That is, after calculating and adding the leakage power consumption corresponding to all when conditions, the total leakage power consumption of the target logic unit can be obtained.
[0080] Reference Figure 7After calculating the probability value corresponding to each when condition according to the simplified when condition, the probability value of each when condition is multiplied by its corresponding static power consumption value and then added together to obtain the leakage power consumption of the entire logic unit. Taking the AND gate as an example, when considering the input signals (A1 and A2) and output signal (Z) of the AND gate at the same time, the leakage power consumption of the AND gate is: 0.25 0.870259+0.25 0.52369+0.25 0.540763+0.25 0.469053+0+0+0+0=0.600911.
[0081] In contrast, if the leakage power consumption of the AND gate is calculated according to the traditional technology, it is: 0.0625 0.870259+0.1875 0.52369+0.1875 0.540763+0.1875 0.469053+0.1875 0.300911+0.0625 0.300911+0.0625 0.300911+0.0625 0.300911=0.454765.
[0082] According to an exemplary embodiment of the present application, first, all when conditions are listed according to the input pins and output pins of the logic unit. Then, according to the when condition, find the corresponding static power consumption value in the library file. After that, the expression of the output signal in each when condition is replaced with its corresponding function, which only contains the expression of the input signal. In this way, the replaced when condition will only contain the expression of the input signal. At the same time, the probability value of the invalid when condition will also become a constant of 0 through logical simplification, and will not affect the leakage power consumption calculation result in subsequent calculations. Finally, the probability values of all when conditions are multiplied by their corresponding static power consumption values and then added to obtain the final leakage power consumption. After applying the exemplary embodiments of the present application, the calculation result of the leakage power consumption will be more accurate.
[0083] Figure 8 A structural block diagram of a leakage power consumption calculation device according to an exemplary embodiment of the present application is shown.
[0084] Reference Figure 8 According to an exemplary embodiment of the present application, a leakage power consumption calculation device includes: a combination unit 100, a power consumption value determination unit 200, an adjustment unit 300, a probability calculation unit 400, and a determination unit 500.
[0085] Specifically, the combination unit 100 is configured to obtain the logic expressions of all state combinations by combining various input states and various output states of the target logic unit.
[0086] Each state combination includes: an input state and an output state of the target logic unit, and each input state of the target logic unit includes: an input state corresponding to at least one input pin of the target logic unit.
[0087] The power consumption value determining unit 200 is configured to determine the static power consumption value of the target logic unit under each state combination according to the logic expressions of each state combination.
[0088] The adjustment unit 300 is configured to adjust the logic expression of each state combination according to the function of the target logic unit, so that the adjusted logic expression of each state combination does not include the expression of the output state.
[0089] The probability calculation unit 400 is configured to calculate the probability value of the target logic unit appearing in the state combination based on the adjusted logic expression of each state combination.
[0090] The determining unit 500 is configured to determine the leakage power consumption value of the target logic unit based on the static power consumption value and the probability value corresponding to each state combination.
[0091] As an exemplary embodiment, the adjustment unit 300 may be configured to: determine a logical expression for representing the function of the target logic unit; and replace the expression of the output state in the logical expression of each state combination with the expression of the input state corresponding to the output state according to the logical expression for representing the function of the target logic unit; wherein the logical expression for representing the function of the target logic unit reflects the correspondence between the input state and the output state of the target logic unit.
[0092] As an exemplary embodiment, the adjustment unit 300 may be configured to: traverse a library file, and determine a logic expression for representing a function of the target logic unit in the library file according to an output pin of the target logic unit.
[0093] As an exemplary embodiment, the probability calculation unit 400 can be configured to: for each state combination, perform logical simplification on the adjusted logical expression of the state combination; and calculate the probability value of the state combination appearing in the target logic unit based on the logical expression after logical simplification and the probability value of each input pin appearing in the input state defined in the state combination.
[0094] As an exemplary embodiment, the probability calculation unit 400 can be configured as follows: if the logical expression after logical simplification is 0, then the probability value of the target logic unit appearing in the state combination is determined to be 0; if the logical expression after logical simplification is not 0, then the probability value of each input pin appearing in the input state defined in the state combination is substituted into the logical expression after logical simplification to obtain the probability value of the target logic unit appearing in the state combination.
[0095] As an exemplary embodiment, the power consumption value determination unit 200 can be configured to: take each of the state combinations as the target state combination, traverse the library file, and match the logical expression of the target state combination with the state combination defined in the library file; based on the matching situation, determine the static power consumption value of the target logic unit under the target state combination.
[0096] As an exemplary embodiment, the power consumption value determination unit 200 may be configured as follows: if the logical expression of the target state combination is consistent with or logically equivalent to the logical expression of any state combination defined in the library file, then the static power consumption value corresponding to the state combination defined in the library file is used as the static power consumption value of the target logic unit under the target state combination; if the logical expression of the target state combination is inconsistent with and logically not equivalent to the logical expression of the state combination defined in the library file, then the default static power consumption value corresponding to the target logic unit defined in the library file is used as the static power consumption value of the target logic unit under the target state combination.
[0097] As an exemplary embodiment, the power consumption value determination unit 200 can be configured to: associate a type tag with each state combination, respectively, wherein the type tag includes a first tag and a second tag, the first tag is used to indicate that the corresponding state combination has been defined in the library file, and the second tag is used to indicate that the corresponding state combination is not defined in the library file; traverse the library file, match the logical expression of each state combination associated with the first tag with the state combination defined in the library file, and use the static power consumption value corresponding to the state combination matched in the library file as the static power consumption value of the target logic unit under the state combination; use the default static power consumption value corresponding to the target logic unit defined in the library file as the static power consumption value of the target logic unit under each state combination associated with the second tag.
[0098] As an exemplary embodiment, the determination unit 500 may be configured to: multiply the static power consumption value and the probability value corresponding to each state combination to obtain a product; and accumulate the products corresponding to each state combination to obtain the leakage power consumption value of the target logic unit.
[0099] It should be understood that the specific processing performed by the leakage power consumption calculation device according to the exemplary embodiment of the present application has been referred to. Figures 2 to 7 The details have been described in detail and will not be repeated here.
[0100] It should be understood that each unit in the leakage power consumption calculation device according to the exemplary embodiment of the present application may be implemented as a hardware component and / or a software component.
[0101] Figure 8 A structural block diagram of an electronic device according to an exemplary embodiment of the present application is shown.
[0102] Reference Figure 4 The electronic device includes: at least one memory 600 and at least one processor 700, wherein the at least one memory 600 stores a set of computer executable instructions, and when the computer executable instruction set is executed by the at least one processor 700, the leakage power consumption calculation method as described in the above exemplary embodiment is executed.
[0103] As an example, the electronic device may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instruction set. Here, the electronic device is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above instructions (or instruction sets) individually or in combination. The electronic device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0104] In an electronic device, the processor 700 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. As an example and not limitation, the processor 700 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0105] The processor 700 may execute instructions or codes stored in the memory 600, wherein the memory 600 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.
[0106] The memory 600 may be integrated with the processor 700, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 600 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 600 and the processor 700 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 700 can read files stored in the memory.
[0107] In addition, the electronic device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device may be connected to each other via a bus and / or a network.
[0108] According to an exemplary embodiment of the present application, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to execute the leakage power consumption calculation method as described in the above exemplary embodiment. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0109] According to an exemplary embodiment of the present application, a computer program product may also be provided, and instructions in the computer program product may be executed by at least one processor to complete the leakage power consumption calculation method as described in the above exemplary embodiment.
[0110] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0111] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for calculating leakage power consumption, characterized in that: include: By combining various input states and various output states of the target logic unit, a logical expression of all state combinations is obtained, wherein each state combination includes: an input state and an output state of the target logic unit, and each input state of the target logic unit includes: an input state corresponding to at least one input pin of the target logic unit; Determining the static power consumption value of the target logic unit under each state combination according to the logical expressions of each state combination; According to the function of the target logic unit, the logic expression of each state combination is adjusted so that the adjusted logic expression of each state combination does not include the expression of the output state; Based on the adjusted logical expression of each state combination, calculating the probability value of the state combination occurring in the target logical unit; Determine the leakage power consumption value of the target logic unit based on the static power consumption value and the probability value corresponding to each state combination; The step of adjusting the logic expression of each state combination according to the function of the target logic unit includes: determining a logic expression for representing the function of the target logic unit; replacing the expression of the output state in the logic expression of each state combination with the expression of the input state corresponding to the output state according to the logic expression for representing the function of the target logic unit, wherein the logic expression for representing the function of the target logic unit reflects the corresponding relationship between the input state and the output state of the target logic unit; Among them, the step of calculating the probability value of the state combination appearing in the target logic unit based on the adjusted logical expression of each state combination includes: for each state combination, logically simplifying the adjusted logical expression of the state combination; calculating the probability value of the state combination appearing in the target logic unit according to the logical expression after logical simplification and the probability value of the input state defined in the state combination appearing on each input pin.
2. The method for calculating leakage power consumption according to claim 1, characterized in that: The step of determining a logical expression for representing the function of the target logic unit comprises: The library file is traversed, and a logic expression for representing the function of the target logic unit is determined in the library file according to the output pin of the target logic unit.
3. The method for calculating leakage power consumption according to claim 1, characterized in that: The step of calculating the probability value of the target logic unit appearing in the state combination according to the logical expression after logical simplification and the probability value of each input pin appearing in the input state defined in the state combination comprises: If the logical expression after logical simplification is 0, then the probability value of the target logic unit appearing in the state combination is determined to be 0; If the logical expression after logical simplification is not 0, the probability value of each input pin appearing in the input state defined in the state combination is substituted into the logical expression after logical simplification to obtain the probability value of the target logic unit appearing in the state combination.
4. The method for calculating leakage power consumption according to claim 1, characterized in that: The step of determining the static power consumption value of the target logic unit under each state combination according to the logical expression of each state combination comprises: Taking each state combination as a target state combination respectively, traversing the library file, and matching the logical expression of the target state combination with the state combination defined in the library file; According to the matching situation, a static power consumption value of the target logic unit under the target state combination is determined.
5. The method for calculating leakage power consumption according to claim 4, characterized in that: The step of determining the static power consumption value of the target logic unit under the target state combination according to the matching situation includes: If the logic expression of the target state combination is consistent with or logically equivalent to the logic expression of any state combination defined in the library file, the static power consumption value corresponding to the state combination defined in the library file is used as the static power consumption value of the target logic unit under the target state combination; If the logical expression of the target state combination is inconsistent with the logical expression of the state combination defined in the library file and is not logically equivalent, the default static power consumption value corresponding to the target logic unit defined in the library file is used as the static power consumption value of the target logic unit under the target state combination.
6. The method for calculating leakage power consumption according to claim 1, characterized in that: The step of determining the static power consumption value of the target logic unit under each state combination according to the logical expression of each state combination comprises: Associating a type tag with each state combination respectively, wherein the type tag includes a first tag and a second tag, the first tag is used to indicate that the corresponding state combination has been defined in the library file, and the second tag is used to indicate that the corresponding state combination has not been defined in the library file; Traversing the library file, matching the logical expression of each state combination associated with the first tag with the state combination defined in the library file, and using the static power consumption value corresponding to the state combination matched in the library file as the static power consumption value of the target logic unit under the state combination; The default static power consumption value corresponding to the target logic unit defined in the library file is used as the static power consumption value of the target logic unit in each state combination associated with the second tag.
7. The method for calculating leakage power consumption according to claim 1, characterized in that: The step of determining the leakage power consumption value of the target logic unit based on the static power consumption value and the probability value corresponding to each state combination includes: Multiply the static power consumption value and the probability value corresponding to each state combination to obtain a product; The products corresponding to each state combination are accumulated to obtain the leakage power consumption value of the target logic unit.
8. A leakage power consumption calculation device, characterized in that: include: A combination unit is configured to obtain a logic expression of all state combinations by combining various input states and various output states of the target logic unit, wherein each state combination includes: an input state and an output state of the target logic unit, and each input state of the target logic unit includes: an input state corresponding to at least one input pin of the target logic unit; A power consumption value determination unit, configured to determine the static power consumption value of the target logic unit under each state combination according to the logic expression of each state combination; an adjusting unit configured to adjust the logic expression of each state combination according to the function of the target logic unit so that the adjusted logic expression of each state combination does not include an expression of the output state; A probability calculation unit, configured to calculate a probability value of the target logic unit appearing in the state combination based on the adjusted logic expression of each state combination; a determining unit configured to determine a leakage power consumption value of the target logic unit based on the static power consumption value and the probability value corresponding to each state combination; The adjustment unit is specifically configured to: determine a logic expression for representing the function of the target logic unit; replace the expression of the output state in the logic expression of each state combination with the expression of the input state corresponding to the output state according to the logic expression for representing the function of the target logic unit, wherein the logic expression for representing the function of the target logic unit reflects the corresponding relationship between the input state and the output state of the target logic unit; Among them, the probability calculation unit is specifically configured to: for each state combination, perform logical simplification on the adjusted logical expression of the state combination; calculate the probability value of the state combination appearing in the target logic unit based on the logical expression after logical simplification and the probability value of each input pin appearing in the input state defined in the state combination.
9. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the leakage power consumption calculation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; at least one memory storing computer executable instructions, When the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the leakage power consumption calculation method according to any one of claims 1 to 7.
11. A computer program product comprising computer executable instructions, characterized in that: When the computer executable instructions are executed by at least one processor, the leakage power consumption calculation method according to any one of claims 1 to 7 is implemented.
