This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2011-207133, filed on Sep. 22, 2011; the entire contents of which are incorporated herein by reference.
Embodiments described herein relate generally to a control device and a computer program product.
In related art, known is a technique of making a processing device (such as a processor) execute an interrupt process associated with a received interrupt request requesting the processing device to execute an interrupt process each time an interrupt request is received. In such a technique, when the processing device receives an interrupt request during an idle state in which the processing device is not executing any processes, the processing device changes from the idle state into an active state in which the processing device can execute the interrupt process. After executing the interrupt process, the processing device changes again into the idle state.
As an example of methods for reducing the power consumption of the processing device, a method of reducing power being supplied to the processing device in the idle state to change the processing device to a power-saving state (sleep state) can be considered. In this case, power supply to the processing device is resumed when an interrupt request is received. Then, after the processing device is changed to an operable state, the interrupt process is executed. After the power supply is resumed, however, the time (start-up time) required for a plurality of elements constituting the processing device to change into operable states varies depending on the elements. Thus, if power supply to all the elements is started at the same time, elements with shorter start-up times will remain in waiting states after completing the change to the operable states until elements with longer start-up times change to the operable states, and there is a disadvantage that the power consumption during the waiting states will be wasted.
According to an embodiment, a control device includes a receiving unit, a judging unit, an estimating unit, a deciding unit, a directing unit, and a sending unit. The receiving unit is configured to receive an interrupt request requesting a processing device that includes a plurality of elements capable of being individually subjected to voltage control to execute an interrupt process. The judging unit is configured to judge a state of each of the elements. The estimating unit is configured to estimate, for each of the elements, a start-up time representing a time required for the element to change into an operating mode representing an operable state after power is supplied on basis of a result of judgment by the judging unit. The deciding unit is configured to decide, for each of the elements, a starting point in time representing a timing at which power supply is to be started on basis of a difference in the start-up times between the elements. The directing unit is configured to direct a power supply unit for supplying power to the elements to perform power supply according to the starting point decided by the deciding unit. The sending unit is configured to send the interrupt request to the processing device.
First Embodiment
In an idle state in which no process is executed, the processing device 120 according to this embodiment changes into a power-saving state (sleep state) in which power supply to a plurality of elements constituting the processing device 120 is reduced. The elements can be individually subjected to voltage (power supply) control. Examples of the elements include components or sections in components that can be individually subjected to voltage control. For example, a section in the CPU 121, the memory 122 or a system-on-chip (SOC) including the CPU 121 can be an element. The voltage control includes control of switching the voltage on/off. Note that any of the devices described above can be an element of the processing device 120. In this embodiment, when the control device 100 receives an interrupt request, the control device 100 estimates the time required for changing each of a plurality of elements (such as the CPU 121 and the memory 122) constituting the processing device 120 to an operating mode representing a state in which the element can operate after power is supplied thereto on the basis of the current state each element. The control device 100 then decides a starting point in time representing a timing at which power supply for changing each element to the operating mode is started on the basis of a difference between start-up times of the elements. The control device 100 then directs a power supply unit 130 for supplying power to each of the elements constituting the processing device 120 to perform power supply according to the decided starting point. Specific details will be hereinafter described. Note that the power supply unit 130 according to this embodiment supplies power from a battery (not illustrated) to each of the elements constituting the processing device 120 under the control of the control device 100.
As illustrated in
The receiving unit 10 receives an interrupt request from each of a plurality of devices 1 to n. The judging unit 20 judges the state of each of the elements (such as the CPU 121 and the memory 122) constituting the processing device 120. In this embodiment, the “operating mode” representing a state in which an element can operate and an “inactive mode” representing a state in which the operation of the element is stopped and in which power consumption is saved as compared to the operating mode are set as examples of modes representing the states of each element. In this example, the “operating mode” includes both of a state in which an element is waiting in an operable state and a state in which the element is actually operating.
The judging unit 20 may include a state detecting section 22 as illustrated in
Alternatively, the judging unit 20 may include a state receiving section 24 and a holding section 26 as illustrated in
The description is continued referring back to
The estimating unit 40 estimates the start-up time of each of a plurality of elements (such as the CPU 121 and the memory 122) constituting the processing device 120 on the basis of the judgment result of the judging unit 20. More specifically, the estimating unit 40 estimates the start-up time of each of the elements constituting the processing device 120 by reading the start-up time associated with the current mode (state) of the element from the first storage unit 30.
The deciding unit 50 decides the starting point representing a timing at which power supply for changing each of the elements (such as the CPU 121 and the memory 122) constituting the processing device 120 to the operating mode on the basis of a difference between the start-up times of the elements. More specifically, the deciding unit 50 decides the starting point of each element so that the starting points of elements other than a reference element, which represents an element with the longest start-up time of a plurality of elements, are later than the starting point of the reference element according to differences between the start-up time of the reference element and the start-up times of the other elements. For example, assumed is a case in which the modes of the CPU 121 and the memory 122 are the inactive modes, the start-up times of the CPU 121 and the memory 122 are identified as T2 and T1, respectively. In this case, the reference element is the memory 122. Then, as illustrated in
The directing unit 60 directs the power supply unit 130 to perform power supply according to the starting points decided by the deciding unit 50. In this embodiment, the deciding unit 50 sends a specifying signal that specifies an element to which power supply is to be started each time the starting point of an element is reached, and the directing unit 60 thus sends to the power supply unit 130 a return signal directing to start power supply for changing the element specified by the specifying signal to the operating mode each time the directing unit 60 receives the specifying signal from the deciding unit 50. For example, in the example of
Although the deciding unit 50 sends a specifying signal specifying an element to which power supply is to be started to the directing unit 60 each time a starting point of each element is reached in this embodiment, the deciding unit 50 may alternatively notify the directing unit 60 of the starting points of the elements in advance and the i directing unit 60 may send a return signal of each element to the power supply unit 130 each time the starting point of the element is reached, for example. Basically, the directing unit 60 may have any function that directs the power supply unit 130 to perform power supply according to the starting points decided by the deciding unit 50.
The sending unit 70 sends the interrupt request received by the receiving unit 10 to the processing device. In this embodiment, the received interrupt request is held in the control device 100 until the elements (such as the CPU 121 and the memory 122) constituting the processing device 120 complete the change to the operating mode, and when the elements have completed the change to the operating mode, the sending unit 70 sends the interrupt request held until then to the processing device 120. The method for holding the interrupt request may be any method. For example, the received interrupt request may be temporarily stored in a memory (not illustrated) or may be held by starting a program associated with the interrupt request.
A configuration in which power supply by the power supply unit 130 is started when the processing device 120 receives an interrupt request is also possible. With this configuration, an interrupt signal can be sent instead of the return signal described above. Alternatively, in a configuration in which power supply by the power supply unit 130 is not started when an interrupt request is received, the interrupt request may be sent to the processing device 120 at the same time as sending the return signal described above, or after sending the return signal and before the return completion time.
Note that, in the example of
Next, an example of operation of the control device 100 according to this embodiment will be described.
Next, the estimating unit 40 determines whether there is any element judged to be in the inactive mode in step S2 in the elements constituting the processing device 120 (step S3). If there is no element judged to be in the inactive mode (result of step S3: NO), all the elements constituting the processing device 120 are in an immediately operable state and the sending unit 70 thus sends the interrupt request received in step Si to the processing device 120 (step S8).
If there is an element judged to be in the inactive mode (result of step S3: YES), on the other hand, the estimating unit 40 estimates the start-up times of the elements constituting the processing device 120 (step S4). More specifically, the estimating unit 40 estimates the start-up time of each element by reading the start-up time associated with the current mode of the element from the first storage unit 30. Next, the deciding unit 50 decides the starting point of each element on the basis of the difference between start-up times of the elements (step S5). The method for deciding the starting points of the elements is as described above.
Next, when the starting point of each element is reached, the directing unit 60 sends the return signal of the element to the power supply unit 130 (step S6). The method for sending the return signal is as described above. Next, if it is judged that the return completion time has been reached (result of step S7: YES), the deciding unit 50 notifies the sending unit 70 that the return completion time has been reached. The sending unit 70 that has received the notification then sends the interrupt request received in step Si to the processing device 120 (step S8). The processing by the control device 100 ends here.
As described above, in this embodiment, upon receiving an interrupt request, the control device 100 estimates the start-up time of each of a plurality of elements constituting the processing device 120 on the basis of the current state of each element. The control device 100 then decides the timing (starting point in time) at which power supply for changing to the operating mode is to be started for each element on the basis of a difference between the start-up times of the elements. More specifically, the control device 100 decides the starting points of the respective elements so that the starting points of the elements other than the reference element are later than the starting point of the reference element according to differences between the start-up time of the reference element and the start-up times of the other elements, which produces an advantageous effect that wasteful power consumption can be reduced as compared to a case where the starting points of the respective elements are the same. Moreover, in this embodiment, since the control device 100 decides the starting points of the respective elements so that the return completion times of the respective elements are the same, the element with the shortest start-up time does not have to wait until the other elements complete the change to the operating mode after completing the change to the operating mode. Wasteful power consumption can therefore be further reduced.
Second Embodiment
Next, the second embodiment will be described. In the second embodiment, the control device 100 sends the received interrupt request to the processing device 120 if the processing device 120 is in an active state (operating state) in which the processing device 120 is executing a process or sends the received interrupt request to the processing device 120 only when a predetermined condition is satisfied if the processing device 120 is in an idle state in which the processing device 120 is not executing any processes. Specific details will be hereinafter described. Parts that are the same as those in the first embodiment will be designated by the same reference numerals and description thereof will not be repeated as appropriate.
The trigger unit 80 activates the permitting unit 83 when a certain condition is satisfied.
The trigger sending section 84 also sends a trigger signal to the permitting unit 83 each time a time indicated by timer information indicating at least one time is reached. The timer information is stored in a memory (not illustrated) included in an external timer information managing unit 90. The timer information managing unit 90 notifies the trigger sending section 84 of a timer signal for informing that the time is reached each time the time indicated by the timer information is reached. While the timer information managing unit 90 is provided outside the control device 100 in this example, the timer information managing unit 90 is not limited thereto and may alternatively be mounted on the control device 100.
The trigger sending section 84 further sends a trigger signal to the permitting unit 83 when the trigger sending section 84 is notified of receipt of an interrupt request by the receiving unit 10. The receiving unit 10 notifies the trigger sending section 84 of a receipt signal for informing receipt of an interrupt request when the receiving unit 10 has received an interrupt request from devices 1 to n. In this manner, the trigger unit 80 according to this embodiment activates the permitting unit 83, which is triggered when a state change signal is received from the CPU 121, when a timer signal is received from the timer information managing unit 90 or when a receipt signal is received from the receiving unit 10.
While the trigger sending section 84 decides whether or not to send a trigger signal in response to each of a state change signal, a timer signal and a receipt signal described above herein, the trigger sending section 84 may alternatively decide whether or not to send a trigger signal in response to any one or any two of a state change signal, a timer signal and a receipt signal, for example. Basically, the trigger sending section 84 can decide whether or not to send a trigger signal in response to at least one of a state change signal, a timer signal and a receipt signal described above.
The description is continued referring back to
The second storage unit 81 stores the interrupt request received by the receiving unit 10.
The third storage unit 82 stores a permission condition indicating a condition under which sending of an interrupt request is permitted.
Note that the permission condition is not limited thereto, and any type of permission condition may be stored in the third storage unit 82. For example, the third storage unit 82 may store a permission condition in
The permitting unit 83 initiates operation upon receipt of the trigger signal described above. The permitting unit 83 performs a permission process of deciding whether or not to permit to send an interrupt request to the processing device 120.
If the processing device 120 is judged to be in the idle state (result of step S11: NO), on the other hand, the permitting unit 83 checks whether or not the initiation of the operation is triggered by receipt of an interrupt request by the receiving unit 10. In other words, the permitting unit 83 checks whether or not an interrupt request is received by the receiving unit 10 (step S13).
If the result of step S13 is positive, the permitting unit 83 refers to the permission condition stored in the third storage unit 82 and judges whether or not the permission condition is satisfied (step S14). In this embodiment, it is assumed that the third storage unit 82 stores the permission condition illustrated in
If the result of step S14 described above is negative, the permitting unit 83 registers the interrupt request received by the receiving unit 10 in the second storage unit 81 (step S16), and starts measuring the storage time of the registered interrupt request. Note that although it is judged whether or not the permission condition is satisfied without registering the interrupt request received by the receiving unit 10 in the second storage unit 81 in step S14 described above, the operation is not limited thereto. It may alternatively be judged whether or not the permission condition is satisfied after the interrupt request received by the receiving unit 10 is registered in the second storage unit 81.
Then, the permitting unit 83 sets timer information according to a result of comparison between a time when the storage time of the interrupt request first stored in the second storage unit 81 exceeds 100 ms (a time when the permission condition in
If the result of step S13 described above is negative, on the other hand, the permitting unit 83 also judges whether or not the permission condition is satisfied (step S18). Then, if the result of step S18 is positive, the process proceeds to step S15 described above. If the result of step S18 is negative, the permission process is terminated and the operation of the permitting unit 83 is stopped.
In this embodiment, the processing operation in
Alternatively, the permitting unit 83 may notify the deciding unit 50 in advance the time when the storage time of the first interrupt request stored in the second storage unit 81 exceeds 100 ms (the time when the storage time is over a predetermined value and the permission condition is satisfied), and the deciding unit 50 may decide the starting point of each of the elements constituting the processing device 120 so that the starting points of the elements are earlier than the notified time. In this case, the processing operation (the processing operation in step S2 and subsequent steps) in
Third Embodiment
A third embodiment is different from the second embodiment in that employed is a permission condition that power supply capacity of the processing device 120, the control device 100, and equipment on which the respective devices are mounted (for example, terminal equipment such as PCs) exceeds a threshold. Specific details will be hereinafter described. Parts that are the same as those in the second embodiment will be designated by the same reference numerals and description thereof will not be repeated as appropriate.
Alternatively, the supply capacity detecting unit 85 may include a remaining battery charge receiving section 87 and a holding section 88 as illustrated in
Next, the permission process performed by the permitting unit 83 will be described with reference to
Alternatively, when the supply capacity detecting unit 85 has the configuration of
When the remaining battery charge detected by the supply capacity detecting unit 85 is lower than a predetermined reference value, the permitting unit 83 may alternatively discard the received interrupt request without registering the same in the second storage unit 81 or permitting to send the same to the processing device 120.
Modified Examples
While certain embodiments have been described, the embodiments described above have been presented by way of example only and are not intended to limit the scope of the inventions. These novel embodiments can be embodied in a variety of other forms, and various omissions, substitutions and changes can be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirits of the inventions.
(1) Modified Example 1
Any types and any number of elements may constitute the processing device 120. For example, a display unit having a function of displaying various information may be included in the elements constituting the processing device 120. Any types of modes of the elements constituting the processing device 120 may be used. For example, the “inactive mode” described above may be further divided into a plurality of modes according to power consumption of the elements. The “operating mode” described above may be divided into an active mode representing a state in which an element is actually operating and a standby mode in which the element is waiting in an operable state. In addition, the start-up times associated with the respective modes are set in advance. Basically, it is sufficient that, for each of the elements constituting the processing device 120, a mode of the element and the start-up time are stored in association with each other in the first storage unit 30.
(2) Modified Example 2
The control device 100 can also specify elements to be activated according to the type of the interrupt request received by the receiving unit 10, for example. When the memory 122 is not needed for an interrupt process requested to be performed by the received interrupt request, for example, the control device 100 does not directs the power supply unit 130 to supply power to the memory 122. Thus, the deciding unit 50 may also decide the starting points of elements required for the interrupt process requested to be performed by the received interrupt request out of a plurality of elements constituting the processing device 120 but does not decide the starting points of the other elements (elements unnecessary for the interrupt process).
(3) Modified Example 3
The interrupt request received by the receiving unit 10 may be output from any source, which is not limited to the devices 1 to n described above. For example, the control device 100 may include a polling unit that periodically polls the devices 1 to n for the states thereof and outputs a signal (that is, an interrupt request) requesting to execute an interrupt process when a state change that is a trigger for executing the interrupt process is detected, the polling unit being the source of the interrupt request. Basically, the interrupt request received by the receiving unit 10 may be one output from outside or one output from inside.
(4) Modified Example 4
As illustrated in
Alternatively, when the supply capacity detecting unit 85 has the configuration of
(5) Modified Example 5
Any permission condition may be stored in the third storage unit 82 described above. For example, a permission condition that the number of interrupt requests is two may be used. Hereinafter, an example in which an interrupt request (referred to as a first interrupt request) is sent to the control device 100 of the second embodiment and then another interrupt request (referred to as a second interrupt request) is sent thereto in a state in which no interrupt request is present in the second storage unit 81 will be described (also refer to
First, when the first interrupt request is received by the receiving unit 10, the permitting unit 83 starts to operate and performs the permission process described above. The processing device 120 is assumed to be in the idle state at this time. Accordingly, the result of step S11 in
In step S16, the permitting unit 83 registers the first interrupt request received by the receiving unit 10 in the second storage unit 81. In this example, the permission process is terminated without performing the process in step S17 in
Then, when the second interrupt request is received by the receiving unit 10, the permitting unit 83 starts to operate and performs the permission process described above. The processing device 120 is assumed to be in the idle state similarly to the above. Accordingly, the result of step S11 is negative, the result of step S13 is positive, and the process thus proceeds to step S14. At this point, since the first interrupt request is stored in the second storage unit 81 and the second interrupt request is received by the receiving unit 10, the number of interrupt requests is “2”, which satisfies the aforementioned permission condition. Accordingly, the process proceeds to step S15 where the permitting unit 83 sends to the deciding unit 50 a permission signal permitting to send the received second interrupt request and the first interrupt request stored in the second storage unit 81 to the processing device 120. Note that, if the processing device 120 is in the active state (if the result of step S11 in
(6) Modified Example 6
For example, a storage time at which the permission condition is satisfied (referred to as a threshold time) may be set individually for each interrupt request. A case where a threshold time associated with an first interrupt request caused by an input to a keyboard is set to t1 and a threshold time associated with an second interrupt request caused by an input to a mouse is set to t2 (<t1) is assumed here. In this case, the permission condition is assumed to be that a storage time of any one interrupt request stored in the second storage unit 81 exceeds the threshold time associated with the interrupt request.
Hereinafter, an example in which the aforementioned first interrupt request is sent to the control device 100 of the second embodiment and then the aforementioned second interrupt request is sent thereto in a state in which no interrupt request is present in the second storage unit 81 will be described (also refer to
In step S16, the permitting unit 83 registers the first interrupt request received by the receiving unit 10 in the second storage unit 81. In this example, an interrupt request and a threshold time of the interrupt request are stored in association with each other in the second storage unit 81. Next, the permitting unit 83 sets timer information according to a result of comparison between a time when the storage time of the first interrupt request exceeds the threshold time t1 associated therewith and the next time indicated by the timer information (step S17). It is assumed here that the time at which the storage time of the first interrupt request exceeds the threshold time t1 associated therewith is earlier than the next time indicated by the timer information. Accordingly, the permitting unit 83 sets the time at which the storage time of the first interrupt request exceeds the threshold time t1 associated therewith, namely the time at which a length of time t1 has passed from the current time, as the next time to be indicated by the timer information. The permission process is then terminated and the operation of the permitting unit 83 is stopped.
Then, when the second interrupt request is received by the receiving unit 10, the permitting unit 83 starts to operate and performs the permission process described above. The processing device 120 is assumed to be in the idle state similarly to the above. Accordingly, the result of step S11 is negative, the result of step S13 is positive, and the process thus proceeds to step S14. It is assumed here that the first interrupt request is stored in the second storage unit 81 and the storage time of the first interrupt request has not exceeded the threshold time t1 associated with the first interrupt request. Accordingly, the permission condition is not satisfied and the process proceeds to step S16. If the processing device 120 is in the active state (if the result of step S11 is positive), the permitting unit 83 sends to the deciding unit 50 a permission signal permitting to send the received second interrupt request and the first interrupt request stored in the second storage unit 81 to the processing device 120 (step S12 in
In step S16, the permitting unit 83 registers the second interrupt request received by the receiving unit 10 in the second storage unit 81. Next, the permitting unit 83 sets timer information according to a result of comparison between a time when the storage time of the second interrupt request exceeds the threshold time t2 associated therewith and the next time indicated by the timer information, that is, a time when the storage time of the first interrupt request exceeds the threshold time t1 (step S17). It is assumed here that the time Tx at which the storage time of the second interrupt request exceeds the threshold time t2 is earlier than the time Ty at which the storage time of the first interrupt request exceeds the threshold time t1 as illustrated in
(7) Modified Example 7
A permission condition may be that an idle time representing a length of time for which the idle state of the processing device 120 continues exceeds a predetermined value, for example. In this case, a storage unit that stores a time when the processing device 120 enters the idle state, for example, is provided, and when the estimating unit 40 detects that the processing device 120 has entered the idle state from the active state (operating state), the estimating unit 40 writes the time in the storage unit. As an example, a permission condition may be that the idle time is 100 ms or longer. According to this modified example, when the processing device 120 has continued to be in the idle state for a sufficiently long time and a sufficient power saving effect is obtained, a permission signal can be output immediately in response to arrival of an interrupt request.
(8) Modified Example 8
While the power source of the power supply unit 130 is a battery, the power source is not limited thereto and any type of power source may be used. For example, the power source may be solar cells or the like.
When the power source is solar cells or the like in the third embodiment described above, a permission condition may be set by using the generated voltage, the generated current or the like of the solar cells. Basically, the permission condition may be any condition that power supply capacity exceeds a threshold.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
Number | Date | Country | Kind |
---|---|---|---|
2011-207133 | Sep 2011 | JP | national |