Power measurement circuit
The power measurement circuit addresses the challenge of calculating power consumption in integrated circuits by using toggle counters and period measurement to directly measure signal changes and operation periods, enabling accurate and efficient power calculation for individual circuits.
Patent Information
- Application Number
- JP2023011906
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2043-01-30
AI Technical Summary
Existing technologies face difficulties in accurately and efficiently calculating power consumption in specific processing circuits within integrated circuits, particularly due to complex measurement environments and unreliable simulation methods.
A power measurement circuit that includes period measurement circuits and toggle counters to measure the number of signal changes and operation periods in processing circuits, allowing for direct calculation of power consumption based on these metrics.
Enables precise and efficient calculation of power consumption in individual processing circuits within integrated circuits, optimizing software control to reduce overall power usage and improving heat dissipation design accuracy.
Smart Images

Figure 0007611632000001 
Figure 0007611632000002 
Figure 0007611632000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a power measurement circuit for calculating power consumption in an integrated circuit having multiple processing circuits. [Background technology]
[0002] Patent Document 1 discloses a power consumption calculation method that measures the number of signal changes in gates that configure a target logic circuit, and calculates the power consumption of the target logic circuit based on the measured number of signal changes. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2004-62238 A Summary of the Invention [Problem to be solved by the invention]
[0004] The above-mentioned conventional techniques have a problem in that it is difficult to easily calculate the power consumption of a specific processing circuit within an integrated circuit.
[0005] The present disclosure provides a power measurement circuit that can easily calculate the power consumption of a particular processing circuit within an integrated circuit. [Means for solving the problem]
[0006] A power measurement circuit according to one aspect of the present disclosure is a power measurement circuit that calculates power consumption in an integrated circuit having a plurality of processing circuits, and includes: a period measurement circuit that measures a measurement period; a first measurement unit that measures, during the measurement period, a first toggle number that is the number of changes in a signal value indicated by a first input signal to a first target circuit among the plurality of processing circuits, and a first operating period that is a period during which the first input signal is valid; a second measurement unit that measures, during the measurement period, a second toggle number that is the number of changes in a signal value indicated by a first output signal from the first target circuit, and a second operating period that is a period during which the first output signal is valid; and a calculation unit that calculates a first power consumption of the first target circuit based on the first toggle number and the first operating period measured during the measurement period by the first measurement unit, and the second toggle number and the second operating period measured during the measurement period by the second measurement unit. Effect of the Invention
[0007] According to a power measurement circuit according to an aspect of the present disclosure, it is possible to easily calculate the power consumption of a specific processing circuit within an integrated circuit. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram showing an example of a configuration of a power measuring circuit according to an embodiment. [Diagram 2] FIG. 2 is a diagram for explaining the number of toggles and the operation period. [Diagram 3] FIG. 3 is a block diagram showing an example of the configuration of the measurement circuit. [Figure 4] FIG. 4 is a block diagram showing an example of the configuration of the period measuring circuit. [Diagram 5] FIG. 5 is a diagram for explaining the timing at which the toggle number, the operation period, and the measurement period are determined. [Figure 6] FIG. 6 is a block diagram showing an example of the configuration of a measurement circuit according to the first modification. [Figure 7] FIG. 7 is a block diagram showing an example of the configuration of a power measuring circuit according to the second modification. [Figure 8] FIG. 8 is a block diagram showing an example of the configuration of a power measuring circuit according to the third modification. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] (Findings on which this disclosure is based) Integrated circuits such as in-vehicle SoCs (System on a Chip) require a circuit size according to the required performance. In an integrated circuit, the dynamic power increases as the circuit size increases. Dynamic power also depends on how the integrated circuit is used, and different usage methods can result in significantly different amounts of dynamic power. It is difficult for integrated circuit vendors to grasp how an integrated circuit will be used by users when developing the integrated circuit. For this reason, vendors develop integrated circuits assuming usage that results in the maximum power consumption.
[0010] On the other hand, when designing the optimal heat dissipation for the integrated circuit that they adopt, users need to estimate the power consumption according to the functions that the user will use (i.e., how the device is used). If it is possible to measure the power consumption of each circuit in an integrated circuit according to how the integrated circuit is used (software control), it will be possible to optimize the software control to reduce the power consumption of the entire integrated circuit. In other words, there is a demand for the power consumption of each circuit in an integrated circuit to be easily measured.
[0011] However, with conventional techniques such as that disclosed in Patent Document 1, it is difficult to measure the power consumption of each circuit in an integrated circuit. For example, there are the following problems.
[0012] For example, it is possible to measure the power of each power supply terminal of an integrated circuit by directly measuring the voltage and current of each power supply terminal. However, since the measurement environment is complicated and expensive, it is difficult to have multiple measurement environments. Furthermore, even if the power of an integrated circuit is measured from the power supply terminals, it is not possible to measure the power consumption of a specific circuit within the integrated circuit.
[0013] In addition, as a method other than direct measurement, a method of calculating power consumption by simulation based on circuit information in an integrated circuit and a use case is conceivable. However, it requires a huge amount of time and an expensive environment, and is not easy to realize. Another method is to calculate power by setting an operation rate derived by a user from past experience using a table indicating the relationship between the operating frequency, operation rate, and power for each circuit block provided by an integrated circuit vendor. However, there is a problem with the accuracy of the operation rate set by the user from experience, and the power consumption under the worst condition is estimated to be large with a margin. In other words, since it is not possible to estimate according to the actual operation rate, there is a high possibility that the heat dissipation design will be performed in excess of the actual power consumption, which causes a problem of increasing the cost of the heat dissipation design.
[0014] In order to solve the above problem, a power measurement circuit according to a first aspect of the present disclosure is a power measurement circuit that calculates power consumption in an integrated circuit having a plurality of processing circuits, and includes: a period measurement circuit that measures a measurement period; a first measurement unit that measures, during the measurement period, a first toggle number that is the number of changes in a signal value indicated by a first input signal to a first target circuit of the plurality of processing circuits, and a first operating period that is a period during which the first input signal is valid; a second measurement unit that measures, during the measurement period, a second toggle number that is the number of changes in a signal value indicated by a first output signal from the first target circuit, and a second operating period that is a period during which the first output signal is valid; and a calculation unit that calculates a first power consumption of the first target circuit based on the first toggle number and the first operating period measured during the measurement period by the first measurement unit, and the second toggle number and the second operating period measured during the measurement period by the second measurement unit.
[0015] According to this, a first power consumption of the first target circuit during a measurement period is calculated based on a first toggle number and a first operation period measured based on a first input signal to the first target circuit, and a second toggle number and a second operation period measured based on a first output signal from the first target circuit. In other words, it is possible to easily calculate the first power consumption of the first target circuit in an integrated circuit.
[0016] A power measuring circuit according to a second aspect of the present disclosure is the power measuring circuit according to the first aspect, further comprising a third measurement unit that measures, during the measurement period, a third toggle number, which is the number of changes in a signal value indicated by a second input signal to a second target circuit among the multiple processing circuits, and a third operating period, which is a period during which the second input signal is valid, and a fourth measurement unit that measures, during the measurement period, a fourth toggle number, which is the number of changes in a signal value indicated by a second output signal from the second target circuit, and a fourth operating period, which is a period during which the second output signal is valid, wherein the calculation unit further calculates a second power consumption of the second target circuit based on the third toggle number and the third operating period measured by the third measurement unit during the measurement period, and the fourth toggle number and the fourth operating period measured by the fourth measurement unit during the measurement period.
[0017] According to this, the second power consumption of the second target circuit during the measurement period is calculated based on a third toggle number and a third operation period measured based on a second input signal to the second target circuit, and a fourth toggle number and a fourth operation period measured based on a second output signal from the second target circuit. In other words, the second power consumption of the second target circuit in the integrated circuit can be easily calculated. In this way, the power consumption of each of the multiple processing circuits can be easily calculated.
[0018] A power measuring circuit according to a third aspect of the present disclosure is the power measuring circuit according to the first aspect, further comprising a fourth measurement unit that measures, during the measurement period, a fourth toggle number, which is the number of changes in a signal value indicated by a second output signal from a second target circuit among the plurality of processing circuits, to which the first output signal is input as an input signal, and a fourth operating period, which is a period during which the second output signal is valid, and the calculation unit further calculates a second power consumption of the second target circuit based on the second toggle number and the second operating period measured during the measurement period by the second measurement unit, and the fourth toggle number and the fourth operating period measured during the measurement period by the fourth measurement unit.
[0019] According to this, the second power consumption of the second target circuit is calculated using the second toggle number and the second operating period measured based on the first output signal from the first target circuit, so that the number of measurement units that measure the toggle number and the operating period can be reduced.
[0020] A power measuring circuit according to a fourth aspect of the present disclosure is the power measuring circuit according to the first aspect, wherein the period measuring circuit comprises a counter to which a clock signal and a measurement start signal are input and which counts the clock signal after the measurement start signal is input, and a first output section to which a measurement end signal is input and which outputs the clock signal, the count result by the counter, and the count result at the time the measurement end signal is input as the measurement period.
[0021] A power measurement circuit according to a fifth aspect of the present disclosure is the power measurement circuit according to any one of the first to fourth aspects, wherein each of the first measurement unit and the second measurement unit includes a hold circuit that holds a first signal value that is a signal value of the first input signal or the first output signal in a first clock cycle, a toggle bit counter that counts bits where the first signal value and a second signal value that is a signal value of the first input signal or the first output signal in a second clock cycle following the first clock cycle are different from each other, and a count result by the toggle bit counter that counts bits of the first input signal or the the counting unit includes a masking processing unit that performs masking on a counting result in which one output signal is invalid; a valid bit counter that counts the counting result in which the masking processing has been performed by the masking processing unit; a valid period counter that counts a period in which the first input signal or the first output signal is valid; and a second output unit that outputs the valid bit counting result counted by the valid bit counter as the first toggle number or the second toggle number during the measurement period, and outputs the valid period counting result counted by the valid period counter as the first operating period or the second operating period.
[0022] According to this, since the valid bit counter for measuring the number of toggles and the valid period counter for counting the operation period are separately provided, it is possible to measure the number of toggles and the operation period during the same measurement period, and therefore it is possible to more accurately calculate the first power consumption of the first target circuit.
[0023] A power measurement circuit according to a sixth aspect of the present disclosure is a power measurement circuit according to any one of the first to fourth aspects, wherein each of the first measurement unit and the second measurement unit includes a hold circuit that holds a first signal value that is a signal value of the first input signal or the first output signal in a first clock cycle, a toggle bit counter that compares the first signal value with a second signal value that is a signal value of the first input signal or the first output signal in a second clock cycle following the first clock cycle, and counts bits where the first signal value and the second signal value are different from each other, and a count circuit that masks count results by the toggle bit counter when the first input signal or the first output signal is invalid. a mask processing unit configured to switch between a first count mode and a second count mode; a valid counter configured to count the count result masked by the mask processing unit in a first measurement period in the first count mode and to count a period in which the first input signal or the first output signal is valid in a second measurement period in the second count mode; and a second output unit configured to output a valid bit count result counted by the valid counter in the first measurement period as the first toggle number or the second toggle number, and to output a valid period count result counted by the valid counter in the second measurement period as the first operation period or the second operation period.
[0024] According to this, a common counter can be used to measure the number of toggles and to measure the operation period, thereby making it possible to reduce the circuit scale of the power measuring circuit.
[0025] A power measuring circuit according to a seventh aspect of the present disclosure is a power measuring circuit according to any one of the first to sixth aspects, wherein the first measuring unit and the second measuring unit are composed of a first measuring circuit, and the power measuring circuit further includes a second switching unit that switches between a first operating mode in which the first measuring circuit is connected to an input side of the first target circuit and a second operating mode in which the first measuring circuit is connected to an output side of the first target circuit, and the first measuring circuit operates as the first measuring unit in the first operating mode and operates as the second measuring unit in the second operating mode.
[0026] According to this, the first measuring circuit can be commonly used as the first measuring section and the second measuring section, and therefore the circuit scale of the power measuring circuit can be reduced.
[0027] A power measurement circuit according to an eighth aspect of the present disclosure is the power measurement circuit according to any one of the first to sixth aspects, further comprising: a third measurement unit that measures, during the measurement period, a third toggle number that is the number of changes in a signal value indicated by a second input signal to a second target circuit of the plurality of processing circuits, and a third operation period that is a period during which the second input signal is valid; and a fourth measurement unit that measures, during the measurement period, a fourth toggle number that is the number of changes in a signal value indicated by a second output signal from the second target circuit, and a fourth operation period that is a period during which the second output signal is valid. and two of the first measurement unit, the second measurement unit, the third measurement unit, and the fourth measurement unit are respectively composed of a first measurement circuit and a second measurement circuit, and the power measurement circuit further comprises a selector that connects two measurement targets selected from the input side of the first target circuit, the output side of the first target circuit, the input side of the second target circuit, and the output side of the second target circuit to the first measurement circuit and the second measurement circuit, and the first measurement circuit and the second measurement circuit operate as measurement units that measure the two measurement targets selected by the selector.
[0028] According to this, the first measurement circuit and the second measurement circuit can be set to function as two selected measurement units among the first measurement unit, the second measurement unit, the third measurement unit, and the fourth measurement unit. Therefore, for example, by setting the first measurement circuit and the second measurement circuit to function as the first measurement unit and the second measurement unit, the first power consumption of the first target circuit can be calculated based on the first toggle number, the first operation period, the second toggle number, and the second operation period in the same measurement period. Therefore, it is possible to calculate the first power consumption of the first target circuit more accurately. For example, by setting the first measurement circuit and the second measurement circuit to function as the third measurement unit and the fourth measurement unit, it is possible to calculate the second power consumption of the second target circuit more accurately, similar to the first target circuit.
[0029] Hereinafter, the embodiment will be specifically described with reference to the drawings.
[0030] In addition, the embodiments described below are all comprehensive or specific examples. The numerical values, shapes, materials, components, arrangement and connection forms of components, steps, order of steps, etc. shown in the following embodiments are examples and are not intended to limit the present disclosure. In addition, among the components in the following embodiments, components that are not described in an independent claim showing the highest concept are described as optional components. In addition, each figure is a schematic diagram and is not necessarily illustrated strictly. Therefore, for example, the scale, etc., does not necessarily match in each figure. In addition, the same reference numerals are given to the same components in each figure.
[0031] (Embodiment) [composition] FIG. 1 is a block diagram showing an example of a configuration of a power measuring circuit according to an embodiment.
[0032] 1, the power measuring circuit 100 includes a plurality of (three in this embodiment) processing circuits 101-103, a plurality of measuring circuits 201-206, a period measuring circuit 300, a bus 400, and a calculation section 500. The power measuring circuit 100 may include processing circuits other than the plurality of processing circuits 101-103. The power measuring circuit 100 may include measuring circuits other than the plurality of measuring circuits 201-206.
[0033] Each of the multiple processing circuits 101 to 103 is a logic circuit or processor that performs processing according to an input signal and outputs a processing result. The processing circuit 101 receives, for example, one input signal, a valid signal, and a clock signal, and outputs two output signals. The two output signals are signals generated by processing the one input signal input to the processing circuit 101 by the processing circuit 101. Note that the processing circuit 101 may output the received valid signal and clock signal as is. The processing circuit 101 is an example of a first target circuit.
[0034] The processing circuit 102 receives, for example, one system of input signals, a valid signal, and a clock signal, and outputs one system of output signals. The one system of input signals input to the processing circuit 102 is one of the two systems of output signals output from the processing circuit 101. The one system of output signals output by the processing circuit 102 is a signal generated by processing the one system of input signals input to the processing circuit 102 by the processing circuit 102. Note that the processing circuit 102 may output the received valid signal and clock signal as is.
[0035] The processing circuit 103 receives, for example, two input signals, a valid signal, and a clock signal, and outputs one output signal. One of the two input signals input to the processing circuit 103 is one of the two output signals output from the processing circuit 101, and is a different output signal from the output signal output to the processing circuit 102. The one output signal output by the processing circuit 103 is a signal generated by processing the two input signals input to the processing circuit 103 by the processing circuit 103. Note that the processing circuit 103 may output the received valid signal and clock signal as is.
[0036] The measurement circuits 201 to 206 measure the number of toggles and the operating period of the signal to be measured. The number of toggles is the number of changes in the signal value indicated by the signal to be measured. The operating period is the period during which the signal to be measured is valid.
[0037] FIG. 2 is a diagram for explaining the number of toggles and the operation period.
[0038] In Fig. 2, Data[0] to Data[3] indicate the signal values of the signal to be measured. In Fig. 2, the signal to be measured is represented by 4 bits, and each bit indicates one of the signals Data[0] to Data[3]. "valid" indicates the signal value of the valid signal, and when it is High, it indicates that the signal to be measured is valid, and when it is Low, it indicates that the signal to be measured is invalid. "clk" indicates a clock signal, and Fig. 2 shows that a predetermined clock has operated 23 times from time T1 to time T23.
[0039] The toggle number is the total number of times each bit of Data[0] to Data[3] changes when the valid signal indicates that it is valid. In FIG. 2, the time when each bit changes is indicated by a square. That is, in the example of FIG. 2, the toggle number is the total number of squares. The toggle rate is the ratio of the toggle number to the total number of clocks at which each bit can change. Specifically, the total number of clocks is the number obtained by multiplying the measurement period by the number of bits. In this way, if the toggle number and the measurement period are known, the toggle rate can be calculated using the number of bits of the signal, which is a known value.
[0040] 2, the number of bits, that is, the number of Data[0] to Data[3], is 4, and the measurement period is 23, so the total number of clocks is 23 x 4 = 92. In this way, the total number of clocks can be calculated from the number of bits of the signal to be measured and the measurement period. And, since the number of toggles is 36, the toggle rate can be calculated as 36 / 92 = 0.39...
[0041] The operating period is the number of cycles of the clock signal during which the valid signal is valid. In FIG. 2, when the valid signal indicates that it is valid, it is indicated by a circle. That is, the operating period is the total number of circles in the example of FIG. 2. The operating period is indicated by the number of circles because the clock repeats at a predetermined clock period, and the measurement period can be calculated by multiplying the number of circles by the predetermined clock period. The operation rate is the ratio of the operating period to the measurement period. In this way, if the operating period and the measurement period are known, the operation rate can be calculated.
[0042] In the example of FIG. 2, the measurement period is T1 to T23, which is 23, and the operation period is 18, so that the operation rate can be calculated as 18 / 23=0.78···.
[0043] Now, let us return to the explanation of FIG.
[0044] The measurement circuit 201 is connected to the input side of the processing circuit 101, and receives one system of input signal, a valid signal, and a clock signal input to the processing circuit 101. During a measurement period, the measurement circuit 201 measures a toggle number N1, which is the number of changes in a signal value indicated by an input signal (first input signal) to the processing circuit 101, and an operation period P1, which is a period during which the input signal is valid. The measurement circuit 201 is an example of a first measurement unit. The toggle number N1 is an example of a first toggle number. The operation period P1 is an example of a first operation period.
[0045] The measurement circuit 202 is connected to the output side of the processing circuit 101, and receives one of the two output signals output from the processing circuit 101 (first output signal), a valid signal, and a clock signal. During the measurement period, the measurement circuit 202 measures a toggle number N2, which is the number of changes in the signal value indicated by the output signal (first output signal) from the processing circuit 101 to the processing circuit 102, and an operation period P2, which is the period during which the output signal is valid. Since the output signal from the processing circuit 101 to the processing circuit 102 is an input signal to the processing circuit 102, the toggle number N2 and the operation period P2 can also be said to be measurement results for the input signal to the processing circuit 102. The measurement circuit 202 is an example of a second measurement unit. The toggle number N2 is an example of a second toggle number. The operation period P2 is an example of a second operation period.
[0046] The measurement circuit 203 is connected to the output side of the processing circuit 101, and receives one of the two output signals output from the processing circuit 101 to the processing circuit 103, a valid signal, and a clock signal. During a measurement period, the measurement circuit 203 measures a toggle number N3, which is the number of changes in the signal value indicated by the output signal from the processing circuit 101 to the processing circuit 103, and an operation period P3, which is the period during which the output signal is valid. Note that the output signal from the processing circuit 101 to the processing circuit 103 is an input signal to the processing circuit 103, so the toggle number N3 and the operation period P3 can also be said to be measurement results for the input signal to the processing circuit 103.
[0047] The measurement circuit 204 is connected to the output side of the processing circuit 102, and receives one system of output signal, a valid signal, and a clock signal output from the processing circuit 102. During a measurement period, the measurement circuit 204 measures a toggle number N4, which is the number of changes in the signal value indicated by the output signal of the processing circuit 102, and an operation period P4, which is a period during which the output signal is valid. The toggle number N4 is an example of a fourth toggle number. The operation period P4 is an example of a fourth operation period.
[0048] The measurement circuit 205 is connected to the input side of the processing circuit 103, and receives one of the two input signals input to the processing circuit 103, a valid signal, and a clock signal. The one input signal received by the measurement circuit 205 is an input signal different from the one input signal from the processing circuit 101, among the two input signals input to the processing circuit 103. During the measurement period, the measurement circuit 205 measures a toggle number N5, which is the number of changes in the signal value indicated by the input signal to the processing circuit 103, and an operation period P5, which is the period during which the input signal is valid.
[0049] The measurement circuit 206 is connected to the output side of the processing circuit 103, and receives one system of output signal, a valid signal, and a clock signal output from the processing circuit 103. During a measurement period, the measurement circuit 206 measures a toggle number N6, which is the number of changes in the signal value indicated by the output signal of the processing circuit 103, and an operation period P6, which is the period during which the output signal is valid.
[0050] The detailed configuration of the plurality of measuring circuits 201 to 206 will be described later.
[0051] The period measurement circuit 300 measures the measurement period. The period measurement circuit 300 receives a clock signal and a control signal. The control signal includes a measurement start signal and a measurement end signal. The measurement start signal is a signal indicating the start timing (start cycle) of the measurement period. The measurement end signal is a signal indicating the end timing (end cycle) of the measurement period. The period measurement circuit 300 measures the measurement period by counting the number of clocks from the start timing indicated by the measurement start signal to the end timing indicated by the measurement end signal. In other words, the measurement period is indicated by the number of clocks from the start timing to the end timing. The detailed configuration of the period measurement circuit 300 will be described later.
[0052] The measurement results from the measurement circuits 201 to 206 and the measurement result from the period measurement circuit 300 are output to the calculation section 500 via the bus 400.
[0053] The calculation section 500 calculates the power consumption of each processing circuit during a measurement period based on the measurement results from a measurement circuit connected to the input side of the processing circuit and the measurement results from a measurement circuit connected to the output side of the processing circuit. The calculation section 500 may measure the power consumption of the entire circuit based on the toggle numbers N1 to N6 and the operation periods P1 to P6 obtained by changing the operating conditions of the power measuring circuit 100.
[0054] The calculation unit 500 calculates the power consumption of the processing circuit 101 based on the toggle number N1 and the operation period P1 measured by the measurement circuit 201 during the measurement period, the toggle number N2 and the operation period P2 measured by the measurement circuit 202 during the measurement period, and the toggle number N3 and the operation period P3 measured by the measurement circuit 203 during the measurement period. Similarly, the calculation unit 500 calculates the power consumption of the processing circuit 102 based on the toggle number N2 and the operation period P2 measured by the measurement circuit 202 during the measurement period, and the toggle number N4 and the operation period P4 measured by the measurement circuit 204 during the measurement period. Similarly, the calculation unit 500 calculates the power consumption of the processing circuit 103 based on the toggle number N3 and the operation period P3 measured by the measurement circuit 203 during the measurement period, the toggle number N5 and the operation period P5 measured by the measurement circuit 205 during the measurement period, and the toggle number N6 and the operation period P6 measured by the measurement circuit 206 during the measurement period.
[0055] The calculation unit 500 calculates the power consumption of the processing circuit to be measured by a power calculation formula using regression coefficients obtained by multiple regression analysis based on the toggle rate calculated based on the toggle number and the operation rate calculated based on the operation period on each of the input side and output side of the processing circuit to be measured. For example, power PW1 calculated from the toggle rate and operation rate on the input side of the processing circuit 101, power PW2 calculated from the toggle rate and operation rate on the output side of the processing circuit 101, and power PW3 calculated from the toggle rate and operation rate on the other output side of the processing circuit 101 are each calculated by the following formulas. Note that kn1, kn2, kn3, kp1, kp2, and kp3 are regression coefficients.
[0056] PW1 = kn1 × N1 + kp1 × P1 PW2 = kn2 × N2 + kp2 × P2 PW3 = kn3 × N3 + kp3 × P3
[0057] The power consumption PW of the processing circuit 101 is calculated by the following formula.
[0058] PW=PW1+PW2+PW3
[0059] The regression coefficients can be calculated by creating a number of different operating states of the circuits, measuring the power of the entire circuit in each operating state at the external power supply terminal of the SoC, and simultaneously acquiring the toggle rate and operation rate of the input side of the processing circuit 101, the toggle rate and operation rate of the output side of the processing circuit 101, and the toggle rate and operation rate of another output side of the processing circuit 101, and performing multiple regression analysis from the acquired data.
[0060] The calculation section 500 is realized by a processor inside the power measuring circuit 100. The calculation section 500 may be realized by a computer outside the power measuring circuit 100.
[0061] Next, a description will be given of the specific configuration of the measuring circuits 201 to 206. Note that since the measuring circuits 201 to 206 have the same configuration, the configuration of the measuring circuit 201 will be described as a representative example.
[0062] FIG. 3 is a block diagram showing an example of the configuration of the measurement circuit.
[0063] The measurement circuit 201 includes a flip-flop 211 , an exclusive OR 212 , a toggle bit counter 213 , a flip-flop 214 , a mask processing unit 215 , a counter 216 , a flip-flop 217 , a counter 218 , and a flip-flop 219 .
[0064] Flip-flop 211 is a holding circuit that holds a first signal value, which is a signal value indicated by a signal to be measured in a first clock cycle. The signal value indicated by the signal to be measured is represented by, for example, 4 bits. Note that the signal value may be represented by any number of bits as long as the number is 1 bit or more. Flip-flop 211 outputs the held first signal value in the next clock cycle.
[0065] The exclusive OR 212 acquires the first signal value held by the flip-flop 211 and the second signal value indicated by the signal to be measured in the second clock cycle following the first clock cycle, and outputs the result of comparing the first signal value with the second signal value. For example, the exclusive OR 212 compares the first signal value with the second signal value, and outputs "1" for bits that differ and "0" for bits that are the same.
[0066] The toggle bit counter 213 counts the number of "1"s contained in the value output by the exclusive OR 212, and the number of bits where the first signal value and the second signal value differ from each other.
[0067] The flip-flop 214 holds the signal value of the valid signal in the first clock cycle, and outputs the held signal value in the next clock cycle.
[0068] The mask processing unit 215 performs mask processing on the count result of the toggle bit counter 213 when the signal value of the valid signal in the first clock cycle output from the flip-flop 214 is "0". That is, the mask processing unit 215 masks the count result in which the signal to be measured is invalid, among the count results by the toggle bit counter 213. Specifically, in the mask processing, the mask processing unit 215 sets the count result of the toggle bit counter 213 to 0 and outputs it when the signal value of the valid signal in the first clock cycle output from the flip-flop 214 is "0", and outputs the count result of the toggle bit counter 213 without changing it when the signal value of the valid signal is "1".
[0069] Counter 216 counts the count results after mask processing is performed by mask processing unit 215. That is, counter 216 counts the number of times each bit of Data[0] to Data[3] changes when the valid signal indicates that the signal is valid. Counter 216 resets the counter in response to the measurement start timing indicated by the measurement start signal, counts the count results after the measurement start timing, and outputs the count result to flip-flop 217. Counter 216 is an example of a valid bit counter.
[0070] Flip-flop 217 holds the count result by counter 216 and outputs the count result according to the measurement end timing indicated by the measurement end signal. As a result, flip-flop 217 outputs the valid bit count result counted by counter 216 during the measurement period as the toggle number. Flip-flop 217 is an example of an output section.
[0071] Counter 218 counts the period during which the signal value of the valid signal is "1" (i.e., the period during which the signal to be measured is valid). Counter 218 resets the counter according to the measurement start timing indicated by the measurement start signal, counts the period during which the signal to be measured is valid after the measurement start timing, and outputs the count result to flip-flop 219. Counter 218 is an example of a valid period counter.
[0072] Flip-flop 219 holds the count result by counter 218 and outputs the count result according to the measurement end timing indicated by the measurement end signal. As a result, flip-flop 219 outputs the valid period count result counted by counter 218 during the measurement period as the operation period. Flip-flop 219 is an example of a second output section.
[0073] Next, a specific configuration of the period measuring circuit 300 will be described.
[0074] FIG. 4 is a block diagram showing an example of the configuration of the period measuring circuit.
[0075] The period measuring circuit 300 includes a counter 301 and a flip-flop 302 .
[0076] Counter 301 receives a signal indicating “1”, a clock signal, and a measurement start signal, resets the counter in accordance with the measurement start timing indicated by the measurement start signal, counts the clocks after the measurement start timing, and outputs the count result to flip-flop 302.
[0077] Flip-flop 302 holds the count result by counter 301 and outputs the count result in accordance with the measurement end timing indicated by the measurement end signal. As a result, flip-flop 302 outputs the count result counted by counter 301 as the measurement period T. Flip-flop 302 is an example of a first output unit.
[0078] FIG. 5 is a diagram for explaining the timing at which the toggle number, the operation period, and the measurement period are determined.
[0079] As shown in FIG. 5, since the measurement end signal indicates the measurement end timing at time T15, the toggle number, the operation period, and the measurement period are determined at time T15.
[0080] [Effects, etc.] The power measuring circuit 100 according to this embodiment is a power measuring circuit that calculates power consumption in an integrated circuit having a plurality of processing circuits 101-103. The power measuring circuit 100 includes a period measuring circuit 300, a plurality of measuring circuits 201-206, and a calculation unit 500. The period measuring circuit 300 measures a measurement period. The measuring circuit 201 measures a toggle number N1, which is the number of changes in a signal value indicated by an input signal to the processing circuit 101 (first target circuit) among the plurality of processing circuits 101-103, during the measurement period, and an operation period P1, which is a period during which the input signal is valid. The measuring circuit 202 measures a toggle number N2, which is the number of changes in a signal value indicated by an output signal from the processing circuit 101, during the measurement period, and an operation period P2, which is a period during which the output signal is valid. The measurement circuit 203 measures, during a measurement period, a toggle number N3, which is the number of changes in the signal value indicated by the output signal from the processing circuit 101, and an operation period P3, which is a period during which the output signal is valid. The calculation unit 500 calculates the power consumption of the processing circuit 101 based on the toggle number N1 and operation period P1 measured during the measurement period by the measurement circuit 201, the toggle number N2 and operation period P2 measured during the measurement period by the measurement circuit 202, and the toggle number N3 and operation period P3 measured during the measurement period by the measurement circuit 203.
[0081] According to this, the power consumption of the processing circuit 101 during the measurement period is calculated based on the toggle number N1 and operation period P1 measured based on the input signal to the processing circuit 101, the toggle number N2 and operation period P2 measured based on the output signal from the processing circuit 101, and the toggle number N3 and operation period P3 measured based on another system of output signal from the processing circuit 101. In other words, it is possible to easily calculate the first power consumption of the processing circuit 101 in the integrated circuit.
[0082] In the power measuring circuit 100 according to this embodiment, the measuring circuit 204 measures, during a measurement period, a toggle number N4 which is the number of changes in the signal value indicated by the output signal from a processing circuit 102 to which an output signal of one system of the processing circuit 101 is input as an input signal among the multiple processing circuits 101 to 103, and an operating period P4 which is a period during which the output signal is valid. The calculating section 500 further calculates the power consumption of the processing circuit 102 based on the toggle number N2 and operating period P2 measured by the measuring circuit 202 during the measurement period and the toggle number N4 and operating period P4 measured by the measuring circuit 204 during the measurement period.
[0083] According to this, the power consumption of the processing circuit 102 is calculated using the toggle number N2 and the operating period P2 measured based on one output signal from the processing circuit 101, so that the number of measurement circuits for measuring the toggle number and the operating period can be reduced.
[0084] In the power measuring circuit 100 according to this embodiment, each of the measuring circuits 201 to 206 includes a flip-flop 211 (holding circuit), a toggle bit counter 213, a mask processing unit 215, a counter 216 (valid bit counter), a counter 218 (valid period counter), and flip-flops 217 and 219 (second output units). The flip-flop 211 holds a first signal value which is a signal value of the signal to be measured in a first clock cycle. The toggle bit counter 213 counts bits in which the first signal value is different from a second signal value which is a signal value of the signal to be measured in a second clock cycle following the first clock cycle. The mask processing unit 215 performs mask processing on count results in which the signal to be measured is invalid, among the count results by the toggle bit counter 213. The counter 216 counts the count results on which the mask processing is performed by the mask processing unit 215. The counter 218 counts the period in which the signal to be measured is valid. During the measurement period, flip-flops 217 and 219 output the valid bit count result counted by counter 216 as the toggle number, and output the valid period count result counted by counter 218 as the operation period.
[0085] According to this, since the counter 216 (valid bit counter) for measuring the number of toggles and the counter 218 (valid period counter) for counting the operation period are separately provided, it is possible to measure the number of toggles and the operation period during the same measurement period. Therefore, it is possible to more accurately calculate the first power consumption of the first target circuit.
[0086] (Variation 1) A measuring circuit 201A according to the first modification will be described.
[0087] 6 is a block diagram showing an example of the configuration of a measurement circuit according to Modification 1. Measurement circuit 201A may be used in place of any of measurement circuits 201 to 206 in the embodiment.
[0088] Measurement circuit 201A according to the first modification is different from measurement circuit 201 according to the embodiment in that it further includes switching section 220 and does not include counter 218 and flip-flop 219. Measurement circuit 201A according to the first modification causes counter 216 and flip-flop 217 to function as counter 218 and flip-flop 219 according to the embodiment. That is, measurement circuit 201A is configured to switch between a function of counting the number of toggles and a function of counting the operation period in a time-division manner, and realize these functions by using common counter 216 and flip-flop 217. The following mainly describes the differences.
[0089] The switching unit 220 switches between the first count mode and the second count mode in response to a switching signal. That is, the switching unit 220 receives as two inputs the count result on which the masking process has been performed, which is output from the mask processing unit 215, and the signal value of the valid signal in the first clock cycle, which is output from the flip-flop 214, and selects one of the inputs in response to the switching signal.
[0090] The counter 216 counts the count results masked by the mask processing unit 215 during a first measurement period in a first count mode, and counts the period during which the signal to be measured is valid during a second measurement period in a second count mode.
[0091] The flip-flop 217 outputs the valid bit count result counted by the counter 216 as the toggle number during the first measurement period, and outputs the valid period count result counted by the counter 216 as the operation period during the second measurement period.
[0092] This allows a common counter to be used to measure the number of toggles and the operation period, thereby making it possible to reduce the circuit scale of the power measuring circuit 100.
[0093] (Variation 2) A power measuring circuit 100A according to the second modification will be described.
[0094] FIG. 7 is a block diagram showing an example of the configuration of a power measuring circuit according to the second modification.
[0095] The power measuring circuit 100A according to the second modification is different from the power measuring circuit 100 according to the embodiment in that it further includes switching units 221-223 and does not include measuring circuits 201, 204, 205. In the power measuring circuit 100A according to the second modification, the measuring circuit 202 measures signals on the input side and output side of the processing circuit 102 by switching using the switching unit 221, the measuring circuit 203 measures signals on one system on the input side and output side of the processing circuit 101 by switching using the switching unit 223, and the measuring circuit 206 measures signals on one system on the input side and the output side of the processing circuit 103 by switching using the switching unit 222. In other words, the measuring circuits 202, 203, 206 measure a plurality of signals (for example, signals on the input side and signals on the output side) by switching using the switching units 221-223 in a time-division manner. Each of the switching units 221 to 223 switches between a first operation mode in which the measurement circuit to which the switching unit is connected is connected to the input side of the processing circuit to be measured by the measurement circuit, and a second operation mode in which the measurement circuit is connected to the output side of the processing circuit. In the first operation mode, the measurement circuit operates as a measurement circuit that measures a signal on the input side, and in the second operation mode, the measurement circuit operates as a measurement circuit that measures a signal on the output side.
[0096] In the above example, the switching unit is connected so that the measurement circuit is selectively connected to one of the input side and the output side of the circuit to be measured, but the present invention is not limited to this example, and the switching unit may be connected so that the measurement circuit is selectively connected to one of the output side of the processing circuit and the output side of another processing circuit, or the switching unit may be connected so that the measurement circuit is selectively connected to one of the input side of the processing circuit and the input side of another processing circuit.
[0097] According to the power measuring circuit 100A of the second modification, the two measuring circuits can be replaced by one common measuring circuit, and the circuit scale of the power measuring circuit 100A can be reduced.
[0098] (Variation 3) A power measuring circuit 100B according to the third modification will be described.
[0099] FIG. 8 is a block diagram showing an example of the configuration of a power measuring circuit according to the third modification.
[0100] The power measuring circuit 100B according to the third modification is different from the power measuring circuit 100 according to the embodiment in that it further includes a selector 600 and two measuring circuits 201B, 202B. In the power measuring circuit 100B according to the third modification, the selector 600 connected to the input and output sides of the three processing circuits 101 to 103 selects a plurality of signals to be measured (two in the third modification, i.e., the number of measuring circuits) and outputs the selected plurality of signals to the measuring circuits 201B, 202B. This allows the measuring circuits 201B, 202B to measure the selected signals and obtain the toggle count and operation period of the signals.
[0101] In this way, the selector 600 connects two measurement targets among the input side and output side of the processing circuit to be measured to the two measurement circuits 201B and 202B. In other words, the measurement circuits 201B and 202B can be made to function so as to measure the signals of the two measurement targets selected from the multiple input sides and output sides. For example, the selector 600 can select the input side of the processing circuit 102 and the output side of the processing circuit 102, thereby obtaining the number of toggles and the operation period of the input side and the number of toggles and the operation period of the output side for calculating the power consumption of the processing circuit 102 in the same measurement period. Therefore, there is a possibility that the power consumption of the processing circuit 102 can be calculated with high accuracy.
[0102] Note that, since the power measuring circuit 100B according to the third modification includes two measuring circuits 201B, 202B, the selector 600 selects any two signals from among the input side signals and output side signals of the three processing circuits 101 to 103, but this is not limited to this. The power measuring circuit 100B may include three or more (or one) measuring circuits, and the selector 600 may select signals equal to the number of the measuring circuits.
[0103] (Other embodiments) Although the power measurement circuit according to one or more aspects has been described based on the above embodiment, the present disclosure is not limited to the above embodiment. As long as it does not deviate from the spirit of the present disclosure, various modifications conceived by a person skilled in the art to the above embodiment may also be included within the scope of the present disclosure. [Industrial Applicability]
[0104] The present disclosure is useful as a power estimation circuit or the like that can easily calculate the power consumption of a specific processing circuit in an integrated circuit. [Explanation of symbols]
[0105] 100, 100A, 100B Power measurement circuit 101~103 Processing circuit 201~206, 201A, 201B, 202B Measuring circuit 211, 214, 217, 219, 302 Flip-flops 212 Exclusive OR 213 Toggle Bit Counter 215 Mask processing section 216, 218, 301 Counters 220, 221-223 Switching section 300 Period measurement circuit 400 Bus 500 Calculation Unit 600 Selector
Claims
1. A power measurement circuit for calculating power consumption in an integrated circuit having a plurality of processing circuits, comprising: a period measurement circuit for measuring a measurement period; a first measurement unit that measures a first toggle number, which is the number of changes in a signal value indicated by a first input signal to a first target circuit among the plurality of processing circuits, during the measurement period, and a first operation period, which is a period during which the first input signal is valid; a second measurement unit that measures a second toggle number, which is the number of times a signal value indicated by a first output signal from the first target circuit changes, and a second operation period, which is a period during which the first output signal is valid, during the measurement period; a calculation unit that calculates a first power consumption of the first target circuit based on the first toggle number and the first operation period measured by the first measurement unit during the measurement period, and the second toggle number and the second operation period measured by the second measurement unit during the measurement period. Power measurement circuit.
2. moreover, a third measurement unit that measures a third toggle number, which is the number of changes in a signal value indicated by a second input signal to a second target circuit among the plurality of processing circuits, during the measurement period, and a third operation period, which is a period during which the second input signal is valid; a fourth measurement unit that measures a fourth toggle number, which is the number of times a signal value indicated by a second output signal from the second target circuit changes, during the measurement period, and a fourth operation period, which is a period during which the second output signal is valid; The calculation unit further calculates a second power consumption of the second target circuit based on the third toggle number and the third operation period measured by the third measurement unit during the measurement period, and the fourth toggle number and the fourth operation period measured by the fourth measurement unit during the measurement period.
2. The power measurement circuit of claim 1.
3. moreover, a fourth measurement unit configured to measure, during the measurement period, a fourth toggle number that is the number of changes in a signal value indicated by a second output signal from a second target circuit, which receives the first output signal as an input signal, among the plurality of processing circuits, and a fourth operation period that is a period during which the second output signal is valid; The calculation unit further calculates a second power consumption of the second target circuit based on the second toggle number and the second operation period measured by the second measurement unit during the measurement period, and the fourth toggle number and the fourth operation period measured by the fourth measurement unit during the measurement period.
2. The power measurement circuit of claim 1.
4. The period measurement circuit includes: a counter to which a clock signal and a measurement start signal are input, the counter counting the clock signal after the measurement start signal is input; a first output section to which the clock signal, the count result by the counter, and a measurement end signal are input, and which outputs the count result at the time when the measurement end signal is input as a measurement period.
2. The power measurement circuit of claim 1.
5. Each of the first measurement unit and the second measurement unit is a holding circuit that holds a first signal value that is a signal value of the first input signal or the first output signal in a first clock cycle; a toggle bit counter that counts bits in which the first signal value and a second signal value, which is a signal value of the first input signal or the first output signal in a second clock cycle following the first clock cycle, are different from each other; a mask processing unit that performs a mask process on a count result in which the first input signal or the first output signal is invalid, among count results by the toggle bit counter; a valid bit counter that counts the count result that has been subjected to the masking process by the masking process unit; a validity period counter that counts a period during which the first input signal or the first output signal is valid; a second output unit that outputs a valid bit count result counted by the valid bit counter during the measurement period as the first toggle number or the second toggle number, and outputs a valid period count result counted by the valid period counter as the first operation period or the second operation period. A power measurement circuit according to any one of claims 1 to 4.
6. Each of the first measurement unit and the second measurement unit is a holding circuit that holds a first signal value that is a signal value of the first input signal or the first output signal in a first clock cycle; a toggle bit counter that compares the first signal value with a second signal value that is a signal value of the first input signal or the first output signal in a second clock cycle following the first clock cycle, and counts the number of bits in which the first signal value and the second signal value are different from each other; a masking processing unit that masks a count result in which the first input signal or the first output signal is invalid, among count results by the toggle bit counter; a first switching unit that switches between a first count mode and a second count mode; an effective counter that counts the count result masked by the mask processing unit during a first measurement period in the first count mode, and counts a period during which the first input signal or the first output signal is effective during a second measurement period in the second count mode; a second output unit that outputs a valid bit count result counted by the valid counter during the first measurement period as the first toggle number or the second toggle number, and that outputs a valid period count result counted by the valid counter during the second measurement period as the first operation period or the second operation period. A power measurement circuit according to any one of claims 1 to 4.
7. the first measurement unit and the second measurement unit are configured by a first measurement circuit, The power measurement circuit further comprises: a second switching unit that switches between a first operation mode in which the first measurement circuit and an input side of the first target circuit are connected and a second operation mode in which the first measurement circuit and an output side of the first target circuit are connected; The first measurement circuit operates as the first measurement unit in the first operation mode and operates as the second measurement unit in the second operation mode. A power measurement circuit according to any one of claims 1 to 4.
8. moreover, a third measurement unit that measures a third toggle number, which is the number of changes in a signal value indicated by a second input signal to a second target circuit among the plurality of processing circuits, during the measurement period, and a third operation period, which is a period during which the second input signal is valid; a fourth measurement unit that measures a fourth toggle number, which is the number of times a signal value indicated by a second output signal from the second target circuit changes, during the measurement period, and a fourth operation period, which is a period during which the second output signal is valid; Two of the first measurement unit, the second measurement unit, the third measurement unit, and the fourth measurement unit are each composed of a first measurement circuit and a second measurement circuit, The power measurement circuit further comprises: a selector that connects two of the measurement targets, an input side of the first target circuit, an output side of the first target circuit, an input side of the second target circuit, and an output side of the second target circuit, to the first measurement circuit and the second measurement circuit; The first measurement circuit and the second measurement circuit operate as a measurement unit that measures the two measurement targets selected by the selector. A power measurement circuit according to any one of claims 1 to 4.
Citation Information
Patent Citations
Semiconductor integrated circuit
JP2002252329A
Method and device for power consumption evaluation
JP2002288257A
Power consumption calculating method
JP2004062238A
Method for evaluating power consumption and system for evaluating power consumption
JP2006285835A
Power Computation Logic
US20180121573A1