Device for transforming the occurrence probability of logic vectors and for the generation of vector sequences with time variable probabilities
The present invention relates to a device for transforming the occurrence probability of logic vectors and for generating vector sequences with time variable probabilities, applicable in particular to the production of a random testing device for logic circuits, particulary microprocessors. 
     In various domains of data processing, it is necessary to be able to have available, for particular applications, logic vector sequences with given probabilities. Such is for example the case of random testing devices for logic circuits such as microprocessors. In fact, to monitor logic circuits such as microprocessors, the functioning of two of these microprocessors, namely a reference microprocessor and the microprocessor subjected to the test, is compared. To this end, a sequence of instructions and orders is sent in parallel to the two microprocessors and a bit by bit comparison is made of the outputs of the two microprocessors. Any discordance appearing during such comparison makes it possible to detect a defect in the microprocessor subjected to the test. 
     It is an object of the present invention to procure a device for transforming the occurrence probability of logic vectors so as to produce, at the output of this device, vector sequences with given probabilities, from input vectors which may be equiprobable or themselves have different occurrence probabilities, this device advantageously being able to be used for the production of vector sequences with given probabilities applied to two logic circuits, in order to compare the functioning of one of these circuits with respect to another reference circuit. 
     To this end, this device for transforming the occurrence probability of logic vectors is characterized in that it comprises a memory or an equivalent circuit to which are applied input logic vectors having different or equal respective occurrence probabilities and containing, in respective areas of different ranges, the different categories of output vectors so that the occurrence probability of a determined output vector depends both on the range of the area of memory in which this vector is stored, i.e. on the number of elementary positions or eight bit bytes that this zone covers, and the respectives probabilities of the input vectors corresponding to the addresses of the elementary positions of the area of memory in question. 
     The invention also relates to a device generating sequences of vectors with time-variable probabilities, using at least one device for transforming the occurrence probability of logic vectors such as above mentioned characterized in that it comprises memories or equivalent circuits containing the different categories of vectors as well as the information necessary for identifying these different categories, and a sequencer based on logic circuits allowing the sequencing of the different types of vectors in time, as a function of given realtionships, the outputs of the memories or equivalent circuits being connected, via switches to one or more circuits adapted to receive them, such as for example microprocessors. 
     A particular application of the invention is constituted by a random testing device for logic circuits, particularly microprocessors, using at least one device for transforming the occurrence probability of logic vectors. This random testing device comprising a central unit, a generator of random sequences of instructions and orders applied in parallel to a reference microprocessor and to the microprocessor being tested, a comparator at the imputs of which are connected the data, address and monitoring outputs of each microprocessor and of which the output is connected to the central unit, is characterized in that the random sequence generator comprises a shift register looped as a sequence generator of maximum period by an exclusive OR circuit, the cells of the register corresponding to certain bits defined by a known mathematical property being connected to the inputs of the exclusive OR circuit, so that the shift register allows a pseudorandom generation of equiprobable vectors, which are applied to a generator of vector sequences with given probabilities which comprises memories or equivalent circuits containing the different categories of vectors as well as the information necessary for identifying these different categories, and a sequencer based on logic circuit allowing the sequencing of the different types of vectors in time, as a function of given relationships, the outputs of the memories being connected, via switches, both to the reference microprocessor and to the microprocessor being tested. 
     The random testing device comprises, for example, concerning the instructions, three memories, namely a first memory for storing the data, a second memory for storing the operation codes and a third memory for storing the number of cycles corresponding to the various operation codes, on the one hand, and a fourth memory for storing the types of order and a fifth memory for storing the numbers of cycles corresponding to the various respective orders, on the other hand, the outputs of the first and second memory being connected, respectively by busses to a first switch of which the output is connected in parallel, by a data bus to the refrence microprocessor and to the microprocessor being tested, the output of the third memory being connected in parallel, via a bus,to a first counter controlling, by a link the first switch, the output of the fourth memory being connected, through a second switch, to an order bus connected in parallel to the two microprocessors and the fifth memory being connected by its output on the one hand to the first counter and on the other hand to a second counter controlling the second switch. 
     The random testing device according to the invention offers the advantage that it makes it possible to allocate probabilities to each vector and no longer to each bit of a vector as was known heretofore. Furthermore, it makes it possible to furnish a sequence of vectors which is constituted by vectors which are drawn from different memory fields (with different probabilities) by respecting certain constraints (the number of any eight bit bytes whatsoever according to an operation code depending on this operation code). In addition, a control vector sequence elaborated in parallel with the first reacts on the elaboration of the first vector sequence. 
    
    
     The invention will be more readily understood on reading the following description with reference to the accompanying drawings,in which: 
     FIG. 1 is a block diagram of a device for transforming the occurrence probability of logic vectors. 
     FIG. 2 of the device is an application with a memory with sixteen elementary position areas and equiprobable input vectors. 
     FIG. 3 is a block diagram of an application to a random testing device for microprocessors. 
    
    
     The device according to the invention which is shown schematically in FIG. 1 comprises a memory M with n elementary positions m1,m2 . . . mn in each of which may be stored a logic vector constituted by a series of bits, forming for example an eight bit byte. The total field of the memory is subdivided into a certain number of areas of different ranges, depending on the occurrence probabilities which it is desired to obtain, at the output of memory M, for the different logic vectors contained in this memory. The memory M is addressed by means of generator G delivering at its output input logic vectors Ve1,Ve2 . . . Ven each corresponding to a respective address in the memory M. Vector Ve1 is allocated to the address of the elementary position m1, vector Ve2 to the address of position m2, etc.. The occurrence probabilities pr1,pr2 . . . prn of the input logic vectors Ve1, Ve2 . . . Ven may be the same or, on the contrary, different from one another, depending on the structure of the vector generator G. 
     According to the invention, the output vectors which it is desired to obtain are loaded into memory M, so that said vectors occupy, in memory M, areas of different ranges, in other words that they are stored in different numbers in this memory. For example, the output vector Vs1 may be stored in the first three elementary address positions m1,m2,m3 (see the upper left-hand corner of FIG. 1), whilst another output vector such as vector Vs5 may be stored in six other elementary positions of the memory M (see the lower left-hand corner of FIG. 1). It is therefore seen that the occurrence probabilities p&#39;r1, p&#39;r2 . . . p&#39;ri of the respective output vectors Vs1,Vs2 . . . Vsi, depend both on the range of the areas of the memory M in which these various output vectors are stored and on the occurrence probability of the input vectors Ve1,Ve2 . . . Ven allocated to the different addresses of the elementary positions of the memory. 
     FIG. 2 schematically illustrates, by way of example, the case of using a memory M with sixteen elementary position each containing two bits and consequently the generator of input logic vectors emits at its output sixteen vectors Ve1, Ve2 . . . Ve16, these vectors being equiprobable. These sixteen vectors are respectively allocated to the addresses of the sixteen memory positions. 
     FIG. 2 shows a logic vector 00 stored in eight memory positions, a logic vector 01 stored in three memory positions (see left side of FIG. 2), a logic vector 11 stored in five memory positions, whilst the logic vector 10 is not stored in memory M. The result of this is that the occurrence probability pr of the output logic vector 00 is 8/16, that of vector 01 is 3/16, that of vector 10 is equal to 0 and that of vector 11 is 5/16. It is therefore seen that these occurrence probabilities may be varied by modifying the plan of loading of the memory. 
     A particular form of application of the invention for effecting a random test on logic circuits such as microprocessors will now be described with reference to FIG. 3. 
     The random testing device shown in FIG. 3 comprises a central unit 1 constituted for example by an 80-10 INTEL card, connected to a display console 2 in order to allow a dialogue with the operator. This central unit 1 is connected to a generator 3 producing at its output, during the test, a random sequence of instructions on random data, on a data bus A, and in parallel, orders sent, likewise in random manner, on a bus B. The two busses A and B are respectively connected to a reference microprocessor MR and to a microprocessor MT which is subjected to the test. The data, address and monitoring outputs of these microprocessors are transmitted, respectively, by busses d, a and c, to the corresponding inputs of a comparator 4 which thus makes a bit by bit comparison of the outputs of the two microprocessors MR and MT. The output of comparator 4 is connected to the control unit 1 which, in addition to the dialogue with the operator via the display console 2, allows initialization and production of certain parameters of the generator 3 and the exploitation of the results of the test. 
     The generator 3 comprises a shift register 5 looped as a sequence generator of maximum period by an exclusive OR circuit 6. This register allows a pseudo-random generation of equiprobable vectors. Vector is understood to mean the combination of an assembly of bits juxtaposed in the register 5. This shift register may comprise, for example, 31 cells corresponding to bits b 1 , b 2  . . . b 31 . To obtain, in the cell corresponding to bit b 31 , a succession of bits constituting a pseudo-random sequence, the cells corresponding to bits of rows b 1  and b 4  are connected to the inputs of the exclusive OR circuit 6. 
     The circuit thus defined effects, at each clock pulse, a shift which gives the values of the 31 bits at time t+1 as a function of the 31 bits at time t. 
     Among bits b 1 ,b 2  . . . b 31 , a certain number, for example 28, namely bits b 4  . . . b 31 , are used to constitute the equiprobable vectors. 
     To allow the independence of two consecutive vectors, the equivalence of twenty eight phase shifts is effected at each clock pulse by effecting twenty eight loopings instead of one. The circuit made is therefore not exactly the one indicated, but a circuit which is easily deduced therefrom so that one clock pulse gives the values which would have been obtained at time t+28, as a function of the 31 bits at time t. 
     The number of consecutive independent vectors that may be obtained is equal to 2 n  -1 n , being the number of cells of the shift register 5 (n=31 in the particular case in question). In order to have the maximum number of vectors, the number N of bits of the vectors, 28 in the example in question, and 2 n  -1 must be prime numbers between them. 
     The equiprobable vectors of 28 bits issueing from the shift register 5 are applied to a generator 7 of vector sequences with given probabilities whichis in fact of the type described hereinabove with reference to FIG. 2. The purpose of this generator is to produce, from the random sequence of equiprobable vectors furnished by the shift register 5, a random sequence of instructions (or of codes of operations) followed by data as well as orders. In the particular case of the microprocessor subjected to the test being of the M 6800 type, the field of instructions may be limited to the 197 codes of operations of this microprocessor whilst the field of data may cover the 256 possible configurations of the 8-bit words. The occurrence probabilities of the different vectors (data or instructions) may be variable, as well as those of the orders. 
     The generator 7 of vector sequences with given probabilities comprises, as far as the instructions are concerned, three memories (of the read-write RAM memory or readonly ROM memory type) namely a memory 8 for storing the data, a memory 9 for storing the operation codes and a memory 10 for storing the numbers of cycles corresponding to the various operation codes. In the same way, generator 7 comprises, as far as the orders are concerned, a memory 11 for storing the types of order and another memory 12 for storing the numbers of cycles corresponding to the various respective orders. 
     Each memory 8, 9 and 10 operates in the same manner as memory M of FIGS. 1 and 2, as will be explained hereinafter. Each vector Vs comprises a data segment stored in the data memory 8, an operation code segment stored in operation code memory 9 and a number of cycle sequences stored in cycles storing memory 10. 
     Initially, the various memories 8,9,10,11,12 are loaded by subdividing the total field of each memory into a certain number of areas of different ranges, depending on the probabilities which it is desired to obtain at the output, each area extending in fact over a determined number of elementary positions, in each of which an eight bit byte may be loaded. For example, if memory 8 is considered allocated to the data, and if this memory has a total capacity of 2048 eight bit bytes, the 256 possible configurations for the data can be loaded eight times in this memory and an equiprobability of occurrence of each data is then found at the output. On the other hand, 1793 times 00 and once each of the 255 other data may also be loaded in this memory. At the output of the memory 8 there will then be an occurrence probability of 1793/2048=7/8 for 00 and 1/2048 for every other value. 
     The process is identical for memory 9 containing the operation codes and memory 11 containing the orders. 
     From vector b 4  . . . b 31  are extracted two vectors corresponding to different bits, for example a first vector V 1  corresponding to bits b 4  . . . b 14 , and a second vector V 2  corresponding to bits b 15  . . . b 25 , the total number of the bits of the two vectors V 1  and V 2  not exceeding 28 in the example in question. The two vectors V 1  and V 2  thus constituted are independent. They are sent, the first, V 1 , on a bus 13a, and the second, V2, on a bus 13b. 
     During the test, the equiprobable vectors V 1 , V 2  issuing from the shift register 5 are sent respectively on the address bus 13a connected to the three memories 8,9,10 associated respectively with the data, with the operation codes and with the numbers of cycles, and on bus 13b connected to the two memories 11,12 associated with the orders. Each of these memories is therefore addressed in equiprobable mannre and the occurrence probability of a data, an operation code or an order at the output of the corresponding memory, depends in fact only on the number of times that this value has been loaded in the memory. 
     This device also makes it possible to mask certain data by allocating thereto a zero probability, i.e. by not loading them at all in memory 8. 
     The versatility of this device, from the viewpoint of the choice of probability, is naturally proportional to the size of the memory used. 
     The testing sequence is constructed as follows: an operation code corresponding to an instruction with p cycles is followed by (p-1) data. The operation code must be drawn at random from the field of the operation codes contained in memory 9 and in the same way the data must also be drawn at random from the field of data of memory 8. In the course of filling the memory 9 corresponding to the operation codes, the number of cycles corresponding to each operation code is loaded in parallel at the same address in memory 10. The outputs of memory 8 containing the data and of memory 9 containing the operation codes are connected, by busses 14 and 15, to a switch 16 of which the output is connected to bus A transmitting the data applied to the two microprocessors MR and MT. 
     Memory 10 is, for its part, connected, by a bus 26, to a counter 17. This counter 17 is connected to the switch 16 by a link 18. Thus, during a test, the two memories 8,9 are addressed simultaneously and at the same time as the operation code selected is extracted from memory 9 and is transmitted, by bus 15, switch 16 and bus A, to the two microprocessors MR and MT, the number of cycles stored in memory 10 is loaded simultaneously in counter 17, at the address corresponding to that of the operation code selected in memory 9. The counter 17 is decremented by one unit at each cycle and as long as it is not returned to zero, it maintains the switch 16 open, this enabling the data to be sent to the two microprocessors on bus A. When the counter 17 is returned to zero, the two microprocessors have finished executing the instruction and a new operation code may then be sent. 
     Functioning is quite similar as far as the orders are concerned. In fact, the output of memory 11 containing the various orders is connected to the bus B of the orders applied to the two microprocessors, whilst memory 12, containing the number of cycles corresponding to the respective orders, is also connected to the counter 17, via a bus 19. This bus 19 is also connected to an additional counter 20 acting on a switch 21 interposed on order bus B. The role of the counter 20 is to maintain an order for a period of time sufficient for correct execution thereof. The link to the counter 17 makes it possible to send an operation code at the moment when the microprocessor is expecting it, after execution of the order. 
     The random sequence generator 3 also comprises an additional memory 22 in which is stored an initialization sequence making it possible to place the two microprocessors MR and MT in the same state, before the test. This memory 22 is connected to switch 16 by a data bus 23 and it is addressed by a counter 24 likewise connected to switch 16 by a link 25. 
     From the foregoing description, it is seen that the random testing device according to the invention makes it possible to allocate a priori probabilities to each vector and this thanks to a distribution of the data, the operation codes and the orders, in the fields of the associated memories, chosen as desired. 
     The device according to the invention may admit variants, particularly for the comparison between the outputs produced by the tested circuit and by a circuit without breakdown. An advantageous variant is as follows: the variables transmitted by busses c,a and d leaving the microprocessor MT are processed by a circuit which performs a compact function, called signature, of all the bits that it receives. At the end of the testing sequence, this signature is compared with the signature of a good circuit, which signature is previously memorized. This signature of a good circuit may be obtained either by simulation, or by the use of a reference circuit.