Microprocessor with self-diagnostic test function

Abstract: A microprocessor provided with a self-diagnostic test function is disclosed. The microprocessor comprises an input circuit for inputting at least a macro instruction and information necessary for self-diagnostic testing stored in an external memory; a decoder for decoding the inputted macro instruction; a micro instruction ROM for storing micro instructions; an incrementer for generating an incremented address by incrementing the address of the received address of the micro instruction ROM by 1; an external test mode setting circuit that inputs an incremented address and information necessary for self-diagnostic testing, outputs an incremented address when the microprocessor is operating in normal mode, and, in accordance with micro instructions outputted by the micro instruction ROM, outputs either an incremented address or information necessary for self-diagnostic testing when the microprocessor is operating in self-diagnostic testing mode; and a selector for selecting in accordance with micro instructions any one of the decoder output, an address of the micro instruction ROM designated by the micro instructions, or the output of the external test mode setting circuit. The microprocessor operates as an ALU when operating in normal mode, and when operating in self-diagnostic testing mode, provides data to diagnose whether or not it is defective.

Description: Background of the Invention Field of the Invention The present invention relates to a microprocessor of the microprogram-controlled type, and particularly to a self-diagnostic test for such a microprocessor. Description of the Related Art Semiconductor integrated circuits are produced in quantity on a single silicon wafer using photographic techniques. When structural defects occur in the wafer, however, transistors formed at the defective portions will not function, and a semiconductor integrated circuit incorporating such a transistor cannot be expected to function normally. At the present state of the art, structural defects will to a certain level of probability be included in a silicon wafer, and as a result, defective units will inevitably occur among manufactured semiconductor integrated circuits. In order to avoid shipping the above-described defective units, all manufactured semiconductor integrated circuits must be tested one by one before shipment to ensure that they operate normally. For this purpose, a testing circuit for semiconductor integrated circuits is employed in which test vectors are inputted at the input terminals of the semiconductor integrated circuit, and the output from the output terminals of the semiconductor integrated circuit is compared with previously prepared vectors of expected values. When test vectors are inputted to the input terminals of a normal semiconductor integrated circuit, the output from the output terminals will coincide with the expected vectors, and therefore, a semiconductor integrated circuit with output differing from the expected vectors is determined to be a defective article containing malfunctioning transistors. Should a malfunctioning transistor exist in any portion of a semiconductor integrated circuit, test vectors that do not call this transistor into play will not allow discovery of the defect. Therefore, in order that test vectors be effective, it is imperative that all of the semiconductor integrated circuits and logic without exception be caused to operate. Nevertheless, even should the vectors call a malfunctioning transistor into play, if the effect of the transistor does not arrive at the output terminals of the semiconductor integrated circuit, a difference from the expected vectors will not be noted and the failure of the transistor will not be detected. This type of problem is peculiar to the test vectors itself, and underlines the necessity of rating the quality of test vectors. One of the criteria of the quality of test vectors is the fault-coverage. The fault-coverage is an index of the ability to determine that an article is defective based on output differing from the expected vectors obtained after inputting test vectors to a semiconductor integrated circuit containing any defective transistor. The fault-coverage is measured by means of fault simulation. Fault simulation is carried out by intentionally causing the fault of an arbitrary transistor within a semiconductor integrated circuit in order to simulate a defective circuit and determining whether or not differences from the expected vectors occur at the output terminal. This investigation is conducted by repeatedly simulating faults at different points in the semiconductor integrated circuit. If the number of simulations carried out by causing faults is defined as number of sampled faults and the number of these faults producing output differing from the expected vectors is defined as the number of defected fault, the fault-coverage can be expressed as [number of defected faults / number of sampled faults]. Ideal test vectors would achieve a fault-coverage of 100% and would be capable of determining as defective a semiconductor integrated circuit having a malfunctioning transistor in any portion. Recently, however, the trend of semiconductor integrated circuits towards larger scale and greater complexity has resulted in dramatically greater numbers of incorporated transistors and extremely complex internal operations. Because there consequently are included many transistors that are called into play only under special conditions, the effect of these malfunctioning transistors will become apparent at the output of the semiconductor integrated circuit only in rare instances. With this type of semiconductor integrated circuit, producing test vectors with a fault-coverage of 100% is an extremely laborious process, and in addition, the resulting test vectors will include an unwieldy number of instructions and a test will require a great deal of time to carry out. Accordingly, for the purpose of easily detecting the existence of malfunctioning transistors within semiconductor integrated circuits containing transistors whose fault is extremely difficult to discover, it is common to provide semiconductor integrated circuits with an easily performed self-diagnostic test function. Currently, nearly all microprocessors composed of semiconductor integrated circuits employ a microprogram control method. In a microprogram control method, a sequence of instruction code (hereinafter referred to as micro instructions) is stored within an internal microprogram read memory (hereinafter referred to as MROM). The microprocessor reads the micro instructions in order by means of control circuits and delivers the instructions to an execute circuit. Practically, however, the control circuit, in place of the instruction code, reads the address of the MROM corresponding to the instructions and outputs to the execute circuit the sequence of instruction code beginning with this address. A block diagram illustrating the operation of this microprogram control method is presented in Figure 1. A microprocessor using a microprogram control method is provided with a micro instruction read memory (to be referred to as MROM) 13a, a first selector 8, a microprogram address register (MAR) 10, an incrementer 7, an instruction decoder 6, an align instruction register (AIR) 5, and logical circuits 4a, 4b, 4c, 4d, 4e, 4f. Macro instructions received by the microprocessor from the outside through an external terminal 1 are transferred to the instruction bus 14 through an input circuit 3 made up of a buffer register or an I/O and stored in the align instruction register 5. The results of computation carried out by logical circuits 4a-4f in accordance with the micro instructions stored in MROM 13a are then transmitted to the external circuit from output circuit 2. The instruction decoder (ID) 6 generates microprogram address S17 in order to read the micro instructions needed to perform the macro instruction. Microprogram address S17 is supplied to the address input of MROM 13a through the first selector 8. The incrementer 7 increments selector output signal S25 by 1, and then generates the next microprogram address (incremented address). The incremented address S21 is stored within the microprogram address register 10. MROM 13a receives selector signal S25 and outputs the corresponding micro instructions S19. These micro instructions S19 are composed of control signal S19b, which actually manipulates the data, and control signal S19a, which is directed to the first selector 8. The first selector 8 responds to selector control signal S16, which is a portion of control signal 19a, and selects any one of the following: the microprogram address indicated by output S21 of the microprogram address register 10, microprogram address S17 supplied from the instruction decoder 6, and address signal S18 which is one field of control signal S19a. If address signal S18 does not designate a microprogram address, the first selector 8, controlled by selector control signal S16, selects the output of the microprogram address register 10. Accordingly, the address input- of the MROM 13 becomes the succeeding microprogram address. In cases where address signal S18 designates a microprogram address, the micro instructions S19 corresponding to that address are read from MROM 13 and the microprocessor processes the data in accordance with control signal S19b contained within the micro instructions S19 and output S21 of the microprogram address register 10 is incremented by 1. This operation is iterated, and when address signal S18 is about to stop designating microprogram addresses, the first selector 8, under the control of selector control signal S16, selects output S21 of the microprogram address register 10, and the input of MROM 13a becomes microprogram address S21 created through incrementation. In this way, the micro instructions are successively processed. When the microprogram corresponding to the inputted macro instruction is completed, the first selector 8 selects microprogram address S17 provided by the instruction decoder 6, and begins processing the macro instruction supplied from the outside. The macro instruction is defined by a plurality of micro instructions and is realized by the ordered execution of the micro instructions. Since micro instructions are defined in much finer detail than a macro instruction, they can control the internal state of the microprocessor in ways that a macro instruction cannot and can control the operations of transistors that cannot be operated in normal operation. Consequently, self-diagnostic tests are widely carried out in microprocessors using these micro instructions. Figure 2 is an operation flow chart illustrating the operation of the blocks in Figure 1. First, the microprocessor is reset (step 41) and the minimum necessary initialization is carried out (step 42), after which the microprocessor begins normal operation. When a self-diagnosis instruction, which is applied as a macro instruction from external terminal 1, is stored in the align instruction register 5 by way of the input circuit 3 and the instruction bus 14, microprogram address 517 of a self-diagnosis microprogram is generated by means of the instruction decoder 6. This microprogram address S17 is selected by the first selector 8, delivered to MROM 13a which stores microprogram instructions, and a microprogram (MP) read from that address is executed (step 43). In other words, control signal S19b supplied from MROM 13 is transmitted to each portion of the microprocessor. The microprogram used in this micro self-diagnosis supplies the data built into the microprogram to logical circuit 4a made up of a register, a logical operation circuit, etc., which are the subjects of this microprocessor test, initiates the logical operation (step 44), and then compares the results with the expected value provided in the microprogram to determine whether or not they agree (step 45). If the values do not agree, the execution of the self-diagnostic instruction is interrupted at this point and the abnormality code is written to the diagnosis result register (DRR) in the microprocessor (step 46). The microprocessor then returns to normal operation. If the results of this comparison show agreement, the same test is performed on logical circuit 4b which is the subject of the next test (step 47). When the self-diagnostic instructions have been carried out, the normality code is written to the above-described diagnosis result register (step 48) and the microprocessor returns to normal operation. When the self-diagnosis macro instruction has been completed, the microprocessor transmits the contents of the diagnosis results register to a memory outside the microprocessor (step 49) and checks the results of the self diagnosis (step 40). This method allows testing of the signals within the microprocessor with virtually no need for adding special testing hardware and enables verification from the outside of the state of components which are extremely difficult to check during normal operating conditions. However, this self-diagnostic microprogram must be established in the design of the microprocessor, and consequently, when revising the microprogram to allow more detailed detection and a higher fault-coverage, it is necessary to modify the design of the microprogram provided in the microprocessor. As a result, the self-diagnostic microprogram may not be easily added to or modified. Next will be considered the microprocessor defect analysis. When the quality of a microprocessor has been judged as inferior, it is necessary to employ a semiconductor testing circuit by which various data are applied to the external terminal of the microprocessor, and based on the output produced by the microprocessor in performing a series of elementary operations or a series of micro steps designated by one or more test instructions, the defective point in the hardware is analyzed. In this analysis, however, there is no alternative to depending on the output of the microprocessor as a basis for investigating and making inferences, and this severely complicates the pinpointing of a faulty micro step causing the malfunctioning of the microprocessor. As a solution to this problem, there is the WCS (Writable Control Store) method in which the microprogram read memory is made into RAM to render the microprogram alterable. In this method, when control over a detailed operation of the interior of the microprocessor is desired, such as in defect analysis, it is possible to write a microprogram from the outside and execute it in order to allow the effective performance of defect analysis. The conventional microprocessors described above have problems which will be set forth below. Because it is generally very difficult to raise the fault-coverage, it is usual to incorporate into the microprocessor a circuit for judging the state of the microprocessor itself. In this case, test logic using a microprogram is employed in order that there be nearly no increase in the amount of hardware. However, even with this method, it is extremely difficult to create a microprogram for testing that will enable a superior fault-coverage rate and a speedy defect analysis. Fundamentally, it is preferable that a microprogram for testing be designed at the time the microprocessor itself is designed, but because the design of a good microprogram for testing is extremely time-consuming, it is the common practice to begin preparing and revising a microprogram for testing only after the microprocessor has been produced. However, revisions of a microprogram entail the necessary revision of the microprocessor hardware itself as well as the redesign of the microprocessor, at a considerable expense of time and labor. Further, since it is necessary in the conventional method to store the test data for testing the microprocessor in the MROM, the provision of sufficient data for testing leads to the problem of an unwieldy MROM. With regard to defect analysis of the microprocessor, since conventional testing methods only provide the results of a series of micro steps designated by one or more test instructions and not the result of an individual micro step, only the absence or existence of a defect can be determined. If an abnormality is discovered in an early test item among the test instructions, it will remain unknown whether the following tests provide correct results or not. In addition, there is the problem that for defects that cannot be discovered by tests based on the provided data, the tests serve no purpose. The testing method of making the microprogram read memory RAM and then writing and executing the testing microprogram from the outside allows effective execution of the defect analysis, but there is the problem that the necessity for hardware for writing to the microprogram read memory increases the amount of hardware. In addition, RAM takes more area on a substrate than ROM, increasing the area necessary for the microprocessor. In order to actually start a self-diagnostic test, there is also the problem of the time required to write all of the test microprograms before the self-diagnosis can begin. JP-A-03 005 835 (published 11.01.91) & US-5,226,149 (published 06.07.93) disclose a microprocessor having a test mode wherein a test instruction including an instruction for executing a diagnostic microprogram routine which tests each function block inside of the microprocessor and an instruction which makes data scan into various latches such as a latch at an output portion of a micro ROM for easily diagnosing each internal function block by independently operating them, and the latch at the output portion of the micro ROM is allocated an address and is constituted to be loaded in and to store the data from outside of the microprocessor. A diagnosing instruction is loaded from the outside of the microprocessor and the micro instruction of an address allocated to the latch is executed, thereby the cause of a fault in the microprocessor can be diagnosed. JP-A-60 049 442 discloses the use of a microprogram for normal processing also for diagnosis by providing a branch address register for diagnosis and a diagnosis mode switch bit in a microprogram controller. Summary of the Invention The purpose of the present invention is to provide a microprocessor provided with a self-diagnostic test function in which the process of revising the test items and test data can be carried out easily without need of altering the microprocessor hardware, and in which an acceleration of defect analysis and a reduction of the test time are realized by the provision in advance of the optimum test items and test data. In order to achieve the above-described purpose, there is provided a microprocessor as defined in independent claim 1. The dependent claims define particular embodiments of the invention. It is preferable that the information necessary for the self-diagnostic test be information corresponding to the test items and the data necessary for testing the test items, stored in the source address of the external memory. The above and other objects, features, and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate an example of a preferred embodiment of the present invention. Brief Description of the Drawings Figure 1 is a block diagram of an example of a microprocessor of the prior art; Figure 2 is an operation flow chart illustrating a self-diagnostic test that uses the blocks of Figure 1; Figure 3 is a block diagram of an embodiment of the present invention; Figure 4 shows the contents of an external memory for the purpose of illustrating the self-diagnostic test of the apparatus shown in Figure 3; and Figure 5 is an operation flow chart illustrating the self-diagnostic test of the apparatus shown in Figure 3. Detailed Description of the Preferred Embodiment An example of a preferred embodiment of the present invention will next be described in conjunction with the figures. Figure 3 is a block diagram of an embodiment of the present invention. Figure 4 shows the contents of an external memory for the purpose of illustrating the self-diagnostic test of the apparatus of Figure 3. One difference between the microprocessor of the present embodiment and the microprocessor shown in Figure 1 is that for each particular self-diagnostic test, test items, data (test data) used in the test, and operation results for the self-diagnostic test are stored in an external memory such as the one shown in Figure 4. Another difference is that an external test mode setting unit (ETMSU) 16 is provided so that, when operating in test mode, the microprocessor may execute self-diagnostic testing in accordance with the micro instructions stored in the micro instruction read only memory (MROM) 13 using the data and test items stored in the external memory. In this way, when operating in test mode, the microprocessor introduces test items and test data from the external memory. Consequently, while the input circuit 3 and data bus 15 of the present embodiment have the same hardware as shown in Figure 1, they receive different input. In addition, because the microprocessor writes the operation results of the self-diagnostic test to the external memory, although the hardware of the output circuit 2 of the present embodiment is identical with the output circuit of Figure 1, it receives different output control. Also, as will later be explained, control signal S19a of micro instruction S19 contains control signal S30 that designates a selector control circuit 17 provided within the external test mode setting unit 16. By means of the control of control signal S30, the data stored in the external memory can be introduced into the operation of the self-diagnostic test under the directions of the micro instructions. The external test mode setting unit 16 consists of a first register 11, a second selector 12, a second register 9, a selector control circuit 17, a mode selection signal generating circuit (MSSG) 19, and an external mode input terminal 18. The first register 11 is connected to the data bus 15 and holds the data transmitted from the external memory. The second selector 12 is connected to its two data inputs, the output of the first register 11 and the microprogram address register 10, and in response to selection signals S22a and S22b outputs one of these two data inputs to the first selector 8 through the second register 9. The external mode input terminal 18 is applied with a signal which become active when the test mode is in operation. Upon initiation of operation of the microprocessor, the mode selection signal generating circuit 19 is activated by micro instructions at the end of initialization of the internal state of the microprocessor, and when the input of external mode input terminal 18 is active, the mode selection signal generating circuit 19 activates mode selection signal S23 and informs the selector control circuit 17 that the present mode is the self-diagnostic test mode. In this case, when control signal S30 is active, the selector control circuit 17 activates selection signal S22b and connects the output of the first register 11 to the second register 9. When control signal S30 is inactive, the selector control circuit 17 activates selection signal S22a and connects microprogram address register output S21 to the second register 9. When operating in normal mode, the mode selection signal generating circuit 19 makes mode selection signal S23 inactive. In this way, the selector control circuit 17 activates selection signal S22a and connects microprogram address register output S21 to the second register 9. Figure 5 is an operation flow chart illustrating the self-diagnostic test of the apparatus of Figure 3. After resetting, the microprocessor of the present embodiment begins running, starting with the reset microprogram among its internal microprograms whereby the internal state of the microprocessor is first initialized (step 31). At the very end of this microprogram, the microprogram starts up the mode selection signal generating circuit 19 by micro instructions, activates mode selection signal S23 if the input of the external mode input terminal 18 is active, and informs the selector control circuit 17 that the present mode is the self-diagnosis test mode. If the input signal of the external mode input terminal 18 is inactive, normal operation is continued (step 32). When entering the self-diagnostic test mode, as shown in al of Figure 4, the micro processor generates a bus cycle and reads as a source address the contents 00000100 (hexadecimal) of the 00000000 (hexadecimal) address of the external memory connected to the microprocessor, following which it reads as a destination address the contents 00000200 of the 00000004 (hexadecimal) address (a2 of Figure 4, step 33 of Figure 5). Test command S1 stored in source address 00000100 (hexadecimal) is then read through external terminal 1 (a3 of Figure 4, step 34 of Figure 5). The hexadecimal code of this test command (daiag....add) indicates the address of MROM 13, where, in this embodiment, the microprogram is stored that causes the computing element inside the microprocessor to perform an addition operation. Test command S1 is stored in the first register 11 by way of external terminal 1, input circuit 3, and data bus 15, following which it is transferred to the second resister 9 through the second selector 12 and supplied to MROM 13 through the first selector 8 to cause the corresponding control to be executed. In this case, the output signal of the first selector 8 is incremented to the next microprogram address S21 by means of the incrementer 7, and by means of output signals S22a and S22b of the selector control circuit 17, the second selector 12 selects signal S21 delivered from the microprogram address register 10 and stores it in the second register 9. This operation is subsequently iterated. By means of this sequence of microprogram read-out control, data is read in order from source address 00000100 (a4-a6 of Figure 4, step 35 in Figure 5), and addition is performed of the two words of data S3 and S4, which are the contents of addresses 00000108 and 0000010C of Figure 4 (step 36 of Figure 5). The results are then written to the destination address 00000200 (a8 of Figure 2, step 37 of Figure 3). The contents S2 and S5 of Figure 4 are stop codes, and the operation is iterated until "0" is read out as the stop code (in this test instruction, any data other than "0" delivered from the memory 21 is an indication to continue the operation). If the stop code is "0", the operation is carried out once more before moving on to the next test instructions S6 of Figure 4 which activate the microprogram in the same manner and begin self-diagnosis (a7 of Figure 4, 38 of Figure 5). If the inputted self-diagnosis command is a stop command, the microprocessor returns to normal operation (39 of Figure 5). In this way, simply by arranging the test command and associated data followed by the stop command in the source address, the microprocessor reads the commands and data, carries out the test in accordance with the test command, and writes the results to the destination address. After completing self-diagnostic testing, the test of the internal states of the microprocessor can be carried out by comparing the results written to this destination address with the expected values (step 30 in Figure 5). A highly efficient defect analysis can be carried out by modifying in various ways the self-diagnosis command and the data which are arranged in the source address. Modifying the self-diagnosis command and the data can be quickly and easily achieved by writing to the RAM outside the microprocessor. Furthermore, in the present embodiment the subjects of the self-diagnostic test are logical circuits 4a-4f, but other circuits can also be tested in the same way, for example input circuit 3 or output circuit 2, which are connected to the internal data bus 15. As explained above, the microprocessor of the present invention is provided with an external test mode setting unit that can arbitrarily select normal mode operation or test mode operation, and when the test mode is selected, a self-diagnostic test for the test items stored in the external memory can be carried out in accordance with a microprogram using the test data stored in that memory. The test items or data stored in the external memory can be easily modified without any need to alter the microprocessor hardware, and in addition, because the microprogram is capable of controlling micro steps of the semiconductor integrated circuits, by appropriately selecting test items and data, the time needed for testing can be reduced, the fault-coverage at the time of shipment can be raised, and the number of shipped defective articles can be reduced. At the same time, when analyzing defects, because the most appropriate test items and data can be prepared beforehand for detecting these defects, the present invention also has the effect of enabling the realization of a higher-speed defect analysis. It is to be understood that although the characteristics and advantages of the present invention have been set forth in the foregoing description, the disclosure is illustrative only, and changes may be made in the arrangement of the parts without departing from the scope of the invention.

Claims: A microprocessor (20) provided with a self-diagnostic test function which is capable of operating in normal mode and in a test mode, comprising: input means (3) for receiving, in said normal mode, a normal instruction from the outside which commands the normal mode of operation and also receiving, in said test mode, test information including a test command and test data for self-diagnostic testing; decoder means (6) for decoding said normal command supplied from said input means; micro instruction ROM (13) for supplying a micro instruction in response to a supplied address; incrementing means (7) for incrementing said supplied address to said micro instruction ROM; said input means and said decoder means making up a first signal path to supply the normal instruction to said micro instruction ROM, and external test mode setting means (16) for setting the normal mode and the test mode in accordance with an external signal characterized by the external test mode setting means (16) being provided with a second signal path for transferring said test information from said input means to said micro instruction ROM (13), said external test mode setting means selecting one of the outputs of said second path and said incrementing means (7) as an output of said extemal test mode setting means (16) depending on both the mode of operation of the microprocessor and a control signal (S30) of a micro instruction delivered from said micro instruction ROM (13), first selector means for selectively connecting to said micro instruction ROM (13), one of the output of said decoder means, the output of said external test mode setting means (16) and an address, which designates a next microstep, described in said micro instruction delivered from said micro instruction ROM (13), in accordance with a selector control signal (S16) contained in said micro instruction (S19), an external memory which stores test information , and wherein when said external signal indicates said normal mode, said external test mode setting means (16) selects the output of said incrementing means (7); and when said external signal indicates said test mode, said external test mode setting means selects the output of said second signal path or the output of said incrementing means (7) in accordance with said control signal (S30), and said selector control signal (S16) controls the first selector means to allow the output of said extemal test mode setting means (16) to connect to said micro instruction ROM (13). A microprocessor as claimed in claim 1 wherein said external test mode setting means (16) comprises a mode selection signal generating means, second selector means, and selector control means (17); and wherein the mode selection signal generating means generates a mode selection signal, in response to said external signal, that takes a first state when the microprocessor (20) operates in the test mode and takes a second state when the microprocessor (20) operates in normal mode, the second selector means receives both the incremented address and said test information, and selects one of the input signals as the output of the extemal test mode setting means (16) in accordance with a selection signal, and the selector control means (17) receives said mode selection signal and said control signal (S30) and provides a selection signal to control said second selector means so that, when the microprocessor (29) is operated in said normal mode, the second selector means selects the incremented address, and, when the microprocessor is operated in said test mode, the second selector means selects either said test information, or the incremented address in accordance with said control signal (S30). The microprocessor as claimed in claim 1, wherein said test information further includes a stop code, wherein said test information and a stop command which causes the microprocessor to return to said normal mode are stored in source addresses of said external memory, and wherein a test result is written in a destination address of said external memory. The microprocessor as claimed in claim 2, wherein the micro instruction contains said control signal (S 30) and selector control signal (S 16).

Inventors: DAITO MASAYUKI, DAITO, MASAYUKI, Daito, Masayuki, c/o NEC Corporation
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1993
Main classification: G06F11
IPC codes: G06F11, G01R31