Microcontroller with an interrupt structure having programmable priority levels with each priority level associated with a different register set
Typically, for processing systems it must be guaranteed that all interrupted program stream parameters are restored before the execution of the first program stream resumes. If during this transfer an interrupt occurs, then all data may not be stored or restored. If the error free storage of the program register contents and other critical first program stream data does not occur, the processor (180) has no way of knowing whether the first program stream data restored to the registers has become corrupt or not. Thus, a novel register architecture (120, 121, 122, 123, 124, 125) is provided that facilitate processing of interrupting program streams without storing and restoring interrupted program stream critical data.
Latest Koninklijke Philips Electronics N.V. Patents:
- METHOD AND ADJUSTMENT SYSTEM FOR ADJUSTING SUPPLY POWERS FOR SOURCES OF ARTIFICIAL LIGHT
- BODY ILLUMINATION SYSTEM USING BLUE LIGHT
- System and method for extracting physiological information from remotely detected electromagnetic radiation
- Device, system and method for verifying the authenticity integrity and/or physical condition of an item
- Barcode scanning device for determining a physiological quantity of a patient
The invention relates to the field of processor architecture and more specifically to the field of data register architecture for use with microcontrollers.
Program stream data is typically stored in a memory circuit, where the instructions encoded within the program data for a particular routine are executed by a processor, when an interrupt occurs, one program stream interrupts the execution of another one. The multiple instructions making up each program stream are stored at a specific location in the memory circuit. The program stream instructions allow the processor to carry out various tasks. Instructions from each program stream are typically sequentially retrieved and processed one at a time.
While processing instructions from a program stream, the processor utilizes program registers. These registers are memory locations within the processor that support very high speed direct access by the microprocessor. For example, some operations are specifically for processing data directly within the registers. Program stream data read from the memory circuit is stored in these registers and the processor performs logical and arithmetic operations on the values stored therein. When the execution of a first program stream becomes interrupted by a second other program stream, the contents of the program registers corresponding to the first program stream are typically stored elsewhere in order to allow the interrupting program to utilize the same set of program registers. Once the interrupting program—second program stream—has completed its sequence of instructions, the contents of the program registers corresponding to the first program stream are restored and execution of the first program stream resumes at a subsequent program counter at which the interruption occurred. Thus, all information corresponding to the first program stream is typically saved prior to servicing of the interrupting second program stream.
Of course, with such a system, it must be guaranteed that all interrupted program stream parameters are restored before the execution of the first program stream resumes. If during this transfer an interrupt occurs, then all data may not be stored or restored. If the error free storage of the program register contents and other critical first program stream data does not occur, the processor has no way of knowing whether the first program stream data restored to the registers has become corrupt or not. In order to ensure that all first program stream data is transferred, the interrupting task must wait until the restoration process is completed, which wastes valuable processing time and results in increased power consumption.
A need therefore exists to facilitate processing of interrupting program streams without storing and restoring interrupted program stream critical data. It is therefore an object of the invention to provide a system for facilitating the execution of an interrupting program stream without storing and restoring interrupted program stream critical data.
SUMMARY OF THE INVENTIONIn accordance with the invention there is provided a system comprising a processor; a plurality of register bank blocks; and, a register bank block decoder circuit for activating one and only one of the plurality of register bank blocks, the register bank block decoder circuit responsive to interrupt event operations for selecting the one of the plurality of register bank blocks for being activated, where different interrupt event operations result in selection of different ones of the plurality of register bank blocks.
In accordance with the invention there is provided a method of switching processing resources in a data processing system comprising the steps of: providing a plurality of register bank blocks; utilizing a first register bank block from the plurality of register bank blocks for data processing; receiving of an interrupt request for initiating an interrupt event; determining if the interrupt request is to be fulfilled, and if so, then selecting a second register bank block from the plurality of register bank blocks, the selected second register bank block in isolation from the first register bank block; and, utilizing the second register bank block from the plurality of register bank blocks for data processing.
In accordance with the invention there is provided a storage medium having data stored thereon, the data for implementation of a processing system comprising: first instruction data for providing a plurality of register bank blocks; and, second instruction data for providing a register bank block decoder circuit for activating one of the plurality of register bank blocks in isolation, the register bank block decoder circuit responsive to interrupt event operations for selecting the one of the plurality of register bank blocks for being activated, where different interrupt event operations result in selection of different ones of the plurality of register bank blocks.
Exemplary embodiments of the invention will now be described in conjunction with the following drawings, in which:
As illustrated in
Though, only 32 VPB peripheral device select signals are listed in Table 1, the VPB bridge is not limited to only 32 peripheral device select signals, the number of peripheral device select signals is a matter of design choice.
A first set of six 8-bit registers, 120a through 125a, belonging to a plurality of register bank blocks, Bank0 to Bank5, is coupled between six 8-bit output ports of a first input switching circuit in the form of a first input MUX 131 and six 8-bit input ports of the first output MUX 111. This first set of registers is for storing of 8-bits of data received from the peripheral data input bus, pdi[7:0].
A second set of six 8-bit registers, 120b through 125b, belonging to a plurality of register bank blocks, Bank0 to Bank5, is coupled between six 8-bit output ports of the second switching circuit in the form of a second input MUX 132 and six 8-bit input ports of the second output MUX 112. This second set of registers is for storing of 8-bits of data received from the peripheral data input bus, pdi[15:8].
A third set of six 8-bit registers, 120c through 125c, belonging to a plurality of register bank blocks, Bank0 to Bank5, is coupled between six 8-bit output ports of the third input switching circuit in the form of a third input MUX 133 and six 8-bit input ports of the third output MUX 113. This third set of registers is for storing of 8-bits of data received from the peripheral data input bus, pdi[23:16].
A fourth set of six 8-bit registers, 120d through 125d, belonging to a plurality of register bank blocks, Bank0 to Bank5, is coupled between six 8-bit output ports of the fourth input switching circuit in the form of a fourth input MUX 134 and six 8-bit input ports of the fourth output MUX 114. This fourth set of registers is for storing of 8-bits of data received from the peripheral data input bus, pdi[31:24]. Registers 120a, 120b, 120c and 120d form a first register bank block 120 from the plurality of register bank blocks. Registers 121a, 121b, 121c and 121d form a second register bank block 121 from the plurality of register bank blocks. Registers 122a, 122b, 122c and 122d form a third register bank block 122 from the plurality of register bank blocks. Registers 123a, 123b, 123c and 123d form a fourth register bank block 123 from the plurality of register bank blocks. Registers 124a, 124b, 124c and 124d form a fifth register bank block 124 from the plurality of register bank blocks. Registers 125a, 125b, 125c and 125d form a sixth register bank block 125 from the plurality of register bank blocks.
Input ports 502 are used for receiving data register bank select signals for selecting of a register bank to activate for access thereto. Disposed within the SFR block 501 are the first through fourth input MUXs, 131 to 134, the first through fourth register banks, and the first through fourth output MUXs, 111 to 114.
The register bank decoder circuit 701 decodes the ic_pri_top signal to generate register bank select signals at register bank select output ports 702. These register bank select output ports 702 are coupled to register select input ports 502 of the SFR block 501. This circuit 702 also detects debug interrupt level and uses a dbsel_pri input signal to generate select signals if a dbsel_en signal is set.
Referring back to
xfer_start<=mx1—vpb—acc AND((NOT mx1—id—xdrd—n)OR(NOT mx1—id—xdwr—n))
The VPB bridge 100 remains idle, step 1001, while xfer_start=0, once xfer_start=1, setup operations are performed, where the output signals and the ports for receiving of input signals are selected, in step 1002. Once setup is complete, a strobe signal is provided, step 1003, and the output signals are provided from the VPB bridge 100 and the input signals are received by the VPB bridge. Thereafter, the VPB bridge 100 returns to an idle state, step 1001.
Referring to
Thus, if there are N levels of interrupt priority then N+1 register bank blocks are provided, which also includes the case where no interrupts are active. If the VPB peripheral device is performing a transfer of data to or from the bank registers and an interrupt of higher priority occurs, and is accepted, then a different set of register banks are made accessible to the interrupting second program stream. These interruptions and provisions of new register banks occur up to a maximum interrupt priority. Once the highest priority program stream completes, then the next lower one is directed to continue until it completes or is interrupted again by a higher interrupt priority program stream. Thus, completion of VPB peripheral information transfer is facilitated for any sequence of interrupts, with no requirements being placed on any interrupt routines to store and restore any SFR information.
For the exemplary architecture illustrated, at any time, a maximum number of active interrupt levels preferably does not exceed 6. Each interrupt level is provided with a private bank of VPBD0-VPBD3 registers for exclusive use by that interrupt. By implementing different register banks for use by different interrupting program streams, save and restore register operations in the interrupt handler are obviated. This saves valuable processing resources and provides reduced power consumption, since every time that a store and restore operation is performed, logic gates are enabled and disabled, thus wasting electrical power. That said, the faster the processing time for storing and restoring registers, the more power that is consumed by the processing system.
Of course, for system debugging purposes, when the debug mode is active, all register banks are accessible. By setting bit D3, EN, in the DBSEL register 150. Bits D0-D2 of DBSEL register are used to select the bank. Advantageously, the VPB bridge 100 implements 3 clock VPB bus cycle and does not support “perr” and “prdy” signals. Each VPB peripheral is allocated memory space within the memory circuit 182. Address lines and clock signals for VPB peripherals are not routed through the bridge. Memory address lines (mx1_acu_xadr[13:0]) are directly connected to the peripheral address lines (pa[13:0]). CPU clock (mx1_clk) is directly connect to the peripheral clock(pclk). For the current implementation shown, up to 32 peripherals are supported by the VPB bridge 100. Of course, the VPB bridge is expandable for use with any number of VPB peripherals by modifying the VPB address decoder 801.
The above described embodiment of the invention relieves the interrupting program stream from storing and restoring the contents of any VPB peripheral access that may have been underway before the interrupting program stream was directed to interrupt and begin execution. As a result, processing time, as well as code space is saved. Also, the compiler does not have to include instruction code for saving and restoring of SFR contents, thus the compiler design is simplified and less instructions are utilized in the compiled program streams.
The VPB bridge 100, shown in the example embodiments of the invention, is applicable for use with an 8051 processor core, known to those of skill in the art, where the 8051 microcontroller typically employs 4 interrupt priority levels. For example, the VBO bridge 100 is used within a 80C51 MX1 core ® microcontroller architecture manufactured by Philips semiconductors. Of course, the VPB bridge 100 is applicable to many other processor architectures.
Optionally, the register bank block decoder circuit 140 also includes a circuit 140a for storing and retrieving of register bank block selection data derived from the register bank block selection signal of a pre interrupt switch state, wherein upon terminating of an interrupt event the input switching circuit and the output switching circuit are provided with the pre interrupt register bank block selection signal derived from the stored bank block selection data.
Numerous other embodiments may be envisaged without departing from the spirit or scope of the invention.
Claims
1. A system comprising:
- a processor (180);
- a plurality of register bank blocks (120, 121, 122, 123, 124, 125); and,
- a register bank block decoder circuit (140) for activating one and only one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125), the register bank block decoder circuit (140) responsive to interrupt event operations for selecting the one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) for being activated, where different interrupt event operations result in selection of different ones of the plurality of register bank blocks (120, 121, 122, 123, 124, 125).
2. A system according to claim 1, comprising:
- a memory circuit (182) for storing of a first program data and for storing of a second program data associated with a second interrupt priority,
- wherein the processor (180) is for utilizing a first register bank block (120) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125) during execution of the first program stream, and for upon the occurrence of an interrupt resulting from an interrupt event associated with the second program stream, executing the second program stream utilizing the second register bank block (121), the second register bank block (121) different and logically isolated from the first register bank block (120).
3. A system according to claim 2, wherein the second program stream has a higher interrupt priority than the first program stream.
4. A system according to claim 1, comprising:
- an input data bus (151); and,
- an input switching circuit (131, 132, 133, 134) coupled to the plurality of register bank blocks (120, 121, 122, 123, 124, 125) and having a selection input port for receiving a register bank selection signal from the register bank block decoder circuit (140), the input switching circuit (131, 132, 133, 134) for activating one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) in dependence upon the register bank selection signal, the activated one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) for being coupled to the input data bus (151).
5. A system according to claim 4, wherein the input switching circuit (131, 132, 133, 134) is a multiplexer circuit.
6. A system according to claim 4, comprising:
- an output data bus (152); and,
- an output switching circuit (111, 112, 113, 114) coupled to the plurality of register bank blocks and having a selection input port for receiving the register bank block selection signal from the register bank block decoder circuit (140), the output switching circuit (111, 112, 113, 114) for switchably coupling the activated one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) to the output data bus (152).
7. A system according to claim 6, wherein the output switching circuit (111, 112, 113, 114) is a multiplexer circuit.
8. A system according to claim 6, comprising a circuit (140a) for storing and retrieving of bank block selection data derived from the register bank block selection signal of a pre interrupt switch state, wherein upon terminating of an interrupt event the input switching circuit (131, 132, 133, 134) and the output switching circuit (111, 112, 113, 114) is provided with the pre interrupt register bank block selection signal derived from the stored bank block selection data.
9. A system according to claim 8, wherein the state of the circuit (140a) for storing and retrieving of the register bank block selection signal is based on interrupt priority
10. A system according to claim 6, wherein the register bank block selection signal is based solely on interrupt priority.
11. A system according to claim 1, wherein a first register bank block (120) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125) is concurrently enabled along with a second different register bank block (121, 122, 123, 124, 125) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125), the second different register bank block (121, 122, 123, 124, 125) independently addressable from the first register bank block (120).
12. A system according to claim 1, comprising a debug bank select register (150) coupled to the register bank block decoder circuit (140), the debug bank select register (150) for providing access to data stored within the plurality of register bank blocks (120, 121, 122, 123, 124, 125) during a step of debugging.
13. A method of switching processing resources in a data processing system comprising the steps of:
- providing a plurality of register bank blocks (120, 121, 122, 123, 124, 125);
- utilizing (1101) a first register bank block (120) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125) for data processing;
- receiving (1102) of an interrupt request for initiating an interrupt event;
- determining (1103) if the interrupt request is to be fulfilled, and if so, then: selecting (1104) a second register bank block (121) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125),
- the selected second register bank block (121) in isolation from the first register bank block (120); and,
- utilizing (1105) the second register bank block (121) from the plurality of register bank blocks (120, 121, 122, 123, 124, 125) for data processing.
14. A method according to claim 13, wherein a first program stream is provided for utilizing of the first register bank block (120) and a second program stream is provided for utilizing the second register bank block (121).
15. A method according to claim 14, the first program stream has a lower interrupt priority than the second program stream, the interrupt priority used in the step of determining (1103) whether to fulfill the interrupt request.
16. A method according to claim 14, comprising the step of:
- providing a processor (180) for executing of the first and second program streams.
17. A method according to claim 16, comprising the step of:
- halting (1112) execution of the second program stream;
- selecting (1113) the first register bank block; and,
- resuming (1114) execution of the first program stream.
18. A method according to claim 17, wherein executing the instructions of the second program stream takes place without altering the contents of the first register bank block (120) in suspended use by the first program stream.
19. A method according to claim 13, comprising the step of:
- providing a memory circuit (182) having a first memory region for storing of program stream data related to the first program stream.
20. A method according to claim 14, wherein the first and second program streams other than have stored therein instruction data for storing and restoring of register bank block (120, 121, 122, 123, 124, 125) contents.
21. A storage medium having data stored thereon, the data for implementation of a processing system comprising:
- first instruction data for providing a plurality of register bank blocks (120, 121, 122, 123, 124, 125); and,
- second instruction data for providing a register bank block decoder circuit (140) for activating one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) in isolation, the register bank block decoder circuit (140) responsive to interrupt event operations for selecting the one of the plurality of register bank blocks (120, 121, 122, 123, 124, 125) for being activated, where different interrupt event operations result in selection of different ones of the plurality of register bank blocks (120, 121, 122, 123, 124, 125).
Type: Application
Filed: Jul 29, 2004
Publication Date: Sep 14, 2006
Applicant: Koninklijke Philips Electronics N.V. (Eindhoven)
Inventors: Pankaj Shrivastava (San Jose, CA), Gregory Goodhue (San Jose, CA), Ata Khan (Saratoga, CA), Zhimin Ding (Sunnyvale, CA), Craig Mackenna (Los Gatos, CA)
Application Number: 10/566,515
International Classification: G06F 13/24 (20060101); G06F 13/36 (20060101);