The technology of this disclosure relates to clock gating, and in particular to performing clock gating based on an adaptive hysteresis timer.
Portable electronic devices, such as mobile phones, personal digital assistants (PDAs), and the like, are commonly manufactured using application specific integrated circuit (ASIC) designs. Developments in achieving high levels of silicon integration have allowed creation of complicated ASICs and field programmable gate array (FPGA) designs. These ASICs and FPGAs may be provided in a single chip to provide a system-on-a-chip (SOC). An SOC provides multiple functioning subsystems on a single semiconductor chip, such as for example, processors, multipliers, caches, and other electronic components. SOCs are particularly useful in portable electronic devices because of their integration of multiple subsystems that can provide multiple features and applications in a single chip. Further, SOCs may allow smaller portable electronic devices by use of a single chip that may otherwise have been provided using multiple chips.
Integrated circuits such as those described above may include transaction circuits (such as bus interface circuits or memory controllers, for example). Transaction circuits may facilitate the handling of communications between subsystems of the integrated circuit. The transaction circuits may further include clocked circuitry, which may include as examples registers, queues, and other circuits to manage communications between the various subsystems. The transaction circuits may be clocked with one or more clock signals when servicing transactions. However, continuously clocking the transaction circuits consumes system power even during time periods when the transaction circuits are not servicing transactions, which may be undesirable particularly in mobile systems which rely on battery power or other limited power sources. Thus, it may be desirable to turn off the clocks to the transaction circuits when the transaction circuits are not servicing transactions. However, if a new transaction arrives, a performance penalty may be incurred to turn on the clocks to the respective transaction circuit.
Another approach is to pre-select a fixed number of clock cycles for which the clocks to the transaction circuits remain on after a transaction has been completed. However, due to varying levels of activity for individual transaction circuits, determining a suitable pre-selected number of clock cycles may be difficult and may still involve undesirable tradeoffs in power, performance or both.
Exemplary embodiments are directed to apparatus and method for adaptive hysteresis timer adjustments for clock gating. Such embodiments may allow clock gating for an interface circuit to adapt to changing traffic conditions through the interface circuit.
In an exemplary embodiment, an apparatus comprises a transaction circuit configured to perform transactions. The apparatus further comprises a hysteresis timer having a hysteresis value and configured to start counting based on the hysteresis value when a transaction in the transaction circuit has been completed. The apparatus further comprises a hysteresis timer update circuit configured to monitor the hysteresis timer and the transaction circuit, store an adjustment state based on whether a new transaction is received before, coincident with or after the count of the hysteresis timer expires and adjust the hysteresis value based on the adjustment state.
In another exemplary embodiment, a method of adjusting a hysteresis timer comprises monitoring a transaction circuit to detect completion of a transaction and starting a count from a hysteresis value at the hysteresis timer in response to detecting completion of a transaction. The method further comprises monitoring the hysteresis timer while awaiting a new transaction. The method further comprises adjusting the hysteresis value of the hysteresis timer with an adjustment value if the hysteresis timer does not expire coincident with the arrival of the new transaction.
In another exemplary embodiment, an apparatus comprises means for performing transactions and means for counting based on a hysteresis value when the means for performing transactions has completed performing a transaction. The apparatus further comprises means for updating the means for counting. The means for updating is configured to monitor the means for performing transactions and the means for counting, store an adjustment state based on whether a new transaction is received before, coincident with or after the count of the means for counting expires, and adjust the hysteresis value based on the adjustment state.
In another exemplary embodiment, an apparatus comprises a non-transitory computer-readable medium having instructions stored thereon which, when executed, cause a processor to monitor a transaction circuit to detect completion of a transaction and start a count from a hysteresis value at a hysteresis timer in response to detecting completion of a bus transaction. The instructions further cause the processor to monitor the hysteresis timer while awaiting a new bus transaction and adjust the hysteresis value of the hysteresis timer with an adjustment value if the hysteresis timer does not expire coincident with the arrival of the new bus transaction.
It is understood that other embodiments of the teachings herein will become apparent to those skilled in the art from the following detailed description, wherein various embodiments of the teachings are shown and described by way of illustration. As will be realized, the teachings herein are capable of other and different embodiments without departing from the spirit and scope of the teachings. Accordingly, the drawings and detailed description are to be regarded as illustrative in nature and not as restrictive.
Various aspects of the teachings of the present disclosure are illustrated by way of example, and not by way of limitation, in the accompanying drawings, wherein:
The detailed description set forth below, in connection with the appended drawings, is intended as a description of various exemplary embodiments of the teachings of the present disclosure and is not intended to represent the only embodiments in which such teachings may be practiced. The detailed description includes specific details for the purpose of providing a thorough understanding of the teachings by way of illustration and not limitation. It will be apparent to those skilled in the art that the teachings of the present disclosure may be practiced in a variety of ways. In some instances, well known structures and components are shown in block diagram form in order to avoid obscuring the concepts of the present disclosure.
Embodiments disclosed in the detailed description include a method and apparatus for adaptive hysteresis timer adjustments for clock gating. In one embodiment, an interface circuit includes a transaction circuit coupled to a history register and to a clock gating circuit. The clock gating circuit is responsive to a hysteresis timer and is configured to turn off, or “gate,” the clock signal to the transaction circuit when the hysteresis timer indicates that a number of clock cycles corresponding to a hysteresis value have passed since the last transaction serviced by the interface circuit was completed. The hysteresis timer is responsive to a timer update circuit, which may provide to the hysteresis timer either a programmed hysteresis value or a hysteresis value determined at least in part by a state of the history register. The hysteresis value determined at least in part by the state of the history register may be determined by adjusting a current hysteresis value with an adjustment value, and the adjustment value may be determined by combinational logic (e.g. by selecting a particular input of a multiplexor), by looking up a value in a history table (e.g. a content-addressable memory (CAM) indexed by the history register) or by other means known to those having skill in the art. The adjustment values may be configurable or may be hard-wired. This allows the clock gating circuit to limit performance degradation of the interface circuit by not gating the clock to the interface circuit when receiving multiple transactions that do not arrive back-to-back but nonetheless occur in close temporal proximity to one another, while still realizing power savings by gating the clock to the interface circuit when no new transaction arrives within a period of time corresponding to the hysteresis value.
In this regard and in accordance with one embodiment,
The transaction circuit 110 may be configured to perform transactions for a master device, a slave device, a port of a bus interconnect, a memory or any other device which services transactions. The clock input 111 of the transaction circuit 110 is controlled by the clock gating circuit 120, and any transaction activity through the transaction circuit 110 is monitored by the hysteresis timer update circuit 140 in order to provide adaptive adjustments to the hysteresis timer 130. In one exemplary embodiment, the circuit 100 is a bus interface circuit. In such an embodiment, the transaction circuit 110 may implement and operate according to any synchronous bus protocol, such as AMBA AXI, AHB, APB or others. In another exemplary embodiment, the circuit 100 is a memory and the transaction circuit 110 is a memory controller circuit.
The clock gating circuit 120 receives the system clock 101. While the transaction circuit 110 is performing a transaction, the clock gating circuit provides the clock signal 124 on the transaction clock output 122, which is used to clock the transaction circuit 110 and the hysteresis timer circuit 150. After a transaction has been completed, the clock gating circuit monitors the hysteresis timer 130 via a hysteresis timer interface 131. While the hysteresis timer 130 has not expired (meaning that the hysteresis timer 130 has not counted to a terminal count value), the clock gating circuit 120 continues to provide the clock signal 124 to the transaction circuit 110 and the hysteresis timer circuit 150. After the hysteresis timer 130 expires (meaning that the hysteresis timer 130 has counted to a terminal value), the clock gating circuit 120 gates the system clock by, for example, providing a steady state signal on the transaction clock output 122.
The hysteresis timer 130 is programmed with a hysteresis value by the hysteresis timer update circuit 140 via a hysteresis value interface 142. After completion of a transaction in the transaction circuit 110, the hysteresis timer 130 begins counting. If no new transaction is received by the transaction circuit 110 before the hysteresis timer 130 counts for the number of cycles represented by the hysteresis value (representing the terminal count value), the hysteresis timer 130 expires. If a new transaction is received by the transaction circuit 110 before the hysteresis timer 130 counts for the number of cycles represented by the hysteresis value, the hysteresis timer 130 stops and waits to receive a new hysteresis value. Those having skill in the art will readily understand that the hysteresis timer may be made to count either up or down towards the terminal value.
The hysteresis timer update circuit 140 is responsive to a programming input 103 and a transaction activity interface 141. When providing a hysteresis value to the hysteresis timer 130, the hysteresis timer update circuit is configured to select between a programmed hysteresis value received via the programming input 103 (for example, to allow the hysteresis timer 130 to be programmed with an initial value at boot time) and a value determined at least in part by the timer history register 145. The hysteresis timer update circuit 140 may be configured to monitor the transaction circuit 110 via the transaction activity interface 141 and to provide a start signal to the hysteresis timer 130 via a hysteresis value interface 142 when a transaction has been completed. While the hysteresis timer 130 counts towards the terminal count value, the hysteresis timer update circuit 140 is configured to monitor a current state of the hysteresis timer 130 via the hysteresis timer interface 131 and to monitor the transaction circuit 110 for a new transaction via the transaction activity interface 141. For example, if the hysteresis timer 130 expires before a new transaction is received by the transaction circuit 110, this may represent an INCREMENT current state. If the hysteresis timer 130 expires coincident with when a new transaction is received by the transaction circuit 110, this may represent a NO CHANGE current state. If the hysteresis timer 130 does not expire before a new transaction is receive by the transaction circuit 110, this may represent a DECREMENT current state. The hysteresis timer update circuit 140 stores the current state in the timer history register 145 and is configured to update a hysteresis value of the hysteresis timer 130 based on the value(s) stored in the timer history register 145. The timer history register 145 may be a shift register, and may store at least one previous state of the hysteresis timer 130 along with the current state.
The hysteresis timer history circuit 240 stores a current state and at least one previous state of a hysteresis timer as described above in reference to
The hysteresis timer adjustment selection circuit 250 comprises a select circuit 260 which controls a multiplexor 270. The multiplexor 270 has data inputs each coupled to one of a plurality of registers 271-277 and a control input coupled to the select circuit 260. Each of the registers 271-277 contains a hysteresis adjustment value that corresponds to a particular state of the hysteresis timer history registers 242-244. In some embodiments, at least a portion of each of the registers 271-277 may include logical “DON′T CARE” states corresponding to the history registers 242-244. For example, register 271 may be programmed with a value of “0” (meaning no adjustment) to correspond with “NO CHANGE” as the most recent state, and “DON′T CARE” for the two next most recent states. Registers 272-274 may contain values of “1,” “2,” and “4” to correspond with the most recent, two most recent and three most recent states being “INCREMENT,” respectively. Likewise, registers 275-277 may contain values of “−1,” “−2,” and “−4” to correspond with the most recent, two most recent and three most recent states being “DECREMENT,” respectively. The select circuit 260 is configured to receive the hysteresis timer history inputs 246-248 from the hysteresis timer history circuit 240 and generate a control signal for the multiplexor 270, which selects one of the registers 271-277 to provide a selected hysteresis timer adjustment output 255 based on the hysteresis timer history inputs 246-248. For example, if the three most recent states of the hysteresis timer history registers 242-244 are all “DECREMENT,” the select circuit 260 receives the values “10,” “10,” and “10” on the hysteresis timer history inputs 246-248 respectively and generates a control signal for the multiplexor 270 which selects register 277 to provide the selected hysteresis timer adjustment output 255. Thus, registers 272-274 may be programmed such that where two or more of the most recent states are the same, the select circuit 260 provides selected hysteresis timer adjustment outputs 255 that have progressively increasing magnitudes or absolute values (for example, two most recent states being “DECREMENT” gives an adjustment value of “−2,” three most recent states being “DECREMENT” gives an adjustment value of “−4,” two most recent states being “INCREMENT” gives an adjustment value of “2” and three most recent states being “INCREMENT” gives an adjustment value of “4”).
The registers 271-277 may be programmable in order to allow the circuit 100 to respond to changing traffic demands. For example, if consecutive adjustment states of the hysteresis timer history registers 242-244 are the same, this may indicate that the value in the hysteresis value register 295 needs to undergo a significant adjustment to respond to a new traffic pattern. In order to allow the value in the hysteresis value register 295 to be adjusted more efficiently in these cases, values with progressively increasing magnitude may be programmed into registers 272-274 (for INCREMENT states) and registers 275-277 (for DECREMENT states) to correspond with consecutive adjustment states of the hysteresis timer history registers 242-244 that are the same. In one embodiment, the values may be exponentially increasing in magnitude. Those having skill in the art will recognize that based on various combinations of states of the hysteresis timer history registers 242-244, different rates of increase in the hysteresis timer update values corresponding to those states may be employed. In some embodiments the values in registers 271-277 may be programmable during operation such that if a first set of values does not provide appropriate adjustments, a new set of values may be programmed without resetting a device containing the circuit 100. Alternatively, in some embodiments the values in registers 271-277 may be hard-coded or otherwise permanently fixed.
The multiplexor 280 receives the selected hysteresis timer adjustment output 255 and the programmed value output 282. Based on the hysteresis value select input 285, the multiplexor 280 provides either the selected hysteresis timer adjustment output 255 or the programmed value output 282 as the hysteresis value output 288 to the hysteresis value register adjustment circuit 290. The hysteresis value register adjustment circuit 290 is configured to adjust the hysteresis value stored in the hysteresis value register 295 based on the hysteresis value output 288 and the hysteresis value select input 285. When the hysteresis value select input 285 indicates that the selected hysteresis timer adjustment output 255 has been selected as the hysteresis value output 288, the hysteresis value register adjustment circuit 290 may perform an arithmetic operation to add to or subtract from a current value of the hysteresis value register 295 based on the hysteresis value output 288 to produce an adjusted hysteresis value. Alternatively, when the hysteresis value select input 285 indicates that the programmed value output 282 has been selected as the hysteresis value output 288, the hysteresis value register adjustment circuit 290 may simply use the programmed value output 282 as the adjusted hysteresis value. In either case, the hysteresis value register adjustment circuit 290 is configured to write the adjusted hysteresis value into the hysteresis value register 295 and provide the adjusted hysteresis value to the hysteresis timer 130 via the hysteresis value interface 142.
The memory 250B includes a compare section 260B and a data section 270B. The memory 250B further includes the hysteresis timer history inputs 246-248 coupled to the compare section 260B and the selected hysteresis timer adjustment output 255. The memory 250B may include the programming input 103 for programming the compare section 260B and reset inputs (not shown) for initializing the memory 250B, along with any other features commonly employed in CAM structures by those having skill in the art.
Each row of the compare section 260B comprises a plurality of entries, and each entry corresponds to a state of the hysteresis timer history registers 242-244. Although compare section 260B is illustrated as having three entries per row, those having skill in the art will recognize that each row may have as few or as many entries as desired. Each row of the compare section 260B corresponds to a row of the data section 270B. Each row of the data section 270B contains a hysteresis adjustment value that is associated with the states of the hysteresis timer history registers 242-244 represented by the corresponding row of the compare section 260B.
The memory 250B receives the hysteresis timer history inputs 246-248 at the compare section 260B, and performs a lookup operation. If the lookup operation results in a hit, the memory 250B provides a corresponding hysteresis adjustment value on the selected hysteresis timer adjustment output 255. If the lookup operation results in a miss, the memory 250B may be configured to provide a zero value on the selected hysteresis timer adjustment output 255. In either case, the value provided on the selected hysteresis timer adjustment output 255 may then be processed in a similar manner as described in
The memory 250B of
The master 310 includes a master hysteresis timer circuit 315. The master transaction circuit 330 receives master clock signal 305 from a master clock enable circuit 304. A master hysteresis timer circuit 315 monitors the master transaction circuit 330 and provides a master clock gating signal 316 to the master clock enable circuit 304. In an exemplary embodiment, the master hysteresis timer circuit 315 may be the hysteresis timer circuit 150 of
The slave transaction circuit 350 receives slave clock signal 309 from a slave clock enable circuit 308. A slave hysteresis timer circuit 365 monitors transactions on the slave transaction circuit 350 and provides a slave clock gating signal 366 to the slave clock enable circuit 308. In an exemplary embodiment, the slave hysteresis timer circuit 365 may be the hysteresis timer circuit 150 of
During operation of the bus system 300, the master hysteresis timer circuit 315 monitors transactions in the master transaction circuit 330 and is configured to gate the master clock output 305 through the master clock enable circuit 304 after a master hysteresis timer associated with the master hysteresis timer circuit 315 expires. Likewise, the slave hysteresis timer circuit 365 monitors transactions in the slave transaction circuit 350 and is configured to gate the slave clock output 309 after a slave hysteresis timer associated with the slave hysteresis timer circuit 365 expires. Gating the master clock output 305 and the slave clock output 309 may reduce power consumption by the bus system 300 when the bus system 300 is not servicing a transaction. Either or both of the master hysteresis timer circuit 315 and the slave hysteresis timer circuit 365 may be programmable in accordance with earlier described embodiments.
The method 400 starts at block 405 in which a determination is made whether or not to accept default increment, decrement and hysteresis timer values. Default values may be established by fusing, strapping, preprogramming into non-volatile memory or other means known to those skilled in the art. If the default values are acceptable, the method proceeds to block 420. If the default values are not acceptable, the method proceeds to block 410.
In block 410, the increment and decrement values and the hysteresis timer are initialized. For example, the registers 271-277 of
In block 420, a hysteresis timer update circuit monitors a transaction circuit for a new transaction. For example, the hysteresis timer update circuit 140 of
In block 430, the hysteresis timer update circuit monitors the transaction circuit to determine when the transaction has completed. If the transaction (and any other subsequent transactions received while waiting for the transaction to complete) have not completed, the method returns to block 430 and the hysteresis timer update circuit continues to monitor the transaction circuit. When the transaction is completed, the method proceeds to block 440. In block 440, the hysteresis timer is started and the hysteresis timer update circuit awaits a new transaction. For example, hysteresis timer 130 begins counting down while the hysteresis timer update circuit 140 monitors the transaction circuit 110 for a new transaction.
The method then proceeds to block 450, in which the hysteresis timer is checked to determine if it has reached a terminal count value. In an exemplary embodiment, the terminal count value may be zero. If the terminal count value has not yet been reached, the method proceeds to block 454, where the hysteresis timer update circuit determines if a new transaction has been received by the transaction circuit in a current clock cycle. If a new transaction has not been received at the transaction circuit, the method proceeds to block 456 where the hysteresis timer is advanced towards its terminal count value and then returns to block 450. If a new transaction has been received at the transaction circuit, the method proceeds to block 460.
In block 460, the hysteresis timer is stopped because a new transaction has been received and the hysteresis value is decreased because the hysteresis timer did not reach its terminal count before a new transaction was received, indicating that the previous hysteresis value was too large. For example, the hysteresis timer update circuit 140 checks the state of the hysteresis timer 130. The hysteresis timer update circuit 140 then decreases the hysteresis value of the hysteresis timer 130 as described in reference to
In block 470, the hysteresis timer update circuit determines if a new transaction has been received by the transaction circuit in a current clock cycle. If a new transaction has been received at the transaction circuit, the hysteresis value is correct because the new transaction was received during the same clock cycle in which the hysteresis timer reached its terminal count. Thus, no adjustment of the hysteresis value is necessary, and the method proceeds to block 430 to await completion of all received transactions. If a new transaction has not been received at the transaction circuit during the clock cycle in which the hysteresis timer reaches its terminal count, the hysteresis timer expires and the method proceeds to block 480.
In block 480, the hysteresis value is increased because the hysteresis timer expired before a new transaction was received, indicating that the previous hysteresis value was not large enough. For example, the hysteresis timer update circuit 140 checks the state of the hysteresis timer 130. The hysteresis timer update circuit 140 then increases the hysteresis value of the hysteresis timer 130 as described in reference to
The method 400 may further include checking that a decrease or increase of the hysteresis value (as in blocks 460 and 480) will not cause the hysteresis value to exceed minimum or maximum values. If a decrease or increase of the hysteresis value would cause the hysteresis value to exceed a minimum or maximum value, the decrease or increase of the hysteresis value may be suppressed and the method may return to block 430 or 420, respectively.
Those having skill in the art will recognize that the teachings of this disclosure may be applied to other types of transaction circuits. For example, the teachings may be applied to a memory controller circuit which receives read and write memory transactions and is configured to control a memory array to perform those transactions. In such an embodiment, the hysteresis timer may be applied to determine when particular memory banks may be held open to await new transactions and when those memory banks should be closed, as an example.
The circuit, systems and methods of adaptive hysteresis timer adjustments for clock gating according to embodiments disclosed herein may be provided in or integrated into any processor-based device. Examples, without limitation, include a set top box, an entertainment unit, a navigation device, a communications device, a fixed location data unit, a mobile location data unit, a mobile phone, a cellular phone, a computer, a portable computer, a desktop computer, a personal digital assistant (PDA), a monitor, a computer monitor, a television, a tuner, a radio, a satellite radio, a music player, a digital music player, a portable music player, a digital video player, a video player, a digital video disc (DVD) player, and a portable digital video player.
In this regard,
Other master and slave devices can be connected to the bus interconnect 580. As illustrated in
The CPU 572 may also be configured to access the display controller(s) 590 over the bus interconnect 580 to control information sent to one or more displays 594. The display controller(s) 590 sends information to the display(s) 594 to be displayed via one or more video processors 596, which process the information to be displayed into a format suitable for the display(s) 594. The display(s) 594 can include any type of display, including but not limited to a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, etc.
Those of skill in the art would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithms described in connection with the embodiments disclosed herein may be implemented as electronic hardware, instructions stored in memory or in another computer-readable medium and executed by a processor or other processing device, or combinations of both. The arbiters, master devices, and slave devices described herein may be employed in any circuit, hardware component, integrated circuit (IC), or IC chip, as examples. Memory disclosed herein may be any type and size of memory and may be configured to store any type of information desired. To clearly illustrate this interchangeability, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. How such functionality is implemented depends upon the particular application, design choices, and/or design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed with a processor, a DSP, an Application Specific Integrated Circuit (ASIC), an FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The embodiments disclosed herein may be embodied in hardware and in instructions that are stored in hardware, and may reside, for example, in Random Access Memory (RAM), flash memory, Read Only Memory (ROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of computer readable medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a remote station. In the alternative, the processor and the storage medium may reside as discrete components in a remote station, base station, or server.
It is also noted that the operational steps described in any of the exemplary embodiments herein are described to provide examples and discussion. The operations described may be performed in numerous different sequences other than the illustrated sequences. Furthermore, operations described in a single operational step may actually be performed in a number of different steps. Additionally, one or more operational steps discussed in the exemplary embodiments may be combined. It is to be understood that the operational steps illustrated in the flow chart diagrams may be subject to numerous different modifications as will be readily apparent to one of skill in the art. Those of skill in the art would also understand that information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.