Apparatus for generating test pattern for sequential logic circuit of integrated circuit and method thereof

Abstract: In an apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit wherein logical values of bits of the plurality of storage elements being represented by a state, first external input values are generated so that a transition process is performed from a second state of the plurality of storage elements to a first state thereof, and second external input values are generated so that a transition process is performed from a third state of the plurality of storage elements to the first state thereof. Thereafter, third external input values are generated so that a transition process is performed from a fourth state of the plurality of storage elements to the first state thereof. After setting the fourth state as the first state, name data of storage elements corresponding to bits of different states between the second and third states are stored in a storage unit. After setting the third state as the first state, there is increased a degree of requesting a scan operation for each of the storage elements, name data of which have been stored in the storage unit. Then, storage elements to be scanned are selected for generating an improved test pattern based on the degree of requesting the scan operation.

Description: References to other European Patent Applications: This European Patent Application is related to the European Patent Application No. EP-A-0 727 744, to the European Patent Application No. EP-A-0 730 233 and to the European Patent Application No. EP-A-0 509 440. BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for generating a test pattern and a method thereof, and an apparatus for generating a test pattern for a sequential logic circuit of an integrated circuit (referred to as an IC hereinafter) comprising a plurality of storage elements and a method thereof. 2. Description of the Prior Art Fig. 18 shows one flip-flop having a scan function used in a conventional IC. Referring to Fig. 18, the flip-flop comprises a delay type flip-flop element FF for storing a logical value of one bit and a selector SEL. When a control signal applied through an external terminal T3 to a selection control terminal CONT of the selector SEL has a low level or when a normal mode is set, a signal applied to a first input terminal T1 is passed through the selector SEL to the flip-flop element FF and is outputted therefrom through a first output terminal T11. On the other hand, when the control signal applied through the external terminal T3 to the selection control terminal CONT of the selector SEL has a high level or when a scan mode is set, a signal applied to a second input terminal T2 is passed through the selector SEL to the flip-flop element FF and is outputted therefrom through a second output terminal T12. Namely, when the flip-flop shown in Fig. 18 is converted into a scan flip-flop, the signal applied to the second input terminal T2 is passed through the selector SEL and the flip-flop element FF and is outputted through the second output terminal T12. Generally speaking, in a conventional IC, when a normal flip-flop is converted into a flip-flop having a so-called scan structure (referred to as a scan flip-flop hereinafter), the dimension of the IC increases since an extra dimension of the scan flip-flop is added to the original dimension thereof. Therefore, it is necessary to provide a method of selecting flip-flops to be converted into scan flip-flops so that a number of flip-flops to be converted thereto becomes a value as small as possible, or so that a higher fault coverage can be obtained. A conventional method of selecting flip-flops to be converted into scan flip-flops is disclosed in a reference (referred to as a first reference hereinafter) of Kwang-ting Cheng et al. "A Partial Scan Method for Sequential Circuits with Feedback", IEEE Transactions on Computers, Vol. 39, No. 4, pp.544 to 548, April 1990. The conventional method thereof will be described below with reference to Figs. 3, 15 and 16. Fig. 3 shows a partial circuit of a conventional IC. Referring to Fig. 3, the partial circuit of the IC comprises combinational partial circuits 301 and 302, delay type flip-flops (referred to as flip-flops hereinafter) 303, 304 and 305 connected between output terminals of the combinational partial circuit 301 and input terminals of the combinational partial circuit 302, and flip-flops 306, 307 and 308 connected between output terminals of the combinational partial circuit 302 and input terminals of the combinational partial circuit 301. Further, external input lines 310, 311 and 312 are connected to the other input terminals of the combinational partial circuit 301, and external output lines 313, 314 and 315 are connected to the other output terminals of the combinational partial circuit 302. Therefore, as is clear from Fig. 3, the partial circuit thereof has a feedback loop structure therein. Namely, in the partial circuit of the IC shown in Fig. 3, there are (a) a first loop where an output terminal of the flip-flop 303 is connected through the combinational partial circuit 302, the flip-flop 306 and the combinational partial circuit 301 to an input terminal of the flip-flop 303; (b) a second loop where an output terminal of the flip-flop 304 is connected through the combinational partial circuit 302, the flip-flop 307 and the combinational partial circuit 301 to an input terminal of the flip-flop 304; and (c) a third loop where an output terminal of the flip-flop 305 is connected through the combinational partial circuit 302, the flip-flop 308 and the combinational partial circuit 301 to an input terminal of the flip-flop 305. Fig. 15 is a flow chart of a test pattern generation process executed by a conventional test pattern generation apparatus. Referring to Fig. 15, first of all, at step 1602, there is analyzed a circuit structure of a sequential logic circuit of an IC to be tested, and then, it is judged whether or not there is a complicated or large feedback loop in the sequential logic circuit based on the connection relationship among the flip-flops. Thereafter, the flip-flops constituting the feedback loop are converted into scan flip-flops at step 1603, and then, a test pattern is generated at step 1604 for a partial circuit in which the flip-flops have been converted into the scan flip-flops at step 1603. When the test pattern generation process is executed for the partial circuit of the IC shown in Fig. 3, there are detected three loops of the above-mentioned first to third loops at step 1602, and then, it is judged that the flip-flops 303 to 305 constituting the loops respectively are to be scanned. Thereafter, the flip-flops 303 to 305 have been converted into scan flip-flops 1701 to 1703 at step 1603, as shown in Fig. 16. Finally, a test pattern is generated at step 1604 for a partial circuit in which the flip-flops 303 to 305 have been converted into the scan flip-flops 1701 to 1703 at step 1603. However, in the conventional test pattern generation apparatus, since the flip-flops which may have a possibility of a trouble which may be caused upon generating a test pattern are selected as the flip-flops to be scanned from only the circuit structure of the partial circuit, the operator can not judge whether or not all the selected flip-flops are necessary to be converted into the scan flip-flops upon generating the test pattern in practice. Therefore, since there are flip-flops which have no effect of improving the fault coverage upon generating the test pattern among the flip-flops which have scanned in the conventional apparatus, a number of the flip-flops to be scanned increases, and then, the above-mentioned extra dimension of the scanned flip-flops increases. Further, in the conventional apparatus, if the number of the scanned flip-flops is increased upon generating a test pattern, the test patterns which have been generated already become invalid. Therefore, the conventional test pattern generation apparatus can not be used in practice. The PROCEEDINGS OF THE INTERNATIONAL TEST CONFERENCE, NASHVILLE,US, Oct. 28-31, 1991, IEEE, pages 166-173, ABRAMOVICI M. ET AL: "THE BEST FLIP-FLOPS TO SCAN" discloses an algorithm for selecting the flip-flops of a sequential circuit to be used for partial-scan circuit testing so as to obtain a maximum fault coverage of a set of given stuck-at faults. The document EP-A-408 018 discloses a method and an apparatus for performing an Automated Test Pattern Generation (ATPG) for a digital circuit comprising a plurality of peripheral storage registers, whereby said peripheral storage registers can be individually selected for use in a scan chain. SUMMARY OF THE INVENTION An object of the present invention is therefore to provide an apparatus for generating a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, which is capable of decreasing a number of storage elements to be scanned and obtaining a higher fault coverage. Another object of the invention is to provide an apparatus capable of generating a new a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, after editing a test pattern when scan storage elements have been added to the original sequential logic circuit upon generating the test pattern. A further object of the invention is to provide an apparatus capable of newly generating a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, capable of decreasing the cost of the controllability of the IC. A still further object of the present invention is to provide a method of generating a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, which is capable of decreasing a number of storage elements to be scanned and obtaining a higher fault coverage. A still more further object of the invention is to provide a method capable of newly generating a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, after editing a test pattern when scan storage elements are newly added to the original sequential logic circuit upon generating the test pattern. Still another object of the invention is to provide a method capable of newly generating a test pattern for a sequential logic circuit of an IC comprising a plurality of storage elements, capable of decreasing the cost of the controllability of the IC. At least one of the aforementioned objects is attained by the present invention as defined in the appended claims. In order to achieve the aforementioned objective, according to one aspect of the present invention, there is provided an apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said apparatus comprising: first input value generating means for generating a combination of first external input values so that a transition process is performed from a second state of said plurality of storage elements to a first state thereof; first state generating means for generating a third state different from said second state by a predetermined natural number of bits; second input value generating means for generating a combination of second external input values so that a transition process is performed from a third state of said plurality of storage elements to said first state thereof; second state generating means for generating a fourth state other than said first to third states; third input value generating means for generating a combination of third external input values so that a transition process is performed from a fourth state of said plurality of storage elements to said first state thereof; first setting means for setting said fourth state as said first state; storage means for storing name data of storage elements corresponding to bits of different states between said second and third states; second setting means for setting said third state as said first state; scan request degree increasing means for increasing a degree of requesting a scan operation for each of said storage elements, name data of which have been stored in said storage means; scan storage element selecting means for selecting storage elements to be scanned based on said degree of requesting the scan operation; scan converting means for converting said storage elements selected by said scan storage element selecting means into scan storage elements; and test pattern generating means for generating a test pattern for said sequential logic circuit when said storage elements selected by said scan storage element selecting means are converted into scan storage elements by said scan converting means. According to another aspect of the present invention, there is provided an apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said apparatus comprising: input value generating means for generating a combination of external input values so that effects of a fault of said sequential logic circuit reach external output terminals thereof; storage element selecting means for selecting storage elements, the states of which are necessary to be changed in order that the effects of the fault of said sequential logic circuit reach said external output terminals thereof; storage means for storing said storage elements selected by said storage element selecting means; scan request degree increasing means for increasing a degree of requesting a scan operation for each of said storage elements, the name data of which have been stored in said storage means; scan storage element selecting means for selecting storage elements to be scanned based on said degree of requesting the scan operation; scan converting means for converting said storage elements selected by said scan storage element selecting means into scan storage elements; and test pattern generating means for generating a test pattern for said sequential logic circuit when said storage elements selected by said scan storage element selecting means are converted into scan storage elements by said scan converting means. According to a further aspect of the present invention, there is provided an apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements, comprising: calculating means for calculating each controllability of said sequential logic circuit when each of a plurality of storage elements is converted into a scan storage element; controllability selecting means for selecting the minimum controllability among the controllabilities calculated by said calculating means; storage element selecting means for selecting a storage element corresponding to the minimum controllability selected by said controllability selecting means; scan converting means for converting said storage elements selected by said storage element selecting means into scan storage elements; and test pattern generating means for generating a test pattern for said sequential logic circuit when said storage elements selected by said scan storage element selecting means are converted into scan storage elements by said scan converting means. According to a still further aspect of the present invention, there is provided an apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said apparatus comprising: fault selecting means for selecting a fault among a plurality of faults of said sequential logic circuit; first test pattern generating means for generating a first test pattern for said fault selected by said fault selecting means; state storage means for storing the states of said plurality of storage elements both when storage elements to be scanned are scanned-in and when said storage elements to be scanned are not scanned-in in the case that said test pattern is generated by said test pattern generating means; scan storage element selecting means for selecting a storage element to be scanned among said storage elements to be scanned in the case that said test pattern is generated by said test pattern generating means; scan converting means for converting said storage element selected by said storage element selecting means into scan storage elements; and second test pattern generating means for generating a second test pattern for said sequential logic circuit when said storage elements selected by said scan storage element selecting means are converted into scan storage elements by said scan converting means, based on said states thereof stored in said storage means. According to a still more further aspect of the present invention, there is provided a method of generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said method including steps of: generating a combination of first external input values so that a transition process is performed from a second state of said plurality of storage elements to a first state thereof; generating a third state different from said second state by a predetermined natural number of bits; generating a combination of second external input values so that a transition process is performed from a third state of said plurality of storage elements to said first state thereof; generating a fourth state other than said first to third states; generating a combination of third external input values so that a transition process is performed from a fourth state of said plurality of storage elements to said first state thereof; setting said fourth state as said first state; storing in storage means name data of storage elements corresponding to bits of different states between said second and third states; setting said third state as said first state; increasing a degree of requesting a scan operation for each of said storage elements, name data of which have been stored in said storage means; selecting storage elements to be scanned based on said degree of requesting the scan operation; converting said selected storage elements into scan storage elements; and generating a test pattern for said sequential logic circuit when said selected storage elements are converted into scan storage elements. BRIEF DESCRIPTION OF THE DRAWINGS These and other objects and features of the present invention will become clear from the following description taken in conjunction with the preferred embodiments thereof with reference to the accompanying drawings throughout which like parts are designated by like reference numerals, and in which: Fig. 1 is a flow chart of a main routine executed by a test pattern generation apparatus of a first preferred embodiment according to the present invention; Figs. 2a and 2b are flow charts of a test pattern generation process of a subroutine step 103 shown in Fig. 1; Fig. 3 is a schematic block diagram of a partial sequential logic circuit of a first example of a conventional IC; Figs. 4a to 4g are state transition diagrams showing internal states in the conventional IC; Fig. 5 is a schematic block diagram of the partial sequential logic circuit of the first example of the IC shown in Fig. 3 when a flip-flop 306 is converted into a scan flip-flop 501; Fig. 6 is a state transition diagram showing internal states of the IC shown in Fig. 5; Fig. 7a and 7b are flow charts of a test pattern generation process of a modified preferred embodiment of the subroutine step 103 shown in Fig. 1; Fig. 8 is a schematic block diagram of a partial sequential logic circuit of a second example of an IC; Figs. 9a to 9e are schematic block diagrams of the second example of the IC showing changes in the states of circuit shown in Fig. 8; Fig. 10 is a flow chart of a main routine executed by a test pattern generation apparatus of a second preferred embodiment according to the present invention; Fig. 11 is a flow chart of a scan flip-flop selection process of a subroutine executed by a test pattern generation apparatus of a third preferred embodiment according to the present invention; Fig. 12 is a schematic block diagram of a test pattern generation apparatus of a fourth preferred embodiment according to the present invention; Fig. 13 is a flow chart of a main routine executed by the test pattern generation apparatus of the fourth preferred embodiment; Figs. 14a to 14c are schematic block diagram of partial sequential logic circuits showing a test pattern generation process executed by the test pattern generation apparatus of the fourth preferred embodiment; Fig. 15 is a flow chart of a main routine executed by a conventional test pattern generation apparatus; Fig. 16 is a schematic block diagram of a partial sequential logic circuit of an IC showing a test generating process executed by the conventional test pattern generation apparatus; Fig. 17 is a schematic block diagram showing a test pattern generation apparatus of the first preferred embodiment shown in Fig. 1; and Fig. 18 is a schematic block diagram showing one delay type flip-flop having a scan function used in the conventional device and the devices of the preferred embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The preferred embodiments according to the present invention will be described below with reference to the attached drawings. In the specification, a cost required for testing a sequential circuit of an IC is referred to as a cost of a testability, and the cost of the testability includes a cost of a controllability for generating a test pattern required for setting logical values of signal lines within a sequential circuit to desired values, and a cost of an observability for generating a test pattern required for observing logical values of signal lines within the sequential circuit at external output terminals, etc.. In the preferred embodiments, there will be described below cases where the cost of the testability includes only the cost of the controllability. Further, in the preferred embodiments, sequential logic circuits of ICs comprise combinational partial circuits and a plurality of delay type flip-flops each flip-flop storing a logical value of one bit, wherein logical values of bits of a plurality of flip-flops are represented by a state, for example, as shown in state transition diagrams of Figs. 4a to 4g and 6. First Preferred Embodiment Fig. 17 shows a test pattern generation apparatus of a first preferred embodiment according to the present invention. Referring to Fig. 17, a micro processor unit (MPU) 2 is connected to a key board 1 for inputting circuit information of a sequential logic circuit of an IC to be tested, a storage unit 5 and a signal generator 6. The micro processor unit 2 comprises not only means 3 for analyzing the circuit information inputted using the key board 1 and storing circuit connection information, data of a testability and intermediate data caused upon the above-mentioned analysis, but also means 4 for generating a test pattern for the sequential logic circuit of the IC to be tested based on the circuit connection information, the data of the testability, and the intermediate data and outputting them to the signal generator 6. Finally, the signal generator 6 generates electric signals of the test pattern in a predetermined available form and outputs them to the sequential logic circuit of the IC to be tested. Fig. 1 is a flow chart of a main routine executed by the test pattern generation apparatus of the first preferred embodiment shown in Fig. 17. Referring to Fig. 1, first of all, there is made at step 102 a fault list including all the flip-flops in fault states within the sequential logic circuit of the IC to be tested, and then, there is executed at step 103 a test pattern generation process of a subroutine at step 103 shown in Figs. 2a and 2b. Namely, at step 103, there are generated test patterns for the respective faults specified in the fault list, respectively, electric signals of the test patterns are applied from the signal generator 6 to the sequential logic circuit, and then, a fault coverage is detected. Thereafter, it is judged at step 104 whether or not the detected fault coverage is larger than a predetermined threshold fault coverage Rth of, for example, 95 %. If the detected fault coverage is larger than the predetermined threshold fault coverage Rth (YES at step 104), the test pattern which has been finally generated at step 103 is set as the test pattern to be used for the sequential logic circuit, and then, the main routine for generating the test pattern generation is completed. On the other hand, if the detected fault coverage is equal to or smaller than the predetermined threshold fault coverage Rth (No at step 104), the program flow goes to step 105. At step 105, there is executed a scan flip-flop selection process of a subroutine. Namely, there is selected one flip-flop having the maximum controllability among one or more flip flips having the maximum scan request degree, wherein the scan request degree represents a degree in which a flip-flop is to be converted into a scan flip-flop or to be scanned. Thereafter, the flip-flop selected at step 105 is converted into a scan flip-flop at step 106, and then, there is made an undetected fault list including flip-flops, faults of which have not been detected at step 107. Thereafter, the program flow goes back to step 103, and then, there is generated a test pattern for the flip-flops, faults of which have not been detected at step 107. Figs. 2a and 2b are flow charts of the test pattern generation process of the subroutine step 103 shown in Fig. 1. In Figs. 2a and 2b, A denotes a first state, B denotes a second state into which the first state A is transferred, SI denotes an initial state, SO denotes a final state, SI' denotes a state different from the initial state SI by one bit, and C denotes a state completely different from the initial state SI, the final state SO and the state SI'. Referring to Fig. 2a, first of all, it is judged at step 202 whether or not there is any undetected fault. If there is no undetected fault (NO at step 202), the program flow returns to the main routine. On the other hand, if there are one or more undetected faults (YES at step 202), there is selected one undetected fault at step 203, and then, there is executed a fault propagation process at step 204 so that effects of the selected fault can be propagated into external output terminals. Thereafter, it is judged at step 204A whether or not the fault propagation process is completed or the effects of the selected fault have been propagated into the external output terminals. If the fault propagation process is not completed (NO at step 204A), the program flow goes back to step 202. On the other hand, the fault propagation process is completed (YES at step 204A), the program flow goes to step 205. At step 205, the final state SO is set to the first state A, and the initial state SI is set to the second state B. Thereafter, referring to Fig. 2b, the program flow goes to step 206, and then, the first state A is justified using the second state B (= the initial state SI), namely, a combination of external input values or an external test pattern is generated so that a transition process is executed from the second state B (= the initial state SI) to the first state A. Further, it is judged at step 206A whether or not the transition process of step 206 is completed. If the transition process of step 206 is completed (YES at step 206A), the program flow goes back to step 202. On the other hand, if the transition process of step 206 is not completed (NO at step 206A), the program flow goes to step 207. At step 207, the first state A is justified using the second state B (= the state SI'). Namely, there is generated the state SI' different from the initial state SI by one bit, the state SI' is set to the second state B, and then, a combination of external input values or an external test pattern is generated so that a transition process is executed from the second state B (= the state SI') to the first state A. Then, it is judged at step 207A whether or not the process of step 207 is completed. If the process of step 207 is not completed (NO at step 207A), the program flow goes to step 210. On the other hand, if the process of step 207 is completed (YES at step 207A), the program flow goes to step 208, and then, a process is executed for recording in the storage unit 5 name data of flip-flops corresponding to bits of different states between the state SI' and the initial state SI. After completion of the process of step 208, the state SI' different from the initial state SI by one bit is set to the first state A at step 209, and then, the program flow goes back to step 206. At step 210, there is generated the third state C completely different from the initial state SI, the final state SO and the state SI', and then, a combination of external input values or an external test pattern is generated so that a transition process is executed from the state C to the first state A. Namely, a process is executed for justifying the first state A using the state C. Thereafter, it is judged at step 210A whether or not the process of step 210 is completed. If the process of step 210 is completed (YES at step 210A), the state C is set to the first state A at step 211, and then, the program flow goes back to step 206. On the other hand, if the process of step 210 is not completed (NO at step 210A), the program flow goes to step 212. As described above, the process of steps 204 to 211 is performed for one fault selected at step 203. In the process of step 204, there is a test pattern required for transferring the effects of the fault to the external output terminals. Further, in the process of steps 206 and 210, there is generated another test pattern required for transition from a state to another state, and then, if the process of step 206 is completed (YES at step 206A), there is generated the test pattern for the one fault at selected at step 203, and then, the process of step 202 is performed. Then, the test pattern obtained by connecting the test patterns generated at step 204, 206 and 210 becomes a test pattern for the one fault selected at step 203. It is to be noted that, when the processing time of the subroutine shown in Figs. 2a and 2b is larger than a predetermined limit time, an interruption process (not shown) is executed, and then, the program flow goes to step 212. At step 212, one is added to the scan request degree of the flip-flop which has been finally recorded at step 208, and then, the program flow goes back to step 202 of Fig. 2a. Figs. 4a to 4g are state transition diagrams showing internal storage states in the conventional IC. In Figs. 4a to 4g, numerals within ellipses 401 to 409 represent logical states or logical output values of the flip-flops 303 to 308, for example, the initial state SI of 101101 represents that the states of the flip-flops 303 to 308 are 1, 0, 1, 1, 0 and 1, respectively. In Figs. 4a to 4g, 401 denotes the initial state SI prior to inputting of signals of a test pattern, 409 denotes an internal state of the flip-flops 303 to 308 after transition by applying signals of the test pattern to the external input terminals, and 408 denotes the final state SO when the fault propagation of step 204 has been completed. Fig. 5 shows the partial sequential logic circuit of the first example of the IC shown in Fig. 3 when the flip-flop 306 is converted into a scan flip-flop 501. Fig. 6 is a state transition diagram showing internal states of the IC shown in Fig. 5. In Fig. 6, numerals within ellipses of 401 to 408 represent states of the flip-flops 303, 304, 305, 501, 307 and 308. Further, 401 denotes the initial state SI prior to inputting of the signals of the test pattern, 402 to 407 denote internal states of the flip-flops 303, 304, 305, 501, 307 and 308 after transition by applying signals of the test pattern to the external input terminals, and 408 denotes the final state SO when the fault propagation of step 204 has been completed. An example of an action of the test pattern generation apparatus shown in Fig. 1 will be described below with reference to Figs. 1 to 6 and 17. Referring to Fig. 1, first of all, there is made at step 102 a fault list including all the flip-flops in fault states within the sequential logic circuit of the IC to be tested, and then, there is executed at step 103 the test pattern generation process of the subroutine at step 103 shown in Figs. 2a and 2b. Referring to Fig. 2a, first of the subroutine, it is judged at step 202 whether or not there is any undetected fault. If there is no undetected fault (NO at step 202), the test pattern generation process is finished, and then, the program flow returns to the main routine. On the other hand, if there are one or more undetected faults (YES at step 202), there is selected one undetected fault at step 203, and then, there is executed a fault propagation process at step 204 so that effects of the selected fault can be propagated into external output terminals. Thereafter, it is judged at step 204A whether or not the fault propagation process is completed or the effects of the selected fault have been propagated into the external output terminals. If the fault propagation process is not completed (NO at step 204A), the program flow goes back to step 202. On the other hand, the fault propagation process is completed (YES at step 204A), the program flow goes to step 205. At step 205, the final state SO is set to the first state A, and the initial state SI is set to the second state B. Thereafter, steps 206 to 211 shown in Fig. 2b include a process for generating a test pattern for transition from the initial state 401 prior to inputting of the signals of the test pattern to the final state 408 which is obtained at step 204. Referring to Fig. 2b, at step 206, a combination of external input values or an external test pattern is generated so that a transition process is executed from the initial state 401 to the final state 408 as shown in Fig. 4a. Further, it is judged at step 206A whether or not the transition process of step 206 is completed. If the transition process of step 206 is completed (YES at step 206A), the program flow goes back to step 202. On the other hand, if the transition process of step 206 is not completed (NO at step 206A), the program flow goes to step 207. Now, in the case of assuming that the transition process of step 206 shown in Fig. 4a is not completed (NO at step 206A), the program flow goes to step 207, and then, there are generated a combination of external input values or an external test pattern so that a transition process is executed from the state 409 different from the initial state 401 by one bit to the final state 408, as shown in Fig. 4b. At step 207, the process thereof is repeatedly performed with all the states different from the initial state 401 by one bit until the process of step 207 is completed. If the process of step 207 is not completed (NO at step 207A), the program flow goes to step 210. At step 210, as shown in Fig. 4c, a state C, 407 completely different from the initial state 401, the final state 408 and the state SI' which is different from the initial state 401 by one bit is set to the second state B, and then, a combination of external input values or an external test pattern is generated so that a transition process is executed from the state C, 407 to the final state 408. The process of step 210 is repeatedly performed with respect to all the states 407 which can be selected as the second state B until the process thereof is completed. If the process of step 210 is completed (YES at step 210A), the program flow goes to step 206. At step 206, as shown in Fig. 4d, there are generated a combination of external input values so that a transition process is performed from the initial state 401 to the first state 407. If the process of step 206 is not completed (NO at step 206A), the program flow goes to step 207, and then, there are generated external input values so that a transition process is performed from the state 406 different from the initial state 401 by one bit to the final state 407. On the other hand, if the process of step 206 is completed (YES at step 206A), the program flow goes to step 208, and then, there is recorded name data of the flip-flop 305 corresponding to a bit of a different state between the initial state 401 and the state 406. Further, after the process of steps 206 to 211 is repeatedly performed, there are obtained a combination of external input values for a transition from the state 403 to the state 404 and also another transition from the state 402 to the state 403. Thereafter, when the state 402 is set to the current state and all the processes of steps 206, 207 and 210 are not completed resulting in stopping generating the test pattern, the program flow goes to step 212, and then, one is added to the scan request degree of the flip-flop 306 finally recorded at the process of step 208. The reason why the scan request degree of the flip-flop 306 finally recorded at the process of step 208 is increased is as follows. If the process of step 210 is not completed resulting in stopping generating the test pattern, there are two flip-flops 305 and 306 as flip-flops recorded at the process of step 208. If the flip-flop 305 is converted into a scan flip-flop, a state transition can be performed in an order from the initial state 401 through the states 406 and 407 to the state final state 408, and then, a test pattern can be generated. On the other hand, if the flip-flop 306 is converted into a scan flip-flop, a state transition can be easily performed in an order from the initial state 401 through the states 404, 405, 406 and 407 to the final state 408, and then, a test pattern can be generated. Therefore, in order to detect a fault due to which the process of step 210 is not completed, it is necessary to convert either one of the flip-flops 305 and 306 into a scan flip-flop. However, as is clear from Fig. 4g, in the case that there is another fault detected at the state 410 and a transition can be easily performed from the state 405 to the state 410, if the flip-flop 306 is converted into a scan flip-flop, a state transition can be performed in an order from the state 401 through the states 404 and 405 to the state 410. However, it is difficult to perform a state transition directly from the state 401 to the state 410 even though the flip-flop 305 is converted into a scan flip-flop, and the difficulty of the test can not be further lowered. Accordingly, in the case that the process of step 210 is not completed resulting in stopping generating the test pattern, there is advantageously used a method of increasing the scan request degree of the flip-flop finally recorded at step 208 other than a method of increasing the scan request degree of any flip-flop recorded at step 208. Referring back to Fig. 2a, when it is judged that there is no undetected fault (NO at step 202), the process for generating the test pattern is completed, and then, the program flow goes back to step 104 of the main routine shown in Fig. 1. Then, it is judged at step 104 whether or not the detected fault coverage is larger than the predetermined threshold fault coverage Rth. In the present preferred embodiment, the fault coverage is preferably set to a value larger than the fault coverage of the conventional apparatus. If the detected fault coverage is equal to or smaller than the predetermined threshold fault coverage Rth (No at step 104), the program flow goes to step 105, and then, there is executed the scan flip-flop selection process of the subroutine. Namely, there is selected one flip-flop having the maximum controllability among one or more flip flips having the maximum scan request degree. The reason why there is selected one flip-flop having the maximum controllability among one or more flip flips having the maximum scan request degree is as follows. Since it is more difficult to set the flip-flop to a desired value generally as the controllability becomes larger, the controllability of the sequential logic circuit of the IC can be remarkably improved or lowered by converting the flip-flop having the relatively large controllability into a scan flip-flop. Now, in this case, when the scan request degrees of the flip-flops 303 to 308 are 0, 1, 4, 9, 0 and 9 respectively and the controllability of the flip-flops 303 to 308 stored in the storage unit 5 after calculating them by means 3 shown in Fig. 17 are 112, 423, 3982, 1306, 45 and 1196 respectively, the flip-flop 306 is selected at step 105. Thereafter, the one flip-flop selected at step 105 is converted into a scan flip-flop at step 106. Fig. 5 shows the partial circuit of the sequential logic circuit of the IC when the flip-flop 306 has been converted into the scan flip-flop 501. Thereafter, there is made an undetected fault list including flip-flops, faults of which have not been detected at step 107, and then, there is generated at step 103 a test pattern for the sequential logic circuit shown in Fig. 5 wherein the flip-flop 306 is converted into the scan flip-flop 501 based on the undetected fault list. Thereafter, the program flow goes to step 104 of the main routine shown in Fig. 1. If the detected fault coverage is larger than the predetermined threshold fault coverage Rth (YES at step 104), the test pattern which has been finally generated at step 103 is set as the test pattern to be used for the sequential logic circuit, and then, the main routine for generating the test pattern generation is completed. Furthermore, the signal generator 6 generates and outputs to the sequential logic circuit of the IC to be tested, signals of the test pattern generated by the above-mentioned process in a form suitable for the sequential logic circuit to be applied. It is to be noted that Fig. 6 shows a transition of the internal state of the sequential logic circuit shown in Fig. 5 when a fault shown in Fig. 4 is caused. Table 1 shows a result of a simulation of the conventional test pattern generation apparatus, and Table 2 a result of a simulation of the test pattern generation apparatus of the first preferred embodiment, which were performed by the present inventors. Circuits s400, s713 and s5378 used in the simulations are benchmark circuits described in a second reference of F. Brglez et al., "Combinational Profiles of Sequential Benchmark Circuit", Proceeding International Symposium Circuit and Systems, pp.1929 to 1934, May 1989. As is clear from comparison between Tables 1 and 2, in the test pattern generation apparatus, there can be obtained the fault coverages larger than those of the conventional apparatus with numbers of scan flip-flops smaller than those of the conventional apparatus. In the first preferred embodiment, an example in the case of converting one flip-flop into a scan flip-flop is described above. However, the present invention is not limited to this, two or more flip-flops may be selected, and then, they may be converted into scan flip-flops. Further, in the first preferred embodiment, at step 207, the state different from the initial state by one bit is justified. However, the present invention is not limited to this. A state different from the initial state by two or more bits may be justified. Fig. 7a and 7b are flow charts of a test pattern generation process of a subroutine step 103a of a modified first preferred embodiment of the subroutine step 103 shown in Fig. 1. Referring to Fig. 7a, first of all, it is judged at step 702 whether or not there is any undetected fault. If there is no undetected fault (NO at step 702), the program flow returns to the main routine. On the other hand, if there are one or more undetected fault (YES at step 702), there is selected one undetected fault at step 703, and then, there are caused effects of the selected undetected fault at step 704. Then, it is judged at step 704A whether or not the process of step 704 is completed. If the process of step 704 is not completed (NO at step 704A), the program flow goes back to step 702. On the other hand, if the process of step 704 is completed (YES at step 704A), the program flow goes to step 705 of Fig. 7b. Referring to Fig. 7b, there is generated at step 705 a combination of external input values or an external test pattern so that effects of the selected fault are made to reach the external output terminals in the current circuit state. Then, it is judged at step 705A whether or not the process of step 705 is completed. If the process of step 705 is completed (YES at step 705A), the program flow goes back to step 702. On the other hand, if the process of step 705 is not completed (NO at step 705A), the program flow goes to step 706. At step 706, it is judged whether or not effects of the fault can be detected when one flip-flop is converted into a scan flip-flop in the current circuit state. If the effects of the fault can be detected (YES at step 707), the flip-flop obtained by the process of step 707 is recorded in the storage unit 5, and then, the program flow goes to step 708. On the other hand, if the effects of the fault can not be detected (NO at step 707), there are generated at step 708 external input values or an external test pattern so that the effects of the fault reach at least one flip-flop in the current circuit state. Thereafter, if the process of step 708 is completed (YES at step 708A), the flip-flop which the effects of the fault has reached at step 708 is recorded in the storage unit 5 at step 709, the current circuit state is updated into a new circuit state based on the result obtained by the process of step 708, and then, the program flow goes back to step 705. On the other hand, if the process of step 708A is not completed (NO at step 708A), one is added to the scan request degree of the flip-flop first recorded at steps 707 and 709, and then, the program flow goes back to step 702. Fig. 8 shows a partial sequential logic circuit of a second example of an IC. Referring to Fig. 8, the partial sequential logic circuit comprises a combinational partial circuit 801 and four flip-flops 806 to 809 respectively connected between output terminals and input terminals of the combinational partial circuit 801. In Fig. 8, 810 denotes a fault caused in the combinational partial circuit 801. Figs. 9a to 9e are schematic block diagrams of the second example of the IC showing changes in the circuit state thereof. In Figs. 9d and 9e, (D) denotes an effect of a fault. An example of the test pattern generation process of a modified first preferred embodiment will be described with reference to Fig. 7a, 7b, 8 and 9a to 9e. Referring to Fig. 7a, at first of the test pattern generation process of the subroutine step 103a, it is judged at step 702 whether or not there is any unprocessed fault. If there is no unprocessed fault (NO at step 702), the program flow returns to the main routine. On the other hand, if there are one or more unprocessed fault (YES at step 702), there is selected one unprocessed fault at step 703, and then, there is caused effects of the selected unprocessed fault at step 704. Then, if the process of step 704 is not completed (NO at step 704A), the program flow goes back to step 702. On the other hand, if the process of step 704 is completed (YES at step 704A), the program flow goes to step 705 of Fig. 7b. Now, in the case that the process of step 704 is completed resulting in a circuit state shown in Fig. 9a, referring to Fig. 7b, there is generated at step 705 a combination of external input values or an external test pattern so that effects of the selected fault are made to reach the external output terminals in the current circuit state. If the process of step 705 is completed (YES at step 705A), the program flow goes back to step 702. On the other hand, if the process of step 705 is not completed (NO at step 705A), the program flow goes to step 706. Now, in the case that there are no external input values on the input signal lines 802 and 803 (No at step 705A) so that the effects of the fault 810 has reached the external output terminals in the circuit state shown in Fig. 9a, it is judged at step 706 whether or not the effect of the fault 810 has reached the external output terminals by changing the state of one flip-flop among the flip-flops 806 to 809. Now, in this example, if the state of the flip-flop 808 is changed from zero to one as shown in Fig. 9b, it is judged at step 706 that effects (D) of the fault 810 has reached the external output terminal 804 when the external input values of the input signal lines 802 and 803 are one and zero, respectively. Namely, if YES at step 706, the flip-flop 808 is recorded at step 707, and then, there is generated at step 708 a combination of external input values or an external test pattern so that the effects (D) of fault 810 can reach at least one flip-flop. Now, in case of assuming that, as shown in Fig. 9c, the effects (D) of the fault 810 have reached the flip-flop 806 when the external input values on the external signal input lines 802 and 803 are 1 and 1, respectively, the flip-flop 806 is recorded at step 709, and then, the circuit state shown in Fig. 8 is shown in Fig. 9d after the process of step 708, which is referred as a current state. Subsequently, when the process of step 705 is not completed (NO at step 705A), the state of the flip-flop 809 is changed from one to zero as shown in Fig. 9e, and then, it is judged at step 706 that the effects (D) of the fault 810 have reached the external output terminal 805 when the external input values on the signal lines 802 and 803 are zero and one, respectively. Thereafter, the flip-flop 809 is recorded at step 707. Now, in this example, in a case of assuming that the effects (D) of the fault 810 have not reached all the flip-flops at step 708, then the program flow goes to step 711. At step 711, one is added to the scan request degree of the flip-flop 808 first recorded among the flip-flops 806, 808 and 809 recorded at steps 707 and 709. If there is no unprocessed fault (NO at step 702), the subroutine step 103a is completed, and then, the program flow goes to step 104 of the main routine shown in Fig. 1. In the modified first preferred embodiment, the process of steps 704 to 711 is executed for one fault selected at step 703. The process of step 704 is provided for generating the test pattern required for causing the effects of the selected fault, the test pattern required for making the effects of the fault reach at least one among the external output terminals at step 705, and the test pattern is generated which is required for making the effects of the fault reach at least one flip-flop in the sequential logic circuit. If the process of step 705 is completed (YES at step 705A), the test pattern generation for the one fault selected at step 703 is completed, and then, the program flow goes to step 702. Then, the test pattern obtained by connecting the test patterns generated at steps 704, 705 and 708 becomes a test pattern for the one fault selected at step 703. Referring back to Fig. 1, it is judged at step 104 of Fig. 1 whether or not the detected fault coverage is larger than the predetermined threshold fault coverage Rth. If the detected fault coverage is equal to or smaller than the predetermined threshold fault coverage Rth (No at step 104), the program flow goes to step 105, and then, there is executed the scan flip-flop selection process of the subroutine. Namely, there is selected one flip-flop having the maximum controllability among one or more flip flips having the maximum scan request degree. Now, in this example, when the scan request degrees of the flip-flops 806 to 809 are 1, 6, 2 and 6 respectively and the controllabilities of the flip-flops 806 to 809 stored in the storage unit 5 are 323, 112, 24 and 811 respectively, the flip-flop 809 is selected at step 105. In the modified first preferred embodiment, the selected flip-flop is a flip-flop to be certainly scanned in the test pattern generation process, which is different from that in the convention apparatus. When the selected flip-flop is converted into scan flip-flop and the test pattern is generated, the fault coverage can be certainly improved, resulting in removing any useless scan flip-flop. Thereafter, the process of steps 106, 107, 103 and 104 is executed in a manner similar to that of the first preferred embodiment. Second Preferred embodiment Fig. 10 is a flow chart of a main routine executed by a test pattern generation apparatus of a second preferred embodiment according to the present invention. Referring to Fig. 10, first of all, a predetermined completion conditions are set at step 1002, and it is judged at step 1003 whether or not there is an unprocessed flip-flop other than the scan flip-flops. If there are one or more unprocessed flip-flops (YES at step 1003), there is selected one unprocessed flip-flop at step 1004, and then, there is calculated at step 1005 a controllability of all the flip-flops within the sequential logic circuit on assumption that the selected flip-flop is converted into a scan flip-flop. Thereafter, the program flow goes to step 1003. On the other hand, if there is no unprocessed flip-flop (NO at step 1003), there is selected at step 1006 one flip-flop and the selected one flip-flop is converted into a scan flip-flop. Thereafter, it is judged at step 1007 whether or not the predetermined completion conditions set at step 1002 are satisfied. If the predetermined completion conditions are not satisfied (NO at step 1007), the program flow goes to step 1003. On the other hand, if the predetermined completion conditions are satisfied (YES at step 1007), the program flow goes to step 1008, and then, a test pattern is generated. Then, the test pattern process of the main routine of the second preferred embodiment is completed. An example of an action of the test pattern generation apparatus of the second preferred embodiment will be described below with reference to Fig. 10. Referring to Fig. 10, first of all, the predetermined completion conditions set at step 1002. The predetermined completion conditions may include a predetermined upper threshold value of the fault coverage and a predetermined threshold number of an upper limit of scan flip-flops. Namely, one of the predetermined completion conditions may be that the fault coverage is larger than a predetermined value, and another one thereof may be that the number of the scan flip-flops is larger than a predetermined value. In the present preferred embodiment, the threshold number of the upper limit of the scan flip-flops is set to three. Thereafter, it is judged at step 1003 whether or not there is an unprocessed flip-flop other than the scan flip-flops. Now, in this example, there are the flip-flops 806 to 809 in the sequential logic circuit shown in Fig. 8, and they are unprocessed flip-flops. Therefore, the program flow goes to step 1004, one flip-flop is selected among the processed flip-flops 806 to 809. Now, in this example, in case of assuming that, for example, the flip-flop 806 is selected, there is calculated at step 1005 a sum of the controllabilities of all the flip-flops 807 to 809 other than the scan flip-flops within the sequential logic circuit on assumption that the selected flip-flop 806 has been converted into a scan flip-flop. In this example, the sum of the controllabilities thereof is 3122. Thereafter, the program flow goes to step 1003, it is judged whether or not there are one or more unprocessed flip-flops. Now, the flip-flops 807 to 809 have not been processed, and then, for example, the flip-flop 807 is selected at step 1004. Thereafter, there is calculated at step 1005 a sum of the controllabilities of all the other flip-flops 806, 808 and 809 other than the unprocessed flip-flop 807, and it is assumed that the sum of the controllabilities thereof is 2068, in this example. The process of steps 1003 to 1005 is repeatedly performed for the flip-flops 808 and 809, in a manner similar to that of above. Now, it is assumed that the sums of the controllabilities calculated at step 1005 are 1063 and 2760, respectively. Thereafter, since there is no unprocessed flip-flop in the circuit at step 1003 (NO at step 1003), the program flow goes to step 1006. One of the reasons why the test pattern generation for a fault is not completed is that it is difficult to control logical values on the signal lines within the circuit. In order to solve such a problem, it is necessary to find out, in particular, the flip-flop which can improve the controllability of the flip-flops, and then, the found-out flip-flop is converted into a scan flip-flop. In this case, the logical values of the non-scan flip-flops can be easily controlled with a relatively small number of scan flip-flops, resulting in improvement in the fault coverage or lowering the fault coverage. Therefore, there is selected one flip-flop having the minimum controllability among the flip-flops having the controllability calculated at step 1005. In the case that only one flip-flop is converted into a scan flip-flop among the flip-flops 806 to 809, the sums of the controllabilities of the other flip-flops are 3022, 2068, 1063 and 2760, respectively. Therefore, in this case, the flip-flop 808 is converted into a scan flip-flop, and then, the program flow goes to step 1007. It is judged at step 1007 whether or not the number of the scan flip-flops is equal to or larger than a predetermined set value. However, now, there is only one scan flip-flop (No at step 1007). Therefore, the program flow goes to step 1003. Since there are unprocessed flip-flops 806, 807 and 809 other than the scan flip-flops, the flip-flop 806 is selected at step 1004. Thereafter, at step 1005, there is calculated a sum of the controllabilities of all the flip-flops 807 and 809 other than the scan flip-flop, and then, it is assumed in this example that the sum thereof is 968. Thereafter, the process of step 1003 to 1005 is performed for each of the flip-flop 807 and 809 in a manner similar to that of above, and then, it is assumed in this example that the sums of the controllabilities are 1901 and 1103, respectively, at step 1005. Since the sums of the controllabilities of the other flip-flops when either one of the flip-flops 806, 807 and 809 is converted into a scan flip-flop are 968, 1901 and 1103, respectively, the flip-flop 806 is converted into a scan flip-flop at step 1106. At step 1007, there two scan flip-flops and the number of the scan flip-flops is not equal to or larger than the predetermined set value of three (NO at step 1007). Therefore, the program flow goes to step 1003, and then, the process of steps 1003 to 1006 is performed in a manner similar to that of above. Then, the flip-flop 809 is selected and is converted into a scan flip-flop at step 1006. Thereafter, there are three flip-flops at step 1007, and the number of the scan flip-flops is equal to or larger than the predetermined set value of three (YES at step 1007). Accordingly, the program flow goes to step 1008, and then, a test pattern is generated. Then, the main routine of the test pattern generation is completed. Table 3 shows a result of a simulation performed by the present inventor, and the circuits s400 and s713 used in the simulation are the benchmark circuits described in the above-mentioned second reference. As is clear from comparison between Table 3 ot the second preferred embodiment and Table 1 of the conventional apparatus, there can be obtained in the second preferred embodiment fault coverages equal to or larger than those of the conventional apparatus with numbers of the scan flip-flops smaller than those of the conventional apparatus. Third Preferred embodiment Fig. 11 is a flow chart of a flip-flop selection process of a subroutine step 105a executed by a test pattern generation apparatus of a third preferred embodiment according to the present invention. Namely, the flip-flop selection process of step 105 is a modified process of step 105 of the first preferred embodiment shown in Fig. 1. The other processes are the same as those shown in Fig. 1. Referring to Fig. 11, first of all, there is made a list of flip-flops each having the maximum scan request degree at step 1102, and then, it is judged at step 1103 whether or not the number Nff of the flip-flops within the made list is larger than one. If Nff = 1 (NO at step 1103), the program flow goes to step 1107, and then, there is selected one flip-flop among the made list so that the sum of the controllabilities of the whole circuit is the smallest when the selected one flip-flop is a scan flip-flop. Thereafter, the program flow goes back to the main routine. On the other hand, if Nff > 1 (YES at step 1103), it is judged at step 1104 whether or not there are one or more unprocessed flip-flops within the made list. If there is at least one unprocessed flip-flop within the list (YES at step 1104), there is selected one unprocessed flip-flop at step 1105, and then, there is calculated at step 1106 the sum of the controllabilities of the respective flip-flops in the circuit when the selected one flip-flop is converted into a scan flip-flop. Thereafter, the program flow goes back to step 1104. On the other hand, if there is no unprocessed flip-flop within the list (NO at step 1104), the program flow goes to step 1107. An example of an action of the third preferred embodiment will be described below with reference to Fig. 11. Referring to Fig. 11, first of all, there is made a list of flip-flops having the maximum scan request degree based on the information of the scan request degrees of the respective flip-flops which have been obtained by the test pattern generation process of step 103 shown in Fig. 1. Now, in this example, in case of assuming that the scan request degrees of the respective flip-flops 303 to 308 are 0, 1, 4, 9, 0 and 9, respectively, the list made at step 1102 includes the flip-flops 306 and 308 each having the maximum scan request degree of nine. Thereafter, it is judged at step 1103 whether or not the number Nff of the flip-flops within the made list is larger than one. In this example, since Nff > 1, the program flow goes to step 1104, and then, it is judged at step 1104 whether or not there are one or more unprocessed flip-flops within the made list. In this example, there are two unprocessed flip-flops 306 and 308. Therefore, there is selected one flip-flops 306 among the flip-flops 306 and 308 at step 1105, and then, there is calculated at step 1106 the sum of the controllabilities of the respective flip-flops in the circuit when the selected flip-flop 306 is converted into a scan flip-flop resulting in the sum thereof of 1812. Thereafter, the program flow goes back to step 1104, and then, it is judged whether or not there is at least one unprocessed flip-flop within the list. In this example, since there is the unprocessed flip-flop 308 (YES at step 1104), there is selected the flip-flops 308 at step 1105, and then, there is calculated at step 1106 the sum of the controllabilities of the respective flip-flops in the circuit when the selected flip-flop 308 is converted into a scan flip-flop resulting in the sum thereof of 3127. Thereafter, the program flow goes back to step 1104, and then, it is judged whether or not there is at least one unprocessed flip-flop within the list. In this example, since there is no unprocessed flip-flop (NO at step 1104), the program flow goes to step 1107. There is selected the one flip-flop 306 among the flip-flops 306 and 308 within the made list since the sum of the controllabilities of the whole circuit is the smallest when the selected one flip-flop 306 is a scan flip-flop. Namely, when the flip-flop 306 is converted into a scan flip-flop, the controllability of the whole circuit can be improved the most or can be lowered the most. Thereafter, the program flow goes back to step 104 of the main routine, and then, the process shown in Fig. 1 is performed in a manner similar to that of the first preferred embodiment. The features of the third preferred embodiment are to include the process of step 1107. The reason why there is provided the process of step 1107 in the scan flip-flop selection process of the subroutine step 105a is as follows. An object of all the preferred embodiments according to the present invention which are described in the specification is to decrease or improve the cost of the controllability of the IC. Generally speaking, when a flip-flop having the maximum controllability is converted into a scan flip-flop, the cost of the controllability thereof can not be always improved the most. When a flip-flop is converted into a scan flip-flop even though the cost of the controllability of the flip-flop itself is not so large, there is a possibility of improving or decreasing the cost of the controllability of the whole circuit of the IC. Therefore, when there are a plurality of flip-flops to be scanned, execution of the process of the scan flip-flop selection shown in Fig. 11 can contribute to improvement or decrease in the cost of the controllability of the IC. Table 4 shows a result of a simulation performed by the present inventor, and the circuits s400 and s713 used in the simulation are the benchmark circuits described in the above-mentioned second reference. As is clear from comparison between Table 4 of the third preferred embodiment and Table 1 of the conventional apparatus, there can be obtained in the second preferred embodiment fault coverages equal to or larger than those of the conventional apparatus with numbers of the scan flip-flops smaller than those of the conventional apparatus. Further, as is clear from comparison between Table 4 of the third preferred embodiment and Table 2 of the first preferred embodiment, there can be obtained in the third preferred embodiment fault coverages at least equal to or larger than those of the first preferred embodiment. Furthermore, as is clear from comparison between Table 4 of the third preferred embodiment and Table 3 of the second preferred embodiment, there can be obtained in the third preferred embodiment the same fault coverages as those of the second preferred embodiment with numbers of the scan flip-flops smaller than those of the second preferred embodiment. Therefore, the present preferred embodiment can obtained the most improved performance among the first to third preferred embodiment and the prior art. It is to be noted that the subroutine step 105a of the third preferred embodiment may be applied to the first preferred embodiment. Fourth Preferred embodiment Fig. 12 is a schematic block diagram of a test pattern generation apparatus of a fourth preferred embodiment according to the present invention, and Fig. 12 corresponds to means 4 for generating the test pattern of the first preferred embodiment shown in Fig. 17. Referring to Fig. 12, the test pattern generation apparatus comprises a test pattern generator 1201, a storage unit 1202 for storing data of the test pattern generated by the test pattern generator 1201 in a normal mode, a storage unit 1203 for storing data of statuses of the respective flip-flops while the test pattern is generated by the test pattern generator 1201, a test pattern editor 1204 for editing and generating a test pattern including a test pattern in a scan mode based on the test pattern in the normal mode stored in the storage unit 1202 and the statuses of the respective flip-flops stored in the storage unit 1203, and a storage unit 1205 for storing data of the test pattern in the scan mode generated by the test pattern editor 1204. Fig. 13 is a flow chart of a main routine executed by the test pattern generation apparatus of the fourth preferred embodiment. Referring to Fig. 13, first of all, there is set predetermined completion conditions at step 1312. In the present preferred embodiment, the completion conditions may include a condition of an upper limit of flip-flops to be scanned. The predetermined completion conditions include a predetermined upper threshold of the fault coverage and a predetermined threshold number of an upper limit of scan flip-flops. Namely, one of the predetermined completion conditions may be that the fault coverage is larger than a predetermined value, and another one of the predetermined completion conditions may be that the number of the scan flip-flops is larger than a predetermined value. Thereafter, it is judged at step 1313 whether or there is any unprocessed fault within the circuit. If there is at least one unprocessed fault (YES at step 1313), the program flow goes to step 1314, and then, one unprocessed fault is selected and a test pattern is generated with respect to the selected unprocessed fault. Thereafter, there are recorded at step 1315 both the statuses or both the stored logical values of the flip-flops to be scanned within the circuit when the flip-flops are scanned-in and scanned-out, namely, the flip-flops are set in the above-mentioned scan mode and in the above-mentioned normal mode. Then, the program flow foes back to step 1313. On the other hand, if there is no unprocessed fault (NO at step 1313), it is judged at step 1316 whether or not the predetermined completion conditions set at step 1323 are satisfied. If NO at step 1316, there is selected one flip-flop and the selected flip-flop is converted into a scan flip-flop at step 1317, and then, the program flow goes back to step 1313. On the other hand, if YES at step 1316, a test pattern is generated at step 1318 based on the statuses of the flip-flops in the normal mode and in the scan mode stored in the storage units 1202 and 1203, and then, the test pattern generation process of the fourth preferred embodiment is completed. Figs. 14a to 14c are schematic block diagram of partial sequential logic circuits showing the test pattern generation process executed by the test pattern generation apparatus of the fourth preferred embodiment. Fig. 14a shows a state of the sequential logic circuit when the flip-flop 807 into a scan flip-flop 1403 while the test patter generation process is being executed for the sequential logic circuit shown in Fig. 8, Fig. 14b shows a state of the sequential logic circuit at the next stage, and Fig. 14c shows a state of the sequential logic circuit when the flip-flop 808 is further converted into a scan flip-flop 1404 after conversion into the scan flip-flop 1403. Table 5 shows states of the respective flip-flops at a timing prior to the scan operation and at another timing after the scan operation, and Table 6 shows external test input values or an external test pattern generated at step 1317. In Table 6, MS denotes a signal value on a mode selection signal line. In Figs. 14a to 14c and Table 6, 1401 denotes a scan-in signal line, 1402 denotes a scan-out signal line, 802 and 803 denote external input signal lines, and 804 and 805 denote external output signal lines. An example of an action of the test pattern process executed for the sequential logic circuit shown in Fig. 8 by the apparatus of the fourth preferred embodiment will be described below with reference to Figs. 13 and 14a to 14c. Referring to Fig. 13, first of all, there is set the predetermined completion conditions at step 1312. In the present preferred embodiment, the completion conditions include a condition of an upper limit of flip-flops to be scanned. The process of steps 1313 to 1315 is provided for generating a test pattern. First of all, it is judged at step 1313 whether or there is any unprocessed fault within the circuit shown in Fig. 8. If there is at least one unprocessed fault (YES at step 1313), the program flow goes to step 1314, and then, one unprocessed fault is selected and a test pattern is generated with respect to the selected unprocessed fault. Thereafter, the program flow goes to step 1315, and then, when the scan-in and the scan-out are requested for the scan flip-flop, there are recorded in the storage unit 1203 both the states of all the flip-flops including the scan flip-flops at a timing prior to the scan operation or the operation in the scan mode and at another timing after the scan operation. Since the states of non-scan flip-flops do not change, the same logical values are recorded as both the states of the non-flip-flops at a timing prior to the scan operation and at another timing after the scan operation. In this example, since there is no scan flip-flop in the circuit shown in Fig. 8, the program flow goes to step 1313. The process of steps 1313 to 1315 is performed again, and if there is no unprocessed fault (NO at step 1313), the program flow goes to step 1316, and then, it is judged whether or not the predetermined completion conditions are satisfied. In this case, since there is no scan flip-flop (NO at step 1316), the program flow goes to step 1317. At step 1317, one flip-flop is selected and the selected flip-flop is converted into a scan flip-flop. In this example, the flip-flop 807 is selected and is converted into the scan flip-flop 1403. Thereafter, the process of steps 1313 to 1315 is performed again the sequential logic circuit shown in Fig. 14a. At step 1315, there are recorded in the storage unit 1203 both the states of the flip-flop 1403 to be scanned in the normal mode and in the scan mode, and further, there are recorded in the storage unit 1203 both the states of the non-scan flip-flops 806, 808 and 809 in the normal mode and in the scan mode. In this example, when the scan flip-flop 1403 is scanned-in or is set in the scan mode so that the state thereof changes from zero to one at a timing t i , the states of the other non-scan flip-flops 806, 808 and 809 are 0, 0 and 1, respectively. In this case, when the state of the scan flip-flop 1403 is set to one by the scan operation or setting it to the scan mode, a signal of a state of zero of the scan flip-flop prior to the scan operation is outputted through the scan-out signal line 1402, Then, both the states of the scan flip-flop 1403 including a state of zero at a timing prior to the scan operation and a state of one at another timing after the scan operation are recorded in the storage unit 1203. On the other hand, at a timing prior to the scan operation, the states of the non-scan flip-flops 806, 808 and 809 are 0, 0 and 1, respectively, and they do not change between a timing prior to the scan operation and another timing after the scan operation. Similarly, the process of steps 1313 to 1315 is performed again, and when there becomes no unprocessed fault (No at step 1313), the program flow goes to step 1316. Then, the completion conditions are judged. In this case, since there is one scan flip-flop (NO at step 1316), the program flow goes to step 1317, and then, the flip-flop 808 is converted into the scan flip-flop 1404, as shown in Fig. 14a. Further, the process of steps 1313 to 1315 is performed again for the sequential logic circuit shown in Fig. 14b. In this case, at step 1314, both of the states of the scan flip-flops 1403 and 1404 are requested from 0 and 0 to 1 and 1, respectively, at a timing t j . Thereafter, at step 1315, there are recorded in the storage unit 1203 states of 0, 0, 0 and 1 at a timing prior to the scan operation and states of 0, 1, 1 and 1 at another timing after the scan operation of all the flip-flops 806, 1403, 1404 and 809 including the scan flip-flops 1403 and 1404. Similarly, the process of steps 1313 to 1315 is performed again, and when there becomes no unprocessed fault, the program flow goes to step 1316. Then, the completion conditions are judged at step 1312. In this case, since there is two scan flip-flops 1403 and 1404 (No at step 1316), the program flow goes to step 1317, and then, the flip-flop 809 is converted into the scan flip-flop 1405 as shown in Fig. 14c. Further, the process of steps 1313 to 1315 is performed again for the sequential logic circuit shown in Fig. 14c. In this case, at step 1314, the states of the scan flip-flops 1403, 1404 and 1405 are requested from 1, 1 and 0 to 0, 0 and 1, respectively. Thereafter, at step 1315, there are recorded in the storage unit 1203 both of states of 1, 1, 1 and 0 at a timing prior to the scan operation and states of 1, 0, 0 and 1 at another timing after the scan operation of all the flip-flops 806, 1403, 1404 and 1405 including the scan flip-flops 1403, 1404 and 1405. Similarly, the process of steps 1313 to 1315 is performed again, and when there becomes no unprocessed fault, the program flow goes to step 1316. Then, the completion conditions are judged at step 1312. In this case, since there is three scan flip-flops, the program flow goes to step 1318 since the predetermined completion conditions have been satisfied (YES at step 1316), and then, the program flow goes to step 1318. At step 1318, a test pattern in the scan operation is generated based on the states of the respective flip-flops at timings prior to and after the scan operation which have been recorded in the storage unit 1203, which are shown in Table 5. In Table 5, (p, q, r, s) represents (the state of the flip-flop 806, the state of the flip-flop 1403, the state of the flip-flop 808 or 1404, the state of the flip-flop 809 or 1405). In this example, there is the three scan flip-flops 1403 to 1405, wherein they are connected in an order of the scan-in signal line 1401 → the scan flip-flop 1403 → the scan flip-flop 1404 → the scan flip-flop 1405 → the scan-out signal line 1402. At the timing t i , there is only one scan flip-flop 1403, however, the scan flip-flops 1404 and 1405 are connected thereto, finally. Therefore, upon performing the scan operation, it is necessary to make not only the scan flip-flop 1403 operate but also the scan flip-flops 1404 and 1405 operate simultaneously. Therefore, the signal of the state at the timing t i of the scan flip-flop 1403 is inputted in the scan mode or is scanned-in to the scan flip-flop 1403, and also the signals of the states of 0 and 1 at the timing t i of the flip-flops 808 and 809 are scanned-in to the scan flip-flops 1404 and 1405, respectively. Further, from the scan-out signal line 1402, the signals of both of the states of the flip-flops 809 and 808 at the timing t i shown in Table 5 and the state of the scan flip-flop 1403 at a timing prior to the scan operation are outputted sequentially in an order of time. The generated test pattern is written in the storage unit 1205, the contents of which include that the signals of the states to be set in the scan flip-flops 1405, 1404 and 1403 are scanned-in sequentially in an order of time from the scan-in signal line 1401, as shown in the timings t i to t i+4 of Table 6. Further, from the scan-out signal line 1402, the signals of the states of the scan flip-flops 1405, 1404 and 1403 prior to the scan operation are outputted sequentially in an order of time. Similarly, there are the scan flip-flops 1403 and 1404 at the timing t j , however, the scan flip-flop 1405 is connected thereto, finally. Therefore, it is necessary to scan-in the signals of the states after the scan operation at the timing t j to the scan flip-flops 1403 and 1404, respectively, and also to scan-in the signals of the states of the flip-flop 809 at the timing t j to the scan flip-flop 1405. As the test pattern, the signals of the states to be set in the scan flip-flops 1405, 1404 and 1403 are scanned-in sequentially in an order of time from the scan-in signal line 1401, as shown in the timings t j to t j+4 of Table 6. On the other hand, from the scan-out signal line 1402, the signals of the states of the scan flip-flops 1405, 1404 and 1403 prior to the scan operation are outputted sequentially in an order of time. Since all the scan flip-flops are determined at the timing t k , the signals of the states after the scan operation at the timing t k are scanned-in to the scan flip-flops 1403, 1404 and 1405, respectively. As the test pattern, the signals of the states to be set in the scan flip-flops 1405, 1404 and 1403 are scanned-in from the scan-in signal line 1401 sequentially in an order of time, as shown in the timings t k to t k+4 of Table 6. On the other hand, the signals of the states of the scan flip-flops 1405, 1404 and 1403 prior to the scan operation are outputted sequentially in an order of time from the scan-out signal line 1402. According to the fourth preferred embodiment, when a scan flip-flop is requested to be scanned-in and scanned-out at a timing for a process of the test pattern generation, there are recorded a state of the scan flip-flop requested to be scanned-in and scanned-out, and the states of all the other flip-flops at the same timing, and then, a test pattern in the scan operation is generated based on the states of the respective flip-flops recorded in the storage unit 1203 after the test pattern generation is completed. Therefore, even though a scan flip-flop is added thereto while the process of the test pattern generation is being performed, the test pattern can be generated with respect to the sequential logic circuit including the added scan flip-flop. Other preferred embodiments In the preferred embodiments, sequential logic circuits of ICs comprise combinational partial circuits and delay type flip-flops. However, the present invention is not limited to this. The sequential logic circuits of the ICs may comprise the other type storage elements such as J-K type flip-flops, T type flip-flops or the like. Although the present invention has been fully described in connection with the preferred embodiments thereof with reference to the accompanying drawings, it is to be noted that various changes and modifications are apparent to those skilled in the art. Such changes and modifications are to be understood as included within the scope of the present invention as defined by the appended claims unless they depart therefrom. Prior to Scan operation After Scan operation Timing t i ( 0, 0, 0, 1) (0, 1, 0, 1) Timing t j ( 0, 0, 0, 1) (0, 1, 1, 1) Timing t k ( 1, 1, 1, 0) (1, 0, 0, 1) Timing (MS,1401,1402) (802,803,804,805) t 0 ( 0, - , - ) ( 0, 0, 1, 0) t 1 ( 0, - , - ) ( 1, 1, 0, 0) ..... ...... t i ( 1, - , - ) t i+1 ( 1, 1, 1) t i+2 ( 1, 0, 0) t i+3 ( 1, 1, 0) t i+4 ( 0, - , - ) ..... ...... t j ( 1, - , - ) t j+1 ( 1, 1, 1) t j+2 ( 1, 1, 0) t j+3 ( 1, 1, 0) t j+4 ( 0, - , - ) ..... ...... t k ( 1, - , - ) t k+1 ( 1, 1, 0) t k+2 ( 1, 0, 1) t k+3 ( 1, 0, 1) t k+4 ( 0, - , - ) ..... ......

Claims: An apparatus for generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said apparatus comprising: input value generating means (4, 703-705) for generating a combination of external input values so that effects of a fault of said sequential logic circuit reach external output terminals thereof; characterized in further comprising: storage element selecting means (4, 706-707) for selecting storage elements, the states of which are necessary to be changed in order that the effects of the fault of said sequential logic circuit reach said external output terminals thereof; storage means (5, 707) for storing said storage elements selected by said storage element selecting means (4, 706-707); scan request degree increasing means (4, 711) for increasing a degree of requesting a scan operation for each of said storage elements, the name data of which have been stored in said storage means (5, 707); scan storage element selecting means (4, 105) for selecting storage elements to be scanned based on said degree of requesting the scan operation; scan converting means (4, 106) for converting said storage elements selected by said scan storage element selecting means (4, 105) into scan storage elements; and test pattern generating means (4, 107) for generating a test pattern for said sequential logic circuit when said storage elements selected by said scan storage element selecting means (4, 105) are converted into scan storage elements by said scan converting means (4, 106). The apparatus as claimed in Claim 1, wherein said input value generating means (4, 703-705), said storage element selecting means (4, 706-707) and said storage means (5, 707) are made to operate a plurality of times for a plurality of faults in said sequential logic circuit. The apparatus as claimed in Claim 2, wherein said scan request degree increasing means (4, 711) increases said degree of requesting the scan operation for said storage element, name data of which has been first stored in said storage means (5, 707). The apparatus as claimed in Claim 2, wherein said scan storage element selecting means (4, 105) comprises: calculating means (3, 105) for calculating controllabilities of a plurality of said storage elements each having the maximum degree of requesting the scan operation; controllability selecting means (4, 105) for selecting the maximum controllability among the controllabilities calculated by said calculating means (3, 105); and element selecting means (4, 105) for selecting a storage element corresponding to the maximum controllability selected by said controllability selecting means (3, 105). The apparatus as claimed in Claim 2, wherein scan storage element selecting means (4, 105) comprises: calculating means (3, 1104-1106) for calculating each controllability of said sequential logic circuit when each of a plurality of storage elements each having the maximum degree of requesting the scan operation is converted into a scan storage element; controllability selecting means (4, 1107) for selecting the minimum controllability among the controllabilities calculated by said calculating means (4, 1104-1106); and element selecting means (4, 1107) for selecting a storage element corresponding to the minimum controllability selected by said controllability selecting means (4, 1107). A method of generating a test pattern for a sequential logic circuit including a plurality of storage elements each storage element storing a logical value of one bit, logical values of bits of said plurality of storage elements being represented by a state, said method including the following steps of: generating (703-705) a combination of external input values so that effects of a fault of said sequential logic circuit reach external output terminals thereof; characterized in further including the following steps: selecting (706-707) storage elements, the states of which are necessary to be changed in order that the effects of the fault of said sequential logic circuit reach said external output terminals thereof; storing (707) said selected storage elements in storage means; increasing (710) a degree of requesting a scan operation for each of said storage elements, the name data of which have been stored in said storage means; selecting (105) storage elements to be scanned based on said degree of requesting the scan operation; converting (106) said selected storage elements into scan storage elements; and generating (107) a test pattern for said sequential logic circuit when said selected storage elements selected are converted into scan storage elements. The method as claimed in Claim 6, wherein said external input values generating step (703-705), said storage elements selecting step (706-707) and said storing step (707) are performed a plurality of times for a plurality of faults in said sequential logic circuit. The method as claimed in Claim 7, wherein said scan request degree increasing step (711) includes a step of increasing said degree of requesting the scan operation for said storage element, name data of which has been first stored in said storage means. The method as claimed in Claim 7, wherein said scan storage element selecting step (105) includes steps of: calculating (105) controllabilities of a plurality of said storage elements each having the maximum degree of requesting the scan operation; selecting (105) the maximum controllability among the calculated controllabilities; and selecting (105) a storage element corresponding to the selected maximum controllability. The method as claimed in Claim 7, wherein scan storage element selecting step (105) includes steps of; calculating (1104-1106) each controllability of said sequential logic circuit when each of a plurality of storage elements each having the maximum degree of requesting the scan operation is converted into a scan storage element; selecting (1107) the minimum controllability among the calculated controllabilities; and selecting (1107) a storage element corresponding to the selected minimum controllability.

Inventors: MOTOHARA AKIRA, TAKEOKA SADAMI, MOTOHARA, AKIRA, TAKEOKA, SADAMI
Applicants: MATSUSHITA ELECTRIC IND CO LTD, MATSUSHITA ELECTRIC INDUSTRIAL CO., LTD.
Application year: 1992
Main classification: G06F11
IPC codes: G01R31