|Publication number||US5649207 A|
|Application number||US 08/348,373|
|Publication date||Jul 15, 1997|
|Filing date||Dec 1, 1994|
|Priority date||Dec 1, 1994|
|Publication number||08348373, 348373, US 5649207 A, US 5649207A, US-A-5649207, US5649207 A, US5649207A|
|Inventors||Hiroshi Suzuki, Yasuo Yamada|
|Original Assignee||Kawasaki Steel Corporation|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (4), Referenced by (6), Classifications (21), Legal Events (5)|
|External Links: USPTO, USPTO Assignment, Espacenet|
1. Field of the Invention
The present invention relates to a microprocessor unit (called the MPU hereunder where appropriate) having an interrupt mechanism.
2. Description of the Prior Art
Recent advances in LSI (large scale integration) technology have led to a growing number of LSI applications such as those in which a single LSI chip constitutes a computer system and those in which the so-called custom LSI chip incorporates a central processing unit (CPU). Such diverse LSI applications comprise in a variety of ways a microprocessor unit that not only executes a large number of commands in a predetermined sequence; the MPU also has an interrupt mechanism that generally branches to an unsequenced address upon receipt of an interrupt signal. Where a plurality of interrupt conditions exist, a plurality of interrupt input terminals are provided so that the branch destination is varied depending on which interrupt input terminal has received an interrupt signal. Alternatively, the branch destination is determined by the interrupt vector fetched during an interrupt acknowledgment cycle in effect when the interrupt signal is input.
FIG. 4 is a basic constitution of a conventional microprocessor (MPU) with a memory, FIG. 5 is an address map of a memory area containing commands, FIG. 6 is a timing chart in effect when an interrupt signal is input during an execution sequence of an MPU, and FIG. 7 is a timing chart in effect when the interrupt routine of the MPU is terminated during the execution sequence of the MPU.
As shown in FIG. 4, the microprocessor 10 includes internal registers 12, an arithmetic logic unit (ALU) 14, a program counter (PC) 16, a stack pointer 18, an interrupt vector (IV) 20, a multiplexer (MPX) 22 for selecting address inputted to a memory 30 and an interrupt control circuit 24 for receiving an interrupt signal INT--.
What follows is a brief description of how an interrupt illustratively takes place. Only one interrupt is assumed to occur in this example for the sake of simplicity.
The main routine is stored in a region including addresses 1234 and 1235. The interrupt routine is stored at address 2000 and subsequent addresses. Addresses FFFE and FFFF are used as a stack area in which to save the content of the program counter PC upon interrupt.
In FIGS. 6 and 7, CLK stands for a clock signal, MRD-- for a memory read signal, MWR-- for a memory write signal, AD for an address signal, DATA for a data signal, PC for a program counter contents, and INT-- for the interrupt signal.
Suppose that, as shown in FIG. 6, the interrupt signal INT-- is asserted (i.e., brought Low) while the main routine command held at address 1234 is being executed. In that case, the interrupt acknowledgment cycle is entered when the command at address 1234 has ended. The low and high-order bytes of the program counter PC are saved respectively to addresses FFFF and FFFE. When the command at address 1234 is executed, the content of the program counter PC points to the next address 1235. Thus the low-order byte "35" of the program counter PC is saved to address FFFF and the high-order byte "12," to address FFFE. The save operation is followed by an interrupt process branching to address 2000, i.e., the first address of the interrupt routine.
When the interrupt routine is terminated, the data "35" and "12" saved respectively at addresses FFFE and FFFF are read therefrom and placed in the program counter PC. The address number pointing to address 1235 is then output so that execution of the main routine is resumed from address 1235.
In addition to a normal interrupt function that may be utilized by the user at his discretion, some MPU's have the so-called debug-dedicated interrupt function. The debug-dedicated interrupt function, usually not for use by the user, is a function used by a debugging apparatus incorporating debugging software. The debugging apparatus, illustratively called an incircuit emulator, is designed to debug user-generated programs. There should be no change in the execution status of the user-generated program regardless of debug interrupt being effected or not. To keep the user from becoming aware of debug interrupt requires that, at the end of the interrupt process handling the debug interrupt, there be restored the same internal status as that in effect when the debug interrupt in question was accepted.
Ordinary MPU's have a HALT command for stopping command execution. Executing the HALT command causes the MPU to halt and to stop executing all subsequent commands.
The halt state is released either upon reset or upon interrupt. This takes place as follows: suppose that the HALT command is stored at address 1234. In that case, as described with reference to FIGS. 6 and 7, the program counter possesses the next address 1235 when execution of the HALT command has resulted in the halt state. When the interrupt routine is terminated, the command held at address 1235 is read and executed.
A problem arises if a debug interrupt occurs when the halt state is in effect upon execution of a user-generated program. That is, despite the need to restore the internal state in effect prior to the debug interrupt, the halt state is released once that interrupt takes place. As a result, the halt state before the interrupt cannot be resumed.
One conventional solution of the above problem is to devise circuitry whereby the circuit operation is changed only if a debug interrupt is accepted during execution of the HALT command; the content of the program counter is then decremented by 1 before being saved into a stack.
One disadvantage of this solution is the need for special hardware by which to decrement the content of the program counter. This results in a growing scope of the circuit configuration involved.
It is therefore an object of the present invention to provide a microprocessor unit having a minimum scope of circuitry and capable of addressing the debug interrupt in a flexible manner.
In carrying out the invention and according to one aspect thereof, there is provided, a microprocessor unit for executing a plurality of commands sequentially and for branching to an interrupt process upon receipt of an interrupt, the microprocessor unit comprising:
(a) a program counter pointing to an address having the command to be executed next, the address being contiguous to the address where the command currently executed exists;
(b) an interrupt mechanism for saving the content of the program counter into a stack upon receipt of an interrupt and for branching to an interrupt process thereafter; and
(c) a branching destination selecting mechanism for selecting, upon receipt of at least one predetermined interrupt, a branching destination in accordance with the kind of the command being executed when the predetermined interrupt was received.
In a preferred structure according to the invention, the plurality of commands includes a HALT command for causing the microprocessor unit to halt command execution, and the branching destination selecting mechanism selects the branching destination depending on whether or not the command being executed when the predetermined interrupt was received, was the HALT command or not.
When a predetermined interrupt is received, the microprocessor unit (MPU) of the invention is capable of selecting the branching destination depending on the kind of the command being executed upon receipt of that interrupt, e.g., depending on whether that command is a HALT command or otherwise. Illustratively, if a debug interrupt is received while the HALT command is being executed, the content of the stack in which the content of the program counter is saved, may be decremented by software. Because the branching destination is altered in accordance with the kind of the command being executed (e.g., depending on the debug interrupt in effect or otherwise), a significantly flexible system is implemented by use of the inventive MPU.
The increase in the scope of hardware stemming from the above constitution is minimal. The change in the microprocessor involves only the branching destination being altered illustratively depending on whether the command is a HALT command or not. The resulting rise in hardware quantity is practically negligible.
These and other objects, features and advantages of the invention will become more apparent upon a reading of the following description and appended drawings.
A preferred embodiment will be described with reference to the drawings, wherein identical elements have been denoted throughout the figures with identical reference numerals, and wherein:
FIG. 1 is a block diagram showing a basic constitution of a microprocessor unit (MPU) with a memory, practiced as a preferred embodiment of the invention;
FIG. 2 is a timing chart in effect when a predetermined interrupt is input during an execution sequence of the embodiment;
FIG. 3 is a timing chart in effect when the interrupt routine has ended during the execution sequence of the embodiment;
FIG. 4 is a basic constitution of a conventional microprocessor unit (MPU) with a memory;
FIG. 5 is an address map of a memory area that stores commands;
FIG. 6 is a timing chart in effect when an interrupt signal is input during an execution sequence of a MPU; and
FIG. 7 is a timing chart in effect when the interrupt routine has ended during the execution sequence of the MPU.
A preferred embodiment of the present invention will be described below in detail with reference to the accompanying drawings.
FIG. 1 is a block diagram showing a basic constitution of a microprocessor unit (MPU) 10 with a memory 30, practiced as a preferred embodiment of the invention.
Different from the conventional MPU as shown in FIG. 4, the MPU 10 further includes a vector modifier 40. According to kind of command being executed when the INT-- signal was received, the interrupt control circuit 24 changes start address (vector 1 or vector 2) of interrupt process routine by modifying the interrupt vector (IV) 20 through the vector modifier 40.
FIG. 2 is a timing chart in effect when a predetermined interrupt is input during an execution sequence of the MPU of the invention, and FIG. 3 is a timing chart in effect when the interrupt routine has ended during the execution sequence of that MPU. The two charts correspond respectively to FIGS. 6 and 7 referenced above for description of the prior art.
During execution of the command at address 1234, an interrupt signal INT-- is asserted (i.e., brought Low). During an interrupt acknowledgment cycle, the low and high-order bytes of the program counter value "1235" are saved respectively at FFFF and FFFE which serve as a stack area. Thereafter an interrupt process is carried out. The branching destination for that process, i.e., the address indicated by arrow A in FIG. 2, differs depending on the kind of the command held at address 1234.
If a HALT command is stored at address 1234 and if the interrupt signal INT-- is input during execution of that HALT command, the processing branches illustratively to address 2000 (vector 1).
If a command other than the HALT command is held at address 1234 and if the interrupt signal INT.sub. is input during execution of that command, the processing branches illustratively to address 2010 (vector 2).
Between address 2000 and address 200F is a command that causes the value "1235" to be read from addresses FFFE and FFFF and decremented by 1 to generate "1234," the result being set again to addresses FFFE and FFFF. In this setup, if the HALT command is being executed upon receipt of the interrupt, the end of the interrupt process is followed by the halt state brought about by another execution of the HALT command at address 1234, as shown in FIG. 3. If a command other than the HALT command is being executed when the interrupt is received, the end of the interrupt process is followed by the execution of the next command, i.e., the command held at address 1235 as in the conventional case of FIG. 6.
Even where the processing is arranged to branch to a different address (e.g., address 2000 or 2010 in the above setup) depending on the command in effect upon receipt of the interrupt, it may be desired to carry out the same kind of processing regardless of the type of the command. In that case, a branch command may be set to address 2000 for branching to address 2010, or NOP commands may be set to addresses 2000 through 200F for performing no operation.
According to this invention, the commands may be divided not only into two groups (e.g., HALT command and the other commands) but also into more groups so that a different branching destination is assigned to each of these command groups for their respective appropriate processing. In this manner, the microprocessor unit of the invention provides high degrees of operational freedom and flexibility.
It should be apparent to those skilled in the art that the above-described embodiment is merely representative, which represents the applications of the principles of the present invention. Numerous and varied other arrangements can be readily devised by those skilled in the art without departing from the spirit and the scope of the invention.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4484271 *||Jun 28, 1982||Nov 20, 1984||Honeywell Information Systems Inc.||Microprogrammed system having hardware interrupt apparatus|
|US5187791 *||Oct 29, 1991||Feb 16, 1993||Apple Computer, Inc.||Microprocessor with improved interrupt response with data saving dependent upon processor status using status flag|
|US5291604 *||Aug 30, 1991||Mar 1, 1994||Intel Corporation||Transparent system interrupts with automated halt state restart|
|JPH04288633A *||Title not available|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US6708268||Mar 26, 1999||Mar 16, 2004||Microchip Technology Incorporated||Microcontroller instruction set|
|US7203818||Mar 9, 2004||Apr 10, 2007||Microchip Technology Inc.||Microcontroller instruction set|
|US7206924||Dec 31, 2003||Apr 17, 2007||Microchip Technology Inc.||Microcontroller instruction set|
|US20040158692 *||Dec 31, 2003||Aug 12, 2004||Microchip Technology Incorporated||Microcontroller instruction set|
|US20040177211 *||Mar 9, 2004||Sep 9, 2004||Microchip Technology Incorporated||Microcontroller instruction set|
|WO2000058828A1 *||Mar 23, 2000||Oct 5, 2000||Microchip Tech Inc||Microcontroller instruction set|
|U.S. Classification||710/260, 712/E09.06, 712/E09.032, 712/E09.074, 710/267, 710/268|
|International Classification||G06F13/24, G06F9/32, G06F9/38, G06F9/46, G06F9/30|
|Cooperative Classification||G06F9/30079, G06F9/321, G06F9/461, G06F9/3861, G06F13/24|
|European Classification||G06F9/30A8H, G06F9/46G, G06F9/32A, G06F13/24, G06F9/38H|
|Dec 1, 1994||AS||Assignment|
Owner name: KAWASAKI STEEL CORPORATION, JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SUZUKI, HIROSHI;YAMADA, YASUO;REEL/FRAME:007260/0993
Effective date: 19941125
|Dec 29, 2000||FPAY||Fee payment|
Year of fee payment: 4
|Dec 10, 2001||AS||Assignment|
|Dec 21, 2004||FPAY||Fee payment|
Year of fee payment: 8
|Dec 18, 2008||FPAY||Fee payment|
Year of fee payment: 12