1. Field of the Invention
The invention relates to a method of reducing power leakage in processors or ICs, and in particular to a method of power-gating instruction scheduling for power leakage reduction.
2. Description of the Related Art
Overall power dissipation in semiconductor application comprises static power dissipation and dynamic power dissipation, generated by current leakage and switching transient current in complementary metal oxides semiconductor (CMOS) circuits, respectively. As semiconductor technology continues to scale down to deep-submicron levels, power leakage gains more significance in the total power dissipation.
In recent years, many power-gating mechanisms have been developed and employed to reduce the static power loss generated by the current leakage in CMOS circuits. The power-gating mechanisms insert power-gating instructions into a program to reduce power leakage of power-gated components in the processor. The power-gating instructions comprise power-off and power-on instructions to shut down inactive power-gated components.
ROC. Pat. Pub. No. 00519599 discloses architecture and complier solutions to employ a power-gating mechanism to reduce the current leakage in power-gated components of a processor executing a program. The power-gating mechanism analyzes utilization of the power-gated components by data-flow analysis on the basis of the program and then inserts power-off and power-on instructions into the program to shut down the inactive power-gated components.
However, the power-off and power-on instructions increase execution time of the program and increase code size. With the development of semiconductor manufacturing technologies, the increasing number of power-gated components in a processor aggravates the above drawbacks. Moreover, fetching and decoding of power-gating instructions, and shut-down and wake-up procedures all results in power loss. Power loss from wake-up is derived from peak-voltage requirements. Therefore, it is advantageous necessary to reduce power-gating instructions.
The invention provides a method of reducing power-gating instructions without increasing power loss. By postponing the power-off instruction to other blocks and advancing the power-on instructions to other blocks, the combined power-gating instructions are merged as one compound power-gating instruction, enabling power reduction and reducing code size. The invention provides a method of power-gating instruction scheduling for power leakage reduction comprising receiving a program, generating a control-flow graph which divides the program into a plurality of blocks, analyzing utilization of power-gated components of a processor executing the program, generating the first power-gating instruction placement comprising power-off instructions and power-on instructions to shut down the inactive power-gated components, generating the second power-gating instruction placement by merging the power-off instructions into one compound power-off instruction and merging the power-on instructions into one compound power-on instruction and inserting power-gating instructions into the program in accordance with the second power-gating instruction placement.
The invention also provides a system of power-gating instruction scheduling for reducing power leakage, receiving a program, generating a power-gated program comprising power-gating instructions, and comprising a control-flow graph construction module, generating a control-flow graph by dividing the program into a plurality of blocks and linking the blocks according to the program, wherein the control-flow graph contains control commands, a utilization analysis module, analyzing utilization of power-gated components of a processor executing the program, a first power-gating instruction placement generator, generating first power-gating instruction placement based on the control-flow graph and the utilization of the power-gated components, the first power-gating instruction placement comprising a plurality of power-off instructions and a plurality of power-on instructions to shut down inactive power-gated components, a second power-gating instruction placement generator, generating second power-gating instruction placement by modifying the first power-gating instruction placement, wherein the second power-gating instruction placement comprises compound power-off instructions and compound power-on instructions generated by combining the power-off instructions and the power-on instructions respectively, and a power-gating instruction insertion module, inserting the power-gating instructions into the program according to the second power-gating instruction placement to generate the power-gated program.
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
Step 302 to 304 can be implemented by the processes disclosed in ROC. Pat. Pub. No. 00519599 or other technologies such as profiling mechanisms which can also be applied to generate the first power-gating instruction placement. Other suitable technologies generating the first power-gating instruction placement by software or hardware solution are also applicable.
In an exemplary embodiment of the invention, MAX-SINK-SLKC represents the maximum number of blocks to which the power-off instruction of component C can be postponed. SINK-SLKC represents the number of blocks to which the power-off instruction of component C can be postponed from the present block. SINK-SLKC is calculated by the formula
Eoff(C)+Prleak(C)·SINK—SLKC>Efet-dec-off(C)/N+Eexe-off(C)+Pleak(C)·SINK—SLKC, (1).
where Efet-dec-off(C) represents energy consumption of fetching and decoding the power-off instruction of component C, Eexe-off(C) represents energy consumption of executing the power-off instruction of component C, N represents the amount of power-gated components in the processor, Pleak(C) represents leakage energy consumption of component C during a block cycle, Prleak(C) represents reduced leakage energy consumption of component C during a block cycle when the component C is shut down, Eoff(C) represents energy consumption of issuing the power-off instruction of component C, and the value of Eoff(C) equals the sum of Eexe-off(C) and Efet-dec-off(C). MAX-SINK-SLKC is calculated according to formula (1), wherein
Similarly, MAX-HOIST-SLKC represents the maximum number of blocks to which the power-on instruction of component C can be advanced. HOIST-SLKC represents the number of blocks to which the power-on instruction of component C can be advanced from the present block. HOIST-SLKC is calculated by the formula
Eon(C)+Prleak(C)·HOIST—SLKC>Efet-dec-on(C)/N+Eexe-on(C)+Pleak(C)·HOIST—SLKC, (3)
where Efet-dec-on(C) represents energy consumption of fetching and decoding a power-on instruction of component C, Eexe-on(C) represents energy consumption of executing the power-off instruction of component C, N represents the number of power-gated components in the processor, Eon(C) represents energy consumption of issuing the power-on instruction of component C, and the value of Eon(C) equals the sum of Eexe-on(C) and Efet-dec-on(C). MAX-HOIST-SLKC is calculated according to formula (3), wherein
SINKABLEloc(b), SINKABLEblk(b), SINKABLEin(b), and SINKABLEout(b) of each block b are determined to perform a data-flow analysis to determine the executable power-off instructions in each block. SINK-SLKCb represents the number of blocks to which the power-off instruction of component C can be postponed from block b.
In step 502 and step 503, SINKABLEblk(b), SINKABLEin(b), and SINKABLEout(b) of each block b are determined from the beginning block to the end and repeatedly until SINKABLEout(b) of each block b is stabilized. The method of determining SINKABLEblk(b), SINKABLEin(b), and SINKABLEout(b) in one block b comprises determining SINKABLEin(b) by the formula
where Pred(b) represents the former blocks of the block b. SINK-SLKCb of component C, the power-off instruction of which exists in SINKABLEin(b) and not in SINKABLEloc(b), is determined by the formula SINK-SLKCb=MINp∈Pr ed(b)(SINK-SLKCp)−1. The components in SINKABLEblk(b) are power-off instructions having zero SINK-SLKCb. Finally, SINKABLEout(b) is determined by the formula
SINKABLEout(b)=SINKABLEloc(b)∪(SINKABLEin(b)−SINKABLEblk(b)).
If the components in SINKABLEout(b) of each block b are invariable (step 503), SINKABLEout(b) of every block b is regarded as stable and the power-off instructions in SINKABLEout(b) are the executable power-off instructions of each block b.
Similarly, HOISTABLEloc(b), HOISTABLEin(b), HOISTABLEblk(b), and HOISTABLEout(b) of each block b are determined to perform a data-flow analysis to determine the executable power-on instructions in each block. HOIST-SLKCb represents the number of blocks to which the power-on instruction of component C can be advanced from block b.
In step 602 and step 603, HOISTABLEin(b), HOISTABLEblk(b), and HOISTABLEout(b) of each block b are determined from the beginning block to the end and repeatedly until HOISTABLEin(b) of each block b is stable. Determining HOISTABLEin(b), HOISTABLEblk(b), and HOISTABLEout(b) in one block b comprising determining HOISTABLEout(b) by the formula
where Succ(b) represents the subsequent blocks of the block b. HOIST-SLKCb of component C, the power-on instruction of which exists in HOISTABLEout(b) and not in HOISTABLEloc(b), is determined by the formula HOIST-SLKCb=MINs∈Succ(b)(HOIST-SLKCs)−1. The components in HOISTABLEblk(b) are the power-on instructions having zero HOIST-SLKCb. HOISTABLEin(b) is determined by the formula
HOISTABLEin(b)=HOISTABLEloc(b)∪(HOISTABLEout(b)−HOISTABLEblk(b)).
If the components in HOISTABLEin(b) of each block b are invariable (step 603), HOISTABLEin(b) of every block b is regarded as stable and the power-on instructions in HOISTABLEin(b) are the executable power-on instructions of each block b.
GROUP-OFFloc(b), GROUP-OFFin(b), GROUP-OFFblk(b), and GROUP-OFFout(b) of each block b are determined to perform a data-flow analysis to class the executable blocks of the combinable power-off instructions into one group.
In step 701, if
GROUP-OFFloc(b) of block b is assigned an integer number not occurring before to generate a new group. The integer number is generated by a counter. Once a new group is determined, the output of the counter is increased by one.
In step 702 and step 703, GROUP-OFFin(b), GROUP-OFFblk(b), and GROUP-OFFout(b) of each block b are determined from the beginning block to the end and repeatedly until GROUP-OFFout(b) of every block b is stable. Determining GROUP-OFFin(b), GROUP-OFFblk(b), and GROUP-OFFout(b) in one block b comprising determining GROUP-OFFin(b) by the formula
where Φ returns infinity if its parameter, GROUP-OFFout(p), is an empty set, otherwise, Φ returns the value of GROUP-OFFout(p). GROUP-OFFblk(b), either a universal set named Ω or an empty set, is determined, wherein GROUP-OFFblk(b) is a universal set Ω only when
GROUP-OFFout(b) is determined by the formula
GROUP-OFFout(b)=GROUP-OFFloc(b)∪(GROUP-OFFin(b)−GROUP-OFFblk(b)).
If the components in GROUP-OFFout(b) of each block b are invariable (step 703), GROUP-OFFout(b) of every block b is regarded as stable, with the component in GROUP-OFFout(b) representing the group number to which block b belongs.
GROUP-ONloc(b), GROUP-ONin(b), GROUP-ONblk(b), and GROUP-ONout(b) of each block b are determined to perform a data-flow analysis to class the executable blocks of the combinable power-on instructions into one group.
In step 801, if
GROUP-ONloc(b) of block b is assigned an integer number not occurring before to generate a new group. The integer number is generated by a counter. Once a new group is determined, the output of the counter is increased by one.
In step 802 and step 803, GROUP-ONin(b), GROUP-ONblk(b), and GROUP-ONout(b) of each block b are determined from the beginning block to the end and repeatedly until GROUP-ONout(b) of every block b is stable. Determining GROUP-ONin(b), GROUP-ONblk(b), and GROUP-ONout(b) in one block b comprising determining GROUP-ONin(b) by the formula
GROUP-ONblk(b), either a universal set named Ω or an empty set, is determined. GROUP-ONblk(b) is a universal set, Ω only when
GROUP-ONout(b) is determined by the formula
GROUP-ONout(b)=GROUP-ONloc(b)∪(GROUP-ONin(b)−GROUP-ONblk(b)).
If the components in GROUP-ONout(b) of each block b are invariable (step 803), GROUP-ONout(b) of every ‘block b is ’ regarded as stable, with the component in GROUP-ONout(b) representing the group number to which block b belongs.
In an exemplary embodiment of the invention, there are two power-gated components in a processor.
Power-off instruction classification module described in
The blocks are divided into two groups (group 1 and group 2). On the basis of the executable power-off instructions of each block, all combinations of power-off instructions in each group are generated. To determine the best combination of each groups for power reduction, the second power-gating instruction placement is generated, shown in
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Number | Date | Country | Kind |
---|---|---|---|
94147221 A | Dec 2005 | TW | national |
Number | Name | Date | Kind |
---|---|---|---|
6185677 | Nijhawan et al. | Feb 2001 | B1 |
6219796 | Bartley | Apr 2001 | B1 |
20020166075 | Agarwal et al. | Nov 2002 | A1 |
20030014742 | Seth et al. | Jan 2003 | A1 |
20030167460 | Desai et al. | Sep 2003 | A1 |
20050114850 | Chheda et al. | May 2005 | A1 |
20060015855 | Kumamoto | Jan 2006 | A1 |
Number | Date | Country |
---|---|---|
519599 | Jun 2001 | TW |
576980 | Feb 2004 | TW |
514828 | Dec 2008 | TW |
Number | Date | Country | |
---|---|---|---|
20070157044 A1 | Jul 2007 | US |