1. Field of the Invention
The present invention relates to a system including one or more master modules connected to an arbitrated bus and more particularly to a system designed to save power.
2. Description of the Related Art
A conventional system of this type is illustrated in
The master modules 101, 102 output respective bus request signals S11, S13 to the bus arbiter 105; the bus arbiter 105 outputs corresponding bus grant signals S12, S14 to the master modules 101, 102. The shared memory 103 sends the bus arbiter 105 an access information signal S15 indicating whether memory access is currently in progress. Memory access and other operations of the master modules and bus arbiter are synchronized with a clock signal.
The master modules 101, 102 output the bus request signals S11, S13 only when they need to use the common bus 104. The bus arbiter 105 outputs a bus grant signal granting the common bus 104 to the highest-priority master module requesting it, selected according to criteria described below. The master module that receives the bus grant signal can use the common bus 104 to access the shared memory 103. The shared memory 103 outputs the access information signal S15 continuously while being accessed.
The bus arbiter 105 outputs the bus grant signals S12, S14 according to the following criteria:
1) When only bus request signal S11 is active, bus grant signal S12 is output.
2) When bus request signal S13 is active, bus grant signal S14 is output, regardless of the state of bus request signal S11.
3) When the memory is being accessed by a master module (while the access information signal S15 is active), however, the above criteria 1) and 2) are not tested or acted on until the access is completed.
The power-saving mode is used to reduce power consumption by slowing or halting the operation of individual modules or the whole system 100. Bus activity and system status are monitored by software or other means to determine when the power-saving mode can be entered. The monitoring function may be carried out by one of the master modules, which acts as the system control module. If master module 101 is the system control module, then master module 101 always operates, but when it has no task to perform that requires memory access and decides from the inactivity of the bus 104 and possibly other factors that the power-saving mode can be entered, it obtains the bus right, carries out necessary preparatory processing, and then places the system in the power-saving mode while still retaining the bus right. The system cannot enter the power-down mode while master module 102 has the bus right.
While the system is in the power-saving mode, the access right to the common bus 104 belongs exclusively to master module 101, but the bus is not used, and to save power, the clock frequency is reduced.
Master module 101 also controls the recovery from the power-saving mode. This occurs when, for example, master module 101 receives an external interrupt, or master module 102 activates bus request signal S13. In the latter case, master module 101 performs necessary preparatory processing, then deactivates bus request signal S11 to release the common bus 104, enabling the bus access right to be transferred to master module 102. Master module 101 must monitor bus request signal S13 during the power-saving mode.
Both master modules 101 and 102 output bus request signals S11 and S13 (at the active or high logic level) at time t1. The bus arbiter 105 activates bus grant signal S14 at time t2, giving the bus right to master module 102, which has higher priority. Having acquired the bus, master module 102 performs necessary operations such as memory access until time t3, then resets bus request signal S13 to the low logic level. The access information signal S15 (not shown) which is active while the shared memory 103 is being accessed, becomes inactive by time t3.
In response to the S13 signal transition at time t3, at time t4 the bus arbiter 105 deactivates bus grant signal S14 (by setting it to the low logic level), and outputs bus grant signal S12 to master module 101, which is still holding bus request signal S11 at the active (high) level.
Assume now that master module 101 has determined that the system can enter the power-saving mode. When master module 101 obtains the bus right at time t4, it starts the processing necessary to place the system in the power-saving mode. This processing includes, for example:
1) commanding a system clock control module (not shown) that supplies a system clock signal (CLK) to divide the clock frequency;
2) commanding modules (e.g., master module 102) that will continue to operate in the power-saving mode but need to change their internal operation to suit the divided clock frequency to switch over to the divided clock mode;
3) completing all necessary memory access operations, which may include memory access operations executed by master module 102 as well as memory access operations executed by master module 101; and
4) completing all necessary central processing unit (CPU) operations, which may include CPU operations executed by master module 102 as well as CPU operations executed by master module 101.
These preparations take up the interval from time t4 to time t5. The power-saving mode starts at time t5. Division of the frequency of the system clock (CLK) starts at time t6. During the power-saving mode the whole system operates with reduced power consumption, and selected modules other than master module 101 may be halted completely.
Eventually, at time t7, master module 102 needs to access the shared memory 103 and outputs bus request signal S13, which triggers a return to the normal clock frequency. In response to bus request signal S13, at time t8 the bus arbiter 105 stops output of bus grant signal S12 to master module 101 and begins output of bus grant signal S14 to master module 102. In all, the duration T1 of the power-saving mode is from time t5, when master module 101 completes the preparatory processing, to time t8, when the bus arbiter 105 stops output of bus grant signal S12.
A problem with the system illustrated in
Another type of system that experiences software delays in entering the power-saving mode is described in Japanese Patent Application Publication No. 2002-132394. The system has a multi-tasking microcomputer in which task execution is controlled by a real-time operating system. The task that switches the microcomputer from its normal mode to the power-saving mode has the lowest execution priority. This scheme simplifies the decision as to when the system is ready to operate in the power-saving mode, but multi-task control is an inherently complex process. Since the transition to the power-saving mode is controlled by a software task within a priority scheme that is also controlled by software (the operating system), entry to the power-saving mode still takes time.
An object of the present invention is to increase the use of a power-saving function in a system employing bus arbitration.
The invented system operates in a normal mode and a power-saving mode. The system includes a bus, a memory connected to the bus, and at least one master module connected to the bus. Each master module outputs a bus request signal, receives a bus grant signal, and uses the bus to access the memory while the bus grant signal is active.
The bus request signals are received by a bus arbiter that generates the bus grant signals. The bus arbiter also generates an enable signal that can become active only when no bus grant signal is active.
The system further includes a power-down module that receives the enable signal from the bus arbiter and performs processing to take the system from the normal mode to the power-saving mode when the enable signal becomes active. This processing may include commanding a system clock control module to reduce the frequency of a system clock signal, or to halt the system clock signal altogether.
The system may recover from the power-saving mode to the normal mode when a master module still operating in the power-saving mode activates a bus request signal, or the recovery may be triggered by input of an external signal to the power-down module.
The bus arbiter may activate the enable signal whenever all bus request signals are inactive, or whenever all bus request signals are inactive and the memory is not being accessed, as indicated by an access information signal output from the memory to the bus arbiter.
By providing a separate power-down module to control the transition from the normal mode to the power-saving mode, instead of having the transition controlled by software in a master module, the invented system avoids the need to fetch power-down instructions from the memory, and can save power effectively by switching promptly into the power-saving mode during even short intervals in which the bus is idle.
In the attached drawings:
Embodiments of the invention will now be described with reference to the attached drawings, in which like elements are indicated by like reference characters.
Referring to
The common bus 15 is connected to the master modules 11, 12 and the memory 14. Master module 11 is the main master module but master module 12 has higher bus priority. Both master modules 11, 12 have control programs stored in internal memories (not shown) and can operate independently of the shared memory 14.
Master module 11 has an output port 11a connected to an input port 16d of the bus arbiter 16, and an input port 11b connected to an output port 16e of the bus arbiter 16. Master module 12 has an output port 12a connected to an input port 16b of the bus arbiter 16, and an input port 12b connected to an output port 16c of the bus arbiter 16. The power-down master module 13 has an input port 13a connected to an output port 16a of the bus arbiter 16. Master modules 11, 12 have, for example, a direct memory access (DMA) function that allows direct access to the shared memory 14 without involving their central processing units.
As in the conventional system, the master modules 11, 12 output respective bus request signals S1, S3 to the bus arbiter 16. The bus arbiter 16 outputs corresponding bus grant signals S2, S4 to the master modules 11, 12, and an enable signal S6 to the power-down master module 13. The shared memory 14 sends the bus arbiter 16 an access information signal S5 indicating whether the shared memory 14 is currently being accessed. The system clock control module 17 supplies a system clock CLK to all the master modules and the bus arbiter and divides the frequency of the system clock in response to a clock control signal S7 received from the power-down master module 13.
The main master module 11 always operates, but outputs bus request signal S1 only when necessary. The master modules 11, 12 output bus request signals S1, S3 when, for example, they need to read or write data in the shared memory 14 via the common bus 15. The bus arbiter 16 outputs bus grant signal S2 or S4, which gives the right to use the common bus 15, to the master module having the highest priority among the master modules requesting the bus right, according to criteria described below.
A master module that receives a bus grant signal performs necessary memory access operations or other operations involving the common bus 15. While memory access is in progress, the shared memory 14 activates the access information signal S5. The bus arbiter 16 outputs the enable signal S6 to the power-down master module 13 according to the criteria described below.
The power-down master module 13 does not access the shared memory 14, so it is not connected to the common bus 15. The power-down master module 13 receives the enable signal S6 from the bus arbiter 16 and executes processing to bring the system into a power-saving mode, as described later.
In the following description, the term ‘output’ is used in relation to the bus request signals S1, S3, bus grant signals S2, S4, access information signal S5, and enable signal S6 to mean that these signals S1, S2, S3, S4, S5, S6 are set to the high (H) logic level, which is their active level. The term ‘stop output’ is used to mean that these signals S1, S2, S3, S4, S5, S6 are set to the low (L) logic level, which is their inactive level.
Referring to
The decision circuit 163 commands the output circuit 162 to output the bus grant signals S2, S4 and enable signal S6 according to the following criteria.
1) If only bus request signal S1 is active (high), the output circuit 162 is commanded to output bus grant signal S2 but not bus grant signal S4.
2) If bus request signal S3 is active (high), the output circuit 162 is commanded to output bus grant signal S4 but not bus grant signal S2, regardless of the state of bus request signal S1.
3) When the access information signal S5 is active (high), indicating that memory access is in progress, the above criteria 1) and 2) are not acted on; they are tested and acted on only after completion of the current access.
4) When the bus request signals S1, S3 and access information signal S5 are all inactive (low), the output circuit 162 is commanded to output the enable signal S6 to the power-down master module 13.
These criteria give master module 12 the highest priority for receiving a signal (a bus grant signal) from the bus arbiter 16, while master module 11 has the next highest priority and the power-down master module 13 has the lowest priority. The bus arbiter 16 can generate the enable signal S6 by inverting the access information signal S5, treating the inverted access information signal as if it were a lowest-priority bus request signal, and treating the enable signal S6 as the corresponding bus grant signal. The enable signal S6 is output to the power-down master module 13 when the bus arbiter 16 recognizes that the shared memory 14 is not being accessed and that neither master module 11 or 12 has or is requesting the bus right. Accordingly, when the power-down master module 13 receives the enable signal S6, the conditions that permit the system 10 to enter the power-saving mode are automatically satisfied and do not need to be further monitored or checked.
When the power-down master module 13 receives the enable signal S6, it executes processes preparatory to placing the system in the power-saving mode. These preparatory processes include:
1) commanding the system clock control module 17 (by using the clock control signal S7) to divide the clock frequency; and
2) commanding any modules that will continue to operate in the power-saving mode and need to change their internal operation to suit the divided clock frequency to switch over to the divided clock mode.
These processes may be performed by hardware. The dividing of the clock frequency may be performed for the whole system or on an individual module basis. Input of the clock signal to selected modules other than the power-down master module 13 and bus arbiter 15 may also be halted, although at least one of the master modules 11, 12 must continue to operate.
Recovery from the power-saving mode to the normal mode is requested by output of bus request signal S1 or S3 from master module 11 or 12. This initiates a recovery process in which the system clock control module 17 stops dividing the clock frequency and the bus arbiter 16 grants the bus to the master module outputting the bus request signal.
The operation of the system 10 will be described with reference to the exemplary timing shown in
Master module 12 outputs bus request signal S3 at time t11. The bus arbiter 16 outputs bus grant signal S4 at time t12 to give master module 12 the right to use the common bus 15. Master module 12 uses the common bus 15 to access the shared memory 14, for example, and stops output of bus request signal S3 when the access is completed at time t13.
In response to this signal transition, the bus arbiter 16 stops output of bus grant signal S4 at time t14 and simultaneously begins output of the enable signal S6 to the power-down master module 13. Master module 12 occupies the common bus 15 from time t12 to t13. While it is performing memory access during this period, the access information signal S5 (not shown) is output.
In response to the enable signal S6, at time t14 the power-down master module 13 begins the processes 1) and 2) described above. At time t15 these processes are completed and the system enters the power-saving mode. Division of the clock (CLK) frequency starts at time t16, and the whole system begins operating at a reduced and therefore power-saving clock rate. Master modules 11 and 12 both continue to operate without using the common bus 15.
Eventually, at time t17, master module 11 needs to access the common bus 15. This need may arise from either hardware or software control. Master module 11 therefore outputs bus request signal S1. The bus arbiter 16 immediately stops output of the enable signal S6 to the power-down master module 13. In response to this signal transition, the power-down master module 13 sets the clock control signal S7 (not shown) to a state that commands the system clock control module 17 not to divide the clock frequency. The system clock control module 17 immediately resumes output of the clock signal CLK at its normal frequency. The bus arbiter 16 then outputs bus grant signal S2 to master module 11 at time t18. The interval from time t17 to time t18 is a predetermined lag that provides time for the clock signal to return from the divided mode to the normal mode.
In the above sequence of operations, the duration of the power-saving mode is the period T2 extending from time t15, when the power-down master module 13 completes the necessary preparatory processing, to time t18, when the bus arbiter 16 outputs bus grant signal S2. Because of the reduced preparations, this period T2 is longer than the corresponding period T1 in the conventional system.
In the system 10 according to the first embodiment as described above, the following effects are obtained.
(1) Since the bus arbiter 16 outputs the enable signal S6 with lowest priority, whenever the power-down master module 13 receives the enable signal S6, the common bus 15 and the system 10 are automatically ready to enter the power-saving mode. Accordingly, the status of the common bus 15 and system 10 does not need to be monitored, the conventional monitoring hardware or software is not required, and the preparations for power-saving operation are shortened and simplified. The power-saving mode can therefore be entered more quickly than in the conventional system.
(2) Since the power-down master module 13 and bus arbiter 15 execute the recovery from the power-saving mode, neither master module 11 or 12 has to monitor the other master module's bus request signal in the power-saving mode.
(3) The novel power-down master module 13 is easy to design, because it can reuse software or hardware used to issue the commands that effect the transition to and recovery from the power-saving mode in the conventional system.
Referring to
As shown in
The system clock control module 17 in the system 20 in the second embodiment can divide the clock frequency as in the first embodiment, and can also stop clock output completely, depending on the value of the clock control signal S7 received from the power-down master module 23. When the power-down master module 23 receives the enable signal S6 from the bus arbiter 16, it performs the processes 1) and 2) described above to place the system in the power-saving mode, but in the second embodiment process 1) may command the system clock control module 17 to divide the clock frequency or stop clock output altogether. In either case, when the power-down master module 23 receives the recovery request signal S8 during the power-saving mode, it sets the clock control signal S7 to a value that commands the system clock control module 17 to resume output of the clock signal at the normal frequency. The power-down master module 23 has hardware to carry out this function when the clock is stopped.
Even if the clock signal provided to the whole system is stopped in the power-saving mode, since normal clock output resumes on exit from the power-saving mode, after recovery to the normal mode, either master module 11 or 12 can receive the right to access the common bus 15. Granting the bus right is at the discretion of the bus arbiter 16; the decision is made by the decision circuit 163 in the bus arbiter 16 (shown in
The operation of the system 20 will be described below with reference to the exemplary timing shown in
Master module 12 outputs bus request signal S3 at time t21. The bus arbiter 16 outputs bus grant signal S4 to master module 12 at time t22, giving master module 12 the right to use the common bus 15. Master module 12 executes necessary operations such as memory access, after which it stops output of bus request signal S3 at time t23. In response, the bus arbiter 16 stops output of bus grant signal S4 at time t24 and begins output of the enable signal S6 to the power-down master module 23. Master module 12 thus occupies the common bus 15 from time t22 to time t23. During this period, when master module 12 performs memory access the shared memory 14 outputs the access information signal S5 (not shown).
The power-down master module 23 starts the processes that prepare for power-saving operation at time t24 and completes these processes at time t25, after which the system enters the power-saving mode. Immediately after having entered the power-saving mode, at time t26 the system clock signal (CLK) is stopped or its frequency is divided and the whole system is brought into the power-saving mode. The solid line
Eventually, at time t27, the power-down master module 23 receives the external recovery request signal S8. Hardware in the power-down master module 23 responds by setting the clock control signal S7 to the state that commands the system clock control module 17 to return the clock signal CLK to its normal frequency. If the clock signal CLK was stopped, the system 20 restarts at this point from the state in which it stopped at time t26. Awhile later, at time t28, master module 11 needs to access the shared memory 14 again. As in the first embodiment, this need may arise from either software or hardware (e.g., an interrupt). Master module 11 therefore outputs bus request signal S1, and the bus arbiter 16 immediately stops output of the enable signal S6 to the power-down master module 23. Next, at time t29, the bus arbiter 16 outputs bus grant signal S2 to master module 11.
In the above sequence of operations, the power-saving mode period T3 extends from time t25, at which the power-down master module 23 completes the process of initiating the power-saving mode, to time t29, at which the bus arbiter 16 outputs bus grant signal S2.
If the system clock CLK is stopped during the power-saving mode as in the description above, recovery to the normal mode can only occur in response to input of the recovery request signal S8. If output of the clock signal CLK continues during the power-saving mode with a divided clock frequency, however, recovery to the normal mode can occur either in response to input of the recovery request signal S8 or in response to a bus request signal S1 or S3 output from master module 11 or 12 as in the first embodiment.
In the system 20 according to the second embodiment as described above, the following effects are obtained.
(1) As in the first embodiment, when the power-down master module 23 receives the enable signal S6, the common bus 15 and the system 20 are automatically ready to enter the power-saving mode. Accordingly, the status of the common bus 15 and system 20 does not need to be monitored, the conventional monitoring hardware or software is not required, and the preparations for power-saving operation are shortened and simplified. The power-saving mode can therefore be entered quickly.
(2) Since the power-down master module 23 initiates the process of recovery from the power-saving mode in response to the external recovery request signal, neither master module 11 or 12 has to remain active in the power-saving mode. Therefore, it is possible to stop the supply of the clock signal to both master modules 11, 12 during the power-saving mode, achieving an increased reduction in system power consumption.
(3) The power-down master module 13 is easy to design, because it can reuse software or hardware conventionally used to issue the commands that effect the transition to and recovery from the power-saving mode.
The invention is not limited to the preceding embodiments. Those skilled in the art will recognize that further variations are possible within the scope of the invention, which is defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2005-239546 | Aug 2005 | JP | national |