1. Field of the Invention
The present invention relates to processors and methods for instruction processing and, more particularly, to processors and methods for power mode instruction processing, pursuant to which a generic instruction is used to control the various power saving modes in the device based on a literal value, such as a 3-bit literal associated with the power mode instruction.
2. Description of the Prior Art
Processors, including microprocessors, digital signal processors and microcontrollers, operate by running software programs that are embodied in one or more series of instructions stored in a memory. The processors run the software by fetching instructions from the series of instructions, decoding the instructions and executing them. The processors run the software by fetching instructions from the series of instructions, decoding the instructions and executing the instructions. Processors, including digital signal processors, are conventionally adept at processing instructions that perform power saving. In general, power saving is achieved through specific instructions, which perform one function and one function only. Typically, the power save instruction performs a single function. For example, you may have a wait instruction, which will turn off the clocks to the CPU core, but keep the clocks to the peripherals going and another instruction called sleep, which would perhaps turn the clocks off to everything. These power save instructions make inefficient use of processor resources and do not provide flexibility to perform power save operations.
There is a need for a new method of implementing power mode instructions within a processor that can control the sleep mode entered efficiently. There is a further need for a new method of implementing a power mode instruction that initiate a switch to the clock source configuration based on a literal value, such as a 3-bit literal, associated with the power mode instruction. There is also a need turn off power to peripheral modules on an individual basis prior to entering a sleep mode. There is a need for a processor that performs power mode instruction processing, pursuant to which a generic instruction is used to control the various power saving modes in the device based on a literal value, such as a 3-bit literal, associated with the power mode instruction.
According to embodiments of the present invention, a method and a processor for processing a power mode instruction are provided. The power mode instruction itself includes up to five different sleep modes and one run mode, each for initiating a clock source change or inhibit. This instruction may be executed in one processor cycle and with one power mode instruction employing clock transition logic within the processor to initiate a switch to the clock source configuration specified by a literal, such as a 3-bit literal.
A method of processing power mode instruction according to an embodiment of the present invention includes fetching and decoding a power mode instruction. The power mode instruction may be executed on a combination of a CPU clock source and a peripheral clock source. The instruction initiates a switch to the clock source configuration that matches a literal, such as a 3-bit literal.
In an embodiment of the present invention, the power mode instruction may be executed as a first power mode instruction. The first power mode instruction derives the CPU clock source and the peripheral clock source from a primary oscillator. Alternatively, the power mode instruction may be a second power mode instruction. The second power mode instruction derives the CPU clock source and the peripheral clock source from a low power internal RC. Alternatively, the power mode instruction may be a third power mode instruction. The third power mode instruction derives the CPU clock source and the peripheral clock source from a secondary oscillator. Alternatively, the power mode instruction may be a fourth power mode instruction. The fourth power mode instruction disables the CPU clock source and the peripheral clock source. Alternatively, the power mode instruction may be a fifth power mode instruction. The fifth power mode instruction disables the CPU clock source and derives the peripheral clock source from a low power internal RC. Alternatively, the power mode instruction may be a sixth power mode instruction. The sixth power mode instruction disables the CPU clock source and derives the peripheral clock source from a primary oscillator.
In an embodiment of the present invention, the method further includes detecting that an interrupt condition has occurred and loading the first instruction of an interrupt service routine into an instruction register for execution. Alternatively, the method further includes detecting that an interrupt condition has occurred and loading an instruction immediately following the power mode instruction into an instruction register for execution, wherein the power mode instruction disables the CPU clock source.
According to an embodiment of the present invention, a processor for performing power mode instruction processing includes a clock transition logic for initiating a switch to a clock source configuration specified by a literall and a program memory for storing instructions including a power mode instruction. The processor further includes s program counter for identifying current instructions for processing.
The above described features and advantages of the present invention will be more fully appreciated with reference to the detailed description and appended figures in which: The above described features and advantages of the present invention will be more fully appreciated with reference to the detailed description and appended figures in which:
According to the present invention, a method and processor for processing a power mode instruction are provided. More particularly, a method for processing power mode instruction according to an embodiment of the present invention includes fetching and decoding a power mode instruction. The power mode instruction may be executed on a combination of a CPU clock source and a peripheral clock source. The power mode instruction itself includes up to five different sleep modes and one run mode, each for initiating a clock source change or inhibit. This instruction may be executed in one processor cycle and with one power mode instruction employing clock transition logic within the processor to initiate a switch to the clock source configuration specified by a literal.
In order to describe embodiments of power mode instruction processing, an overview of pertinent processor elements is first presented with reference to
Overview of Processor Elements
The processor 100 includes a program memory 105, an instruction fetch/decode unit 110, instruction execution units 115, data memory and registers 120, peripherals 125, data I/O 130, and a program counter and loop control unit 135. The bus 150, which may include one or more common buses, communicates data between the units as shown.
The program memory 105 stores software embodied in program instructions for execution by the processor 100. The program memory 105 may comprise any type of nonvolatile memory such as a read only memory (ROM), a programmable read only memory (PROM), an electrically programmable or an electrically programmable and erasable read only memory (EPROM or EEPROM) or flash memory. In addition, the program memory 105 may be supplemented with external nonvolatile memory 145 as shown to increase the complexity of software available to the processor 100. Alternatively, the program memory may be volatile memory which receives program instructions from, for example, an external non-volatile memory 145. When the program memory 105 is nonvolatile memory, the program memory may be programmed at the time of manufacturing the processor 100 or prior to or during implementation of the processor 100 within a system. In the latter scenario, the processor 100 may be programmed through a process called in-line serial programming.
The instruction fetch/decode unit 110 is coupled to the program memory 105, the instruction execution units 115 and the data memory 120. Coupled to the program memory 105 and the bus 150 is the program counter and loop control unit 135. The instruction fetch/decode unit 110 fetches the instructions from the program memory 105 specified by the address value contained in the program counter 135. The instruction fetch/decode unit 110 then decodes the fetched instructions and sends the decoded instructions to the appropriate execution unit 115. The instruction fetch/decode unit 110 may also send operand information including addresses of data to the data memory 120 and to functional elements that access the registers.
The program counter and loop control unit 135 includes a program counter register (not shown) which stores an address of the next instruction to be fetched. During normal instruction processing, the program counter register may be incremented to cause sequential instructions to be fetched. Alternatively, the program counter value may be altered by loading a new value into it via the bus 150. The new value may be derived based on decoding and executing a flow control instruction such as, for example, a branch instruction. In addition, the loop control portion of the program counter and loop control unit 135 may be used to provide repeat instruction processing and repeat loop control as further described below.
The instruction execution units 115 receive the decoded instructions from the instruction fetch/decode unit 110 and thereafter execute the decoded instructions. As part of this process, the execution units may retrieve one or two operands via the bus 150 and store the result into a register or memory location within the data memory 120. The execution units may include an arithmetic logic unit (ALU) such as those typically found in a microcontroller. The execution units may also include a digital signal processing engine, a floating point processor, an integer processor or any other convenient execution unit. A preferred embodiment of the execution units and their interaction with the bus 150, which may include one or more buses, is presented in more detail below with reference to FIG. 2.
The data memory and registers 120 are volatile memory and are used to store data used and generated by the execution units. The data memory 120 and program memory 105 are preferably separate memories for storing data and program instructions respectively. This format is a known generally as a Harvard architecture. It is noted, however, that according to the present invention, the architecture may be a Von-Neuman architecture or a modified Harvard architecture which permits the use of some program space for data space. A dotted line is shown, for example, connecting the program memory 105 to the bus 150. This path may include logic for aligning data reads from program space such as, for example, during table reads from program space to data memory 120.
Referring again to
The data I/O unit 130 may include transceivers and other logic for interfacing with the external devices/systems 140. The data I/O unit 130 may further include functionality to permit in circuit serial programming of the Program memory through the data I/O unit 130.
The W registers 240 are general purpose address and/or data registers. In order to preserve data information contained in W registers 240, while processing affecting flow control is performed, the data information contained in the W registers 240 may be saved to an array of shadow registers 280. After the processing affecting flow control is performed, the data information contained in the shadow register 280 may be restored to the primary registers, thus permitting processing using the data information to resume. The W registers 240 are communicatively coupled to shadow registers 280, where each bit in the array of primary registers 240 is in communication with a bit in the array of shadow registers 280.
The DSP engine 230 is coupled to both the X and Y memory buses and to the W registers 240. The DSP engine 230 may simultaneously fetch data from each the X and Y memory, execute instructions which operate on the simultaneously fetched data and write the result to an accumulator (not shown) and write a prior result to X or Y memory or to the W registers 240 within a single processor cycle.
In one embodiment, the ALU 270 may be coupled only to the X memory bus and may only fetch data from the X bus. However, the X and Y memories 210 and 220 may be addressed as a single memory space by the X address generator in order to make the data memory segregation transparent to the ALU 270. The memory locations within the X and Y memories may be addressed by values stored in the W registers 240.
Any processor clocking scheme may be implemented for fetching and executing instructions. A specific example follows, however, to illustrate an embodiment of the present invention. Each instruction cycle is comprised of four Q clock cycles Q1-Q4. The four phase Q cycles provide timing signals to coordinate the decode, read, process data and write data portions of each instruction cycle.
According to one embodiment of the processor 100, the processor 100 concurrently performs two operations—it fetches the next instruction and executes the present instruction. Accordingly, the two processes occur simultaneously. The following sequence of events may comprise, for example, the fetch instruction cycle:
The following sequence of events may comprise, for example, the execute instruction cycle for a single operand instruction:
The following sequence of events may comprise, for example, the execute instruction cycle for a dual operand instruction using a data pre-fetch mechanism. These instructions pre-fetch the dual operands simultaneously from the X and Y data memories and store them into registers specified in the instruction. They simultaneously allow instruction execution on the operands fetched during the previous cycle.
Power Mode Instruction Processing
Referring to
The instruction decoder 320 decodes instructions that are stored in the instruction register 315. Based on the bits in the instruction, the instruction decoder 320 selectively activates clock transition logic 325 for performing the specified operation on a combination of a CPU clock source and a peripheral clock source. The clock sources include a primary oscillator 330, a secondary oscillator 335, a low powered internal RC 350. Each of the clock sources may supply power to the CPU and peripherals in accordance with a 3-bit leteral specified by the instruction. In this regard, when a power mode instruction, in accordance with a 3-bit literal depicted in
The clock transition logic 325 may include a register, which includes a plurality of bits and a clock transition bit. The register can be written to manually, such as by a user, with data bits or can fetch an operand that will cause the clock transition logic to switch from one clock source to another clock source. The actual clock source options can be controlled employing the processor by writing to the register. Execution of a power mode instruction fetches the operand and load the operand into the transition logic 325. Writing the bits and the operand before you execute the Power Mode instruction represents the exit state from the instruction.
At any time during the processing of an instruction by the processor, an interrupt condition may occur and be serviced as determined by interrupt logic 365. When an interrupt is serviced, program counter 350 loads into the program counter 350 the address of interrupt service routine instructions for the interrupt condition.
While specific embodiments of the present invention have been illustrated and described, it will be understood by those having ordinary skill in the art that changes may be made to those embodiments without departing from the spirit and scope of the invention.
Number | Name | Date | Kind |
---|---|---|---|
3771146 | Cotton et al. | Nov 1973 | A |
3781810 | Downing | Dec 1973 | A |
3886524 | Appelt | May 1975 | A |
3930253 | Maida | Dec 1975 | A |
4025771 | Lynch et al. | May 1977 | A |
4074353 | Woods et al. | Feb 1978 | A |
4090250 | Carlson et al. | May 1978 | A |
4323981 | Nakamura | Apr 1982 | A |
4379338 | Nishitani et al. | Apr 1983 | A |
4398244 | Chu et al. | Aug 1983 | A |
4408274 | Wheatley et al. | Oct 1983 | A |
4451885 | Gerson et al. | May 1984 | A |
4472788 | Yamazaki | Sep 1984 | A |
4481576 | Bicknell | Nov 1984 | A |
4488252 | Vassar | Dec 1984 | A |
4511990 | Hagiwara et al. | Apr 1985 | A |
4556938 | Parker et al. | Dec 1985 | A |
4615005 | Maejima et al. | Sep 1986 | A |
4626988 | George | Dec 1986 | A |
4709324 | Kloker | Nov 1987 | A |
4730248 | Watanabe et al. | Mar 1988 | A |
4742479 | Kloker et al. | May 1988 | A |
4768149 | Konopik et al. | Aug 1988 | A |
4779191 | Greenblatt | Oct 1988 | A |
4782457 | Cline | Nov 1988 | A |
4800524 | Roesgen | Jan 1989 | A |
4807172 | Nukiyama | Feb 1989 | A |
4829420 | Stahle | May 1989 | A |
4829460 | Ito | May 1989 | A |
4839846 | Hirose et al. | Jun 1989 | A |
4841468 | Miller et al. | Jun 1989 | A |
4872128 | Shimizu | Oct 1989 | A |
4882701 | Ishii | Nov 1989 | A |
4926371 | Vassiliadis et al. | May 1990 | A |
4941120 | Brown et al. | Jul 1990 | A |
4943940 | New | Jul 1990 | A |
4945507 | Ishida et al. | Jul 1990 | A |
4959776 | Deerfield et al. | Sep 1990 | A |
4977533 | Miyabayashi et al. | Dec 1990 | A |
4984213 | Abdoo et al. | Jan 1991 | A |
5007020 | Inskeep | Apr 1991 | A |
5012441 | Retter | Apr 1991 | A |
5032986 | Pathak et al. | Jul 1991 | A |
5034887 | Yasui et al. | Jul 1991 | A |
5038310 | Akagiri et al. | Aug 1991 | A |
5040178 | Lindsay et al. | Aug 1991 | A |
5056004 | Ohde et al. | Oct 1991 | A |
5099445 | Studor et al. | Mar 1992 | A |
5101484 | Kohn | Mar 1992 | A |
5117498 | Miller et al. | May 1992 | A |
5121431 | Wiener | Jun 1992 | A |
5122981 | Taniguchi | Jun 1992 | A |
5155823 | Tsue | Oct 1992 | A |
5177373 | Nakamura | Jan 1993 | A |
5197023 | Nakayama | Mar 1993 | A |
5197140 | Balmer | Mar 1993 | A |
5206940 | Murakami et al. | Apr 1993 | A |
5212662 | Cocanougher et al. | May 1993 | A |
5239654 | Ing-Simmons et al. | Aug 1993 | A |
5276634 | Suzuki et al. | Jan 1994 | A |
5282153 | Bartkowiak et al. | Jan 1994 | A |
5327543 | Miura et al. | Jul 1994 | A |
5327566 | Forsyth | Jul 1994 | A |
5375080 | Davies | Dec 1994 | A |
5379240 | Byrne | Jan 1995 | A |
5386563 | Thomas | Jan 1995 | A |
5392435 | Masui et al. | Feb 1995 | A |
5418976 | Iida | May 1995 | A |
5422805 | McIntyre et al. | Jun 1995 | A |
5432943 | Mitsuishi | Jul 1995 | A |
5448703 | Amini et al. | Sep 1995 | A |
5448706 | Fleming et al. | Sep 1995 | A |
5450027 | Gabara | Sep 1995 | A |
5463749 | Wertheizer et al. | Oct 1995 | A |
5469377 | Amano | Nov 1995 | A |
5471600 | Nakamoto | Nov 1995 | A |
5497340 | Uramoto et al. | Mar 1996 | A |
5499380 | Iwata et al. | Mar 1996 | A |
5504916 | Murakami et al. | Apr 1996 | A |
5506484 | Munro et al. | Apr 1996 | A |
5517436 | Andreas et al. | May 1996 | A |
5525874 | Mallarapu et al. | Jun 1996 | A |
5548544 | Matheny et al. | Aug 1996 | A |
5561384 | Reents et al. | Oct 1996 | A |
5561619 | Watanabe et al. | Oct 1996 | A |
5564028 | Swoboda et al. | Oct 1996 | A |
5568380 | Broadnax et al. | Oct 1996 | A |
5568412 | Han et al. | Oct 1996 | A |
5596760 | Ueda | Jan 1997 | A |
5600813 | Nakagawa et al. | Feb 1997 | A |
5611061 | Yasuda | Mar 1997 | A |
5619711 | Anderson | Apr 1997 | A |
5623646 | Clarke | Apr 1997 | A |
5638524 | Kiuchi et al. | Jun 1997 | A |
5642516 | Hedayat et al. | Jun 1997 | A |
5649146 | Riou | Jul 1997 | A |
5651121 | Davies | Jul 1997 | A |
5657484 | Scarrá | Aug 1997 | A |
5659700 | Chen et al. | Aug 1997 | A |
5682339 | Tam | Oct 1997 | A |
5689693 | White | Nov 1997 | A |
5694350 | Wolrich et al. | Dec 1997 | A |
5696711 | Makineni | Dec 1997 | A |
5701493 | Jaggar | Dec 1997 | A |
5706460 | Craig et al. | Jan 1998 | A |
5706466 | Dockser | Jan 1998 | A |
5715470 | Asano et al. | Feb 1998 | A |
5737570 | Koch | Apr 1998 | A |
5740095 | Parant | Apr 1998 | A |
5740419 | Potter | Apr 1998 | A |
5740451 | Muraki et al. | Apr 1998 | A |
5748516 | Goddard et al. | May 1998 | A |
5748970 | Miyaji et al. | May 1998 | A |
5764555 | McPherson et al. | Jun 1998 | A |
5765216 | Weng et al. | Jun 1998 | A |
5765218 | Ozawa et al. | Jun 1998 | A |
5774711 | Henry et al. | Jun 1998 | A |
5778237 | Yamamoto et al. | Jul 1998 | A |
5778416 | Harrison et al. | Jul 1998 | A |
5790443 | Shen et al. | Aug 1998 | A |
5808926 | Gorshtein et al. | Sep 1998 | A |
5812439 | Hansen | Sep 1998 | A |
5812868 | Moyer et al. | Sep 1998 | A |
5815693 | McDermott et al. | Sep 1998 | A |
5825730 | Nishida et al. | Oct 1998 | A |
5826072 | Knapp et al. | Oct 1998 | A |
5826096 | Baxter | Oct 1998 | A |
5828875 | Halvarsson et al. | Oct 1998 | A |
5862065 | Muthusamy | Jan 1999 | A |
5867726 | Ohsuga et al. | Feb 1999 | A |
5875342 | Temple | Feb 1999 | A |
5880984 | Burchfiel et al. | Mar 1999 | A |
5892697 | Brakefield | Apr 1999 | A |
5892699 | Duncan et al. | Apr 1999 | A |
5894428 | Harada | Apr 1999 | A |
5900683 | Rinehart et al. | May 1999 | A |
5909385 | Nishiyama et al. | Jun 1999 | A |
5917741 | Ng | Jun 1999 | A |
5918252 | Chen et al. | Jun 1999 | A |
5930159 | Wong | Jul 1999 | A |
5930503 | Drees | Jul 1999 | A |
5936870 | Im | Aug 1999 | A |
5937199 | Temple | Aug 1999 | A |
5938759 | Kamijo | Aug 1999 | A |
5941940 | Prasad et al. | Aug 1999 | A |
5943249 | Handlogten | Aug 1999 | A |
5944816 | Dutton et al. | Aug 1999 | A |
5951627 | Kiamilev et al. | Sep 1999 | A |
5951679 | Anderson et al. | Sep 1999 | A |
5973527 | Schweighofer et al. | Oct 1999 | A |
5974549 | Golan | Oct 1999 | A |
5978825 | Divine et al. | Nov 1999 | A |
5983333 | Kolagotla et al. | Nov 1999 | A |
5991787 | Abel et al. | Nov 1999 | A |
5991868 | Kamiyama et al. | Nov 1999 | A |
5996067 | White | Nov 1999 | A |
6002234 | Ohm et al. | Dec 1999 | A |
6009454 | Dummermuth | Dec 1999 | A |
6014723 | Tremblay et al. | Jan 2000 | A |
6018757 | Wong | Jan 2000 | A |
6026489 | Wachi et al. | Feb 2000 | A |
6044392 | Anderson et al. | Mar 2000 | A |
6044434 | Oliver | Mar 2000 | A |
6049858 | Kolagotla et al. | Apr 2000 | A |
6055619 | North et al. | Apr 2000 | A |
6058409 | Kozaki et al. | May 2000 | A |
6058410 | Sharangpani | May 2000 | A |
6058464 | Taylor | May 2000 | A |
6061711 | Song et al. | May 2000 | A |
6061780 | Shippy et al. | May 2000 | A |
6061783 | Harriman | May 2000 | A |
6076154 | Van Eijndhoven et al. | Jun 2000 | A |
6084880 | Bailey et al. | Jul 2000 | A |
6101521 | Kosiec | Aug 2000 | A |
6101599 | Wright et al. | Aug 2000 | A |
6115732 | Oberman et al. | Sep 2000 | A |
6128728 | Dowling | Oct 2000 | A |
6134574 | Oberman et al. | Oct 2000 | A |
6144980 | Oberman | Nov 2000 | A |
6145049 | Wong | Nov 2000 | A |
6181151 | Wasson | Jan 2001 | B1 |
6202163 | Gabzdyl et al. | Mar 2001 | B1 |
6205467 | Lambrecht et al. | Mar 2001 | B1 |
6209086 | Chi et al. | Mar 2001 | B1 |
6243786 | Huang et al. | Jun 2001 | B1 |
6243804 | Cheng | Jun 2001 | B1 |
6260162 | Typaldos et al. | Jul 2001 | B1 |
6282637 | Chan et al. | Aug 2001 | B1 |
6292866 | Zaiki et al. | Sep 2001 | B1 |
6295574 | MacDonald | Sep 2001 | B1 |
6315200 | Silverbrook et al. | Nov 2001 | B1 |
6356970 | Killian et al. | Mar 2002 | B1 |
6377619 | Denk et al. | Apr 2002 | B1 |
6397318 | Peh | May 2002 | B1 |
6412081 | Koscal et al. | Jun 2002 | B1 |
6434020 | Lambert et al. | Aug 2002 | B1 |
6487654 | Dowling | Nov 2002 | B1 |
6523108 | James et al. | Feb 2003 | B1 |
6552625 | Bowling | Apr 2003 | B1 |
6564238 | Kim et al. | May 2003 | B1 |
6633970 | Clift et al. | Oct 2003 | B1 |
6643150 | Kawakami | Nov 2003 | B1 |
6658578 | Laurenti et al. | Dec 2003 | B1 |
6681280 | Miyake et al. | Jan 2004 | B1 |
6694398 | Zhao et al. | Feb 2004 | B1 |
6724169 | Majumdar et al. | Apr 2004 | B1 |
6728856 | Grosbach et al. | Apr 2004 | B1 |
6751742 | Duhault et al. | Jun 2004 | B1 |
6763478 | Bui | Jul 2004 | B1 |
20020194466 | Catherwood et al. | Dec 2002 | A1 |
20030093656 | Masse et al. | May 2003 | A1 |
20040150439 | Greenfield | Aug 2004 | A1 |
Number | Date | Country |
---|---|---|
0 554 917 | Aug 1993 | EP |
0 855 643 | Jul 1998 | EP |
0 992 888 | Dec 2000 | EP |
0 992 889 | Dec 2000 | EP |
01037424 | Feb 1989 | JP |
9611443 | Apr 1996 | WO |
Number | Date | Country | |
---|---|---|---|
20030126484 A1 | Jul 2003 | US |