|Publication number||US4636945 A|
|Application number||US 06/506,195|
|Publication date||Jan 13, 1987|
|Filing date||Jun 20, 1983|
|Priority date||Jun 23, 1982|
|Publication number||06506195, 506195, US 4636945 A, US 4636945A, US-A-4636945, US4636945 A, US4636945A|
|Inventors||Koji Tanagawa, Isao Ohashi|
|Original Assignee||Oki Electric Industry Co., Ltd.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (1), Referenced by (13), Classifications (10), Legal Events (4)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This invention relates to a microprocessor including a checking circuit capable of testing in a short time a program stored in a semiconductor memory device to check whether the program must be debugged.
In order to efficiently utilize a computer it is essential to prepare suitable software, that is, a program. Even with the highly developed electronic technology presently in use today, it is difficult to automate the development of a program. Thus, it still it requires much time and labor to prepare a program.
The same is true for the development of software for use in a microcomputer fabricated with semiconductor integrated circuits. More particularly, since it requires much time for debugging a program, a long period is necessary for designing and manufacturing hardware, especially in the case of a microcomputer (including a microprocessor).
For efficiently debugging a program prepared for use in a microcomputer, after executing an instruction, it is necessary to read out and confirm the content of a register (including a memory device, flag, etc.) in a central processing unit (CPU). Moreover, in order to correctly execute the next instruction step, care should be taken not to change the internal state of the CPU such as a register, a program counter, an instruction register, etc., contained in the CPU during the checking.
Although there are many methods of checking a microcomputer program, according to a so-called single step method, the actual operation states of the hardware are sequentially checked at each step of an instruction. More particularly, according to this method, each time an instruction is executed, the operation of the CPU (i.e., microprocessor) is stopped and the contents of a memory device, an accumulator, various registers or the like contained in the CPU are displayed so as to check whether or not the contemplated program is operating correctly.
With this checking method, however, there is a defect in that the contents of only some of the registers can be confirmed external to the microprocessor. Although this difficulty can be overcome by providing exclusive input/output terminals connected to all of the registers in the microprocessor, this is not practical because of the limitations caused by the number of pins of a standardized package or the chip size.
Accordingly, it is an object of this invention to provide an improved microprocessor having a checking circuit capable of testing a program in a short time.
Another object of this invention is to provide an improved microprocessor capable of readily checking a program without an undue increase in the number of hardware elements.
Still another object of this invention is to provide a novel microprocessor in which the states of the internal circuits thereof are not caused to change during checking.
According to this invention there is provided a microprocessor comprising: a memory circuit for storing a program; a timing signal generator for generating a timing signal; a synchronizing circuit, which, in response to a checking signal for testing the program, produces a control signal which is synchronous with the timing signal; a program counter; a fist gate circuit for inhibiting an increment of said program counter in accordance with the control signal; an instruction register reset by said control signal; a register for storing data, and a second gate circuit for outputting the program stored in the memory device onto a bus line in accordance with the control circuit.
By adding suitable gate circuits, the contents of an accumulator, registers, etc., usually provided for a microcomputer, can also be checked.
In the accompanying drawings:
FIG. 1 is a block diagram showing one embodiment of the microprocessor according to this invention; and
FIG. 2 is a timing chart useful to explain the operation of the microprocessor shown in FIG. 1.
Referring now to FIG. 1, a 4 bit microcomputer is constituted by a microprocessor 1 generally made up of MOS transistors, and a read only memory device (ROM) 2 for storing a program.
The microprocessor 1 comprises a program counter (PC) 3, an instruction register (IR) 4, an instruction decoder (INST DEC) 5, a timing signal generator 6, a data memory device (RAM) 7, an accumulator (ACC) 8, a register (REG) 9, output gate circuits 10, 11 and 12, data bus lines 13 and AND gate circuits 14, 15 and 16. The microprocessor 1 further comprises a checking circuit including gate circuits 17, 18 and 19, a synchronizing circuit (SC) 20, and a gate circuit 21.
The output terminals of the program counter 3 are connected to the address input terminals of the ROM 2 via address signal output terminals 22 so as to designate instruction addresses of the ROM 2 in accordance with code signals outputted from the counter 3. The register 4 takes the form of an instruction register provided with a reset terminal R and its input terminals are connected to the instruction output terminals INST of the ROM 2 via instruction input terminals 23 so as to temporarily store instruction code signals outputted from ROM 2. The signal input terminals of the instruction decoder 5 are connected to the output terminals of the instruction register 4. Accordingly, the decoder 5 decodes instructions from the register 4 and then supplies control signals E'M, E'ACC, E'REG and (PC+1) (an increment signal) to respective gate circuits. In response to a clock signal CLK inputted to a reference clock signal input terminal 24, the timing signal generator 6 supplies various timing signals T01, T02, T03 and T04 to various circuit elements of the microprocessor 1. The bit lines of the data bus lines 13 are respectively connected to data bus output terminals 25 and to output terminals of output gate circuits 10, 11 and 12 respectively. The output terminals of the RAM 7 (data memory device) are selectively connected to the data bus lines 13 via output gate circuit 10. The output terminals of the accumulator 8 and of the register 9 are selectively connected to the bus lines 13 through output gate circuits 11 and 12 respectively. Three AND gate circuits 14, 15 and 16 respectively acting as control gate circuits output enable signals EM, EACC and EREG in accordance with control signals E'M, E'ACC and E'REG from the instruction register 5, which are in synchronism with timing signals T01, T02 and T03 generated by the timing signal generator 6. The signal input terminal of the synchronizing circuit 20 is connected to signal input terminal 26, while its signal output terminal is connected to the reset terminal R of the instruction register 4 for producing a control signal SD synchronous with the timing signal generated by the timing signal generator 6. To the signal terminal 26 is applied a checking signal for testing a program stored in the ROM 2.
Two input terminals of the AND gate circuit 21 are respectively connected to the increment signal output terminal of the instruction decoder 5 and the output terminal of the synchronizing circuit 20, while the output of the AND gate circuit 21 is supplied to the program counter 3. As a consequence, when the control signal SD is applied to one input terminal of the AND gate circuit 21 from the synchronizing circuit 20, it inhibits the increment signal (PC+1) from being supplied to the program counter 3. The gate circuit 17 is constituted by an AND gate circuit 27 and an OR gate circuit 28. The two input terminals of the AND gate circuit 27 are connected so as to receive a timing signal T01 generated by the timing signal generator 6 and the control signal SD produced by the synchronizing circuit 20. The input terminals of the OR gate circuit 28 are connected to the output terminals of AND gate circuits 14 and 27 respectively, while the output terminal of the OR gate circuit 28 is connected to the control terminals of the output gate circuit 10. The gate circuit 18 is constituted by an AND gate circuit 29 and an OR gate circuit 30. The two input terminals of the AND gate circuit 29 are supplied with the timing signal T02 generated by the timing signal generator 6 and the output of the synchronizing circuit 20 and the two input terminals of the OR gate circuit 30 are connected so as to receive the outputs of the AND gate circuits 15 and 29 respectively, while the output terminal of the OR gate circuit 30 is connected to the control terminals of the gate circuit 11. The gate circuit 19 is constituted by an AND gate circuit 31 and an OR gate circuit 32. The two input terminals of the AND gate circuit 31 are supplied with the timing signal T03 generated by the timing signal generator 6 and the output of the synchronizing circuit 20. The two input terminals of the OR gate circuit 32 are supplied with the output signals of the AND gate circuits 16 and 31, while the output of the OR gate circuit 32 is supplied to the control terminals of the output gate circuits 12.
The operation of the embodiment shown in FIG. 1 will now be described with reference to the timing chart shown in FIG. 2.
A reference clock signal CLK is applied to the reference clock signal input terminal 24 and the timing signal generator 6 produces timing signals T01 -T04 in the timing states T1 -T4 of respective operating cycles M1, M2, . . . .
When the checking signal SIN supplied to the signal terminal 26 is a logic "0", the microprocessor 1 operates normally as the microcomputer according to an instruction supplied from the ROM 2. More particularly, at the timing state T1 of the operating cycle M1 shown in FIG. 2, the instruction code from the ROM 2 is latched in the instruction register 4 and the instruction decoder 5 decodes the instruction code to select predetermined circuit elements of the microprocessor 1 for outputting their output data onto the data bus lines 13. For example, when the control signal E'M outputted by the instruction decoder 5 becomes a logic "1" (the waveform shown by dotted lines of the waveform E'M shown in FIG. 2), the enable signal EM outputted by the OR gate circuit 28 becomes a logic "1" to enable the output gate circuit 10 to read out the data stored in RAM 7 onto the data bus lines 13.
In the same manner, when the control signal E'ACC or E'REG produced by the instruction decoder 5 becomes a logic "1", the accumulator 8 or register 9 is selected and their contents are selectively outputted onto the data bus lines 13.
At state T4, since the instruction decoder 5 outputs the increment signal (PC+1), the content of the program counter 3 would be incremented by 1 for producing the next instruction from the ROM 2.
When an external checking signal SIN of a logic "1" level is applied to the signal terminal 26 during the operating cycle M2 as shown in FIG. 2, the operation is transferred to a mode of testing or checking the program stored in the ROM 2. While the checking signal is being inputted to the signal input terminal 26, the control signal SD outputted by the synchronizing circuit 20 becomes "1" with the result that the AND gate circuits 27, 29 and 31 successively change the outputs of the OR gate circuits 28, 30 and 32 to a logic "1" in synchronism with the respective timing signals generated by the timing signal generator 6. Consequently, the gate circuits 10, 11 and 12 will be successively enabled to sequentially read out the contents of RAM 7, accumulator 8 and the register 9 onto the data bus lines 13 so that the operating states of these elements can be checked by the outputs appearing at the output terminals 25 of the data bus lines 25.
Since the control signal SD outputted by the synchronizing circuit 20 resets the instruction register 4, a "no operation" instruction (NOP instruction) is executed regardless of an instruction outputted from ROM 2. The NOP instruction means an instruction for no operation so that the states in the processor do not change.
The gate circuit 21 produces a signal inhibiting the incrementing operation of the program counter 3 in accordance with the control signal SD outputted by the synchronizing circuit 20 and the increment signal (PC+1) outputted from the instruction decoder 5 so that the content of the program counter 3 would not be changed.
Consequently, the contents of the memory device, the register and the other elements of the microprocessor can be sequentially read out on the data bus output terminals.
To execute the next instruction, the checking signal applied to the signal terminal 26 is removed. Then, the synchronizing circuit 20 does not produce control signal SD so that the instruction from the ROM 2 is latched by the instruction register 4 and the increment signal (PC+1) from the instruction decoder 5 increments by one count the program counter 3, whereby the normal operation of the microprocessor 1 acting as a microcomputer is resumed for executing consecutive programs.
As above described, since the microprocessor of this invention is provided with a checking circuit the contents of the elements in the microprocessor are read out to the output terminals of the data bus lines thereby efficiently checking the program.
Furthermore, according to this invention the contents of the circuit elements are not changed during the checking operation; upon completion of one instruction, the next instruction can be at once be executed.
Moreover, as the output signals of various circuit elements are sequentially outputted to the data bus lines no special output terminal is needed for checking.
Although in the foregoing embodiment a microprocessor was used, it can be replaced by a single chip microcomputer.
According to this invention, since the program can be checked in a short time, the debugging operation can be made simply according to the result of the check, thus simplifying the design and application of a microcomputer.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4482953 *||May 23, 1983||Nov 13, 1984||Fairchild Camera & Instrument Corporation||Computer with console addressable PLA storing control microcode and microinstructions for self-test of internal registers and ALU|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US4905140 *||Sep 16, 1987||Feb 27, 1990||Hitachi, Ltd.||Semiconductor integrated circuit device|
|US4924382 *||Oct 5, 1988||May 8, 1990||Nec Corporation||Debugging microprocessor capable of switching between emulation and monitor without accessing stack area|
|US4969087 *||Nov 4, 1987||Nov 6, 1990||Oki Electric Industry Co., Ltd.||Single-chip microcomputer|
|US5047926 *||Mar 15, 1989||Sep 10, 1991||Acer Incorporated||Development and debug tool for microcomputers|
|US5051897 *||Dec 22, 1988||Sep 24, 1991||Mitsubishi Denki Kabushiki Kaisha||Single-chip microcomputer with memory patching capability|
|US5088027 *||Aug 27, 1990||Feb 11, 1992||Oki Electric Industry Co., Ltd.||Single-chip microcomputer|
|US5522082 *||Oct 23, 1992||May 28, 1996||Texas Instruments Incorporated||Graphics display processor, a graphics display system and a method of processing graphics data with control signals connected to a central processing unit and graphics circuits|
|US5564041 *||Feb 24, 1994||Oct 8, 1996||Hitachi, Ltd.||Microprocessor for inserting a bus cycle in an instruction set to output an internal information for an emulation|
|US5754827 *||Oct 13, 1995||May 19, 1998||Mentor Graphics Corporation||Method and apparatus for performing fully visible tracing of an emulation|
|US8108198||Feb 21, 2007||Jan 31, 2012||Mentor Graphics Corporation||Memory tracing in an emulation environment|
|US20080288719 *||Feb 21, 2007||Nov 20, 2008||Peer Schmitt||Memory Tracing in an Emulation Environment|
|EP0313848A2 *||Sep 29, 1988||May 3, 1989||Motorola Inc.||Data processor with development support features|
|EP0453268A2 *||Apr 17, 1991||Oct 23, 1991||Hitachi, Ltd.||A microprocessor for inserting a bus cycle to output an internal information for an emulation|
|U.S. Classification||713/601, 714/E11.214|
|International Classification||G06F15/78, G06F11/28, G06F11/36, G06F11/30|
|Cooperative Classification||G06F11/3632, G06F11/3648|
|European Classification||G06F11/36B4, G06F11/36B7|
|Jun 20, 1983||AS||Assignment|
Owner name: OKI ELECTRIC INDUSTRY CO., LTD. 7-12, TORANOMON 1-
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST.;ASSIGNORS:TANAGAWA, KOJI;OHASHI, ISAO;REEL/FRAME:004144/0314
Effective date: 19830605
|Jun 29, 1990||FPAY||Fee payment|
Year of fee payment: 4
|Jun 27, 1994||FPAY||Fee payment|
Year of fee payment: 8
|Jun 29, 1998||FPAY||Fee payment|
Year of fee payment: 12