Method and apparatus for data transfer to and from devices through a boundary-scan test access port
TECHNICAL FIELD 
     This invention is directed to a technique for efficiently transferring data to and from one or more devices serially connected in a boundary-scan chain for testing purposes. 
     BACKGROUND OF THE INVENTION 
     To overcome some of the deficiencies incurred by testing of circuit boards using conventional probing techniques, a testing technique known as boundary scan has been developed. Testing of a circuit board using the technique of boundary scan requires that each individual active device (i.e., an integrated circuit) on a circuit board be provided with a plurality of boundary-scan cells (single-bit shift registers) each connected to a separate input/output pin of the device. The boundary-scan cells in each device are coupled in a serial chain to form a boundary data register which is serially coupled with the boundary-scan register of the other devices to form a board level serial boundary-scan chain. 
     Testing of the devices coupled in such a serial boundary-scan chain is accomplished by shifting a stream of test bits into the chain of devices through a Test Access Port (TAP) on each device so that each bit in the stream, for interconnect test, is input to a corresponding one of the boundary-scan cells. The test bit input to each cell is then applied to the cell to update it, i.e., to replace the current value of the bit stored therein with the value of the test bit. As the bit within each boundary-scan cell associated with a device output pin is updated, the boundary-scan cells associated with each device input pin connected to this output pin will be further updated. By shifting out the bits from the boundary-scan chain after the boundary-scan registers have been updated, and by comparing the stream of bits shifted out to that expected for a chain of devices that is defect-free, a fault in any of the devices can be uncovered. 
     In the course of carrying out boundary-scan testing, there are circumstances when it is useful to load a test data register in a particular device in the chain with data via the boundary-scan Test Access Port (TAP). For example, a device, such as a microprocessor, might have its control store loaded with new micro-instructions, which, when executed, would cause the device to test itself. Presently, to load a plurality of L-bit segments into a test data register, successive blocks of data of the form (L 1  +L+L 2 ) bits must be shifted through the scan chain, where L 1  and L 2  are the cumulative numbers of scan cells in the chain upstream and downstream, respectively, of the test data register in the device to be loaded with data. The L 1  and L 2  bit strings preceding and succeeding, respectively, each L-bit segment of interest are chosen to be &#34;don&#39;t care&#34; values. To load the test data register with N separate L-bit segments, N data blocks or packets, each of the form (L 1  +L+L 2 ) bits, must be shifted through the boundary-scan chain. 
     The above-described data transfer scheme is very inefficient because every time a new L-bit segment is to be loaded into the test data register of a particular device, a stream of (L 1  +L+L 2 ) bits must be shifted through the entire chain, requiring at least (L 1  +L+L 2 ) clock cycles. Further, to load a large stream of L-bit segments at the device operating speed would require a very high transfer rate which may not be obtainable. 
     Thus, there is a need for an efficient technique for transferring data to and from a device in a scan chain. 
     SUMMARY OF THE INVENTION 
     Briefly, in accordance with a first preferred embodiment of the invention, a technique is disclosed for efficiently transferring data to or from an L-bit (where L is an integer) test data register within a device under test serially coupled with the data register in at least one other device in a boundary-scan chain. The technique is practiced by first concatenating the L-bit segments of data to be successively transferred into the L-bit test data register ahead of a stream of L 1  bits of don&#39;t care values where L 1  is the number of serially connected scan cells upstream of the test data register in the device to be loaded with data. Assuming that N successive L-bit segments are to be transferred (where N is an integer), the resultant data block or packet takes the form of a stream of (L 1  +NL) bits. Following the concatenation step, the first L 1  bits of the (L 1  +NL) bit block are shifted through the scan chain of devices so as to flush any remaining bits stored in the first L 1  boundary-scan cells. To determine when the first L 1  bits have been shifted, the device under test is provided with a down counter which is loaded with the value of L 1 . Each time a successive one of the first L 1  bits of the block of (L 1  +NL) bits is shifted into a separate one of the first L 1  scan cells in the chain, the counter is decremented. Once the first L 1  bits of the stream of (L 1  +NL) bits have been shifted into the L 1  scan cells upstream of the test data register in the device to be loaded, then a successive one of the N L-bit segments is shifted into the test register so that data can be transferred to the device. Alternatively, data can be transferred from the device by causing the device to update, e.g., overwrite, the L-bit segment loaded into the scan data register with data from the device itself. When the last of the N L-bit segments has been loaded into the test data register in the device, then the remaining L 1  bits in the L 1  +NL bit block will have been shifted into a separate one of the L 1  scan cells in the scan chain upstream of the test data register in the device. In this way, the last L 1  bits of the last L-bit segment of data are &#34;flushed&#34; from the L 1  scan cells upstream of the test data register in the device. 
     In a second preferred embodiment, data transfer may be accomplished without the need to provide the device under test with an L 1  -bit down counter. Instead, the addressing of the device to which the N L-bit segments are to be transferred is made to &#34;wrap around,&#34; such that when a predetermined upper address value is reached, the addressing starts from zero, rather than freezing at the highest value. When utilizing this approach, the block of data to be read into the boundary-scan chain is obtained by concatenating a set of L L 1  /L -L 1  filler bits (having &#34;don&#39;t care&#34; values) to, and ahead of, a data stream of (L 1  +NL) bits of interest, the last L 1  bits of which are don&#39;t care values. Within the group of N L-bits the  L 1  /L  segments which are to be read in first are placed at the end of the block. To load the device under test, the first packet of  L 1  /L  segments, which are don&#39;t care values, are shifted into the chain. Thereafter, the bits of each successive one of the next group of N- L 1  /L  segments are shifted into the device under test each time the scan data register within the device is successively addressed. When the last of the segments in the block of N- L 1  /L  bits are shifted into the device under test, the address point associated with the L-bit register in the device will wrap around so that the initial group of  L 1  /L  segments is overwritten with the proper data. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     FIG. 1 is a block schematic diagram of a device under test coupled in a scan chain according to the prior art; 
     FIG. 2 is a flowchart diagram showing a process according to the prior art for shifting data into and out of the device of FIG. 1; 
     FIG. 3 is a block schematic diagram of the scan chain of FIG. 1, showing how the device under test is modified in accordance with the invention to accomplish more efficient data transfer thereto and therefrom; 
     FIG. 4 is a block diagram of a data stream created for transfer to the device under test of FIG. 3; and 
     FIG. 5 is a block diagram of an alternate data stream created for transfer by the device under test of FIG. 1. 
    
    
     DETAILED DESCRIPTION 
     The present invention is directed to a scheme for achieving efficient data transfer to a test data register in a device under test, the register being serially coupled to a test data register in at least one other device in a scan chain. Referring to FIG. 1, there is shown a block schematic diagram of a prior-art device 10 which is to be tested using boundary-scan techniques. The device 10 (hereinafter referred to as the device under test) is typically an active device, such as a memory or a microprocessor or the like, having at least one circuit 12 therein to which input and output connections are made via a set of input/output pins (not shown). Associated with the circuit 12 within the device 10 is a register 14, referred to as the test data register, which is provided within the circuit to facilitate boundary scan testing thereof in accordance with the procedure outlined in IEEE STD P1149.1, described in the document Standard Test Access Port and Boundary-Scan Architecture, sponsored by the Test Technology Committee of the IEEE Computer Society, herein incorporated by reference. The test data register 14, assumed to be L bits long (i.e., the register has L individual cells (not shown)), is coupled in series with the test data register with at least one, and typically a plurality of other, devices 10&#39; which may be similar to, or of a different construction from, the device 10 under test such that the register has its Test Data Input (TDI) coupled to the output of the last of the upstream cells, and its Test Data Output (TDO) coupled to the input of the first of the downstream cells. For purposes of illustration, it is assumed that there are L 1  cumulative scan (register) cells associated with the devices 10&#39; upstream of the device 10 under test and L 2  cumulative scan cells associated with the devices downstream of the device under test. 
     The circuit 12 within the device 10, as well as the circuit within each of the other devices 10&#39;, may take various forms. For purposes of discussion, the circuit 12 is assumed to be a memory (e.g., a RAM). Associated with the memory 12 is an address counter 16 which serves to retain a value indicative of the location within the memory which is to store data, or from which data is to be read. 
     Control of test data register 14 within the device 10 is accomplished by a Test Access Port controller (TAP) 18 whose details are discussed in the previously-mentioned Standard Test Access Port and Boundary-Scan Architecture document. 
     Among the operations controlled by the TAP controller 18 is the shift operation during which bits in a data stream are shifted through the device 10 and the devices 10&#39; in the same serial chain. For purposes of discussion, the operation of the TAP controller 18 will be described assuming that (L 1  +L+L 2 ) bits are to be shifted through the device 10 and the devices 10&#39; which are upstream and downstream therefrom. Referring now to FIG. 2, there is shown in flowchart form a summary or conceptual representation of steps executed by the TAP controller 18 of FIG. 1 to carry out shifting of data bits through the chain of devices 10. 
     The first step (step 20) undertaken by the TAP controller 18 of FIG. 1 is to select the data register scan (shift) operation. Step 20 is initiated when the TAP controller 18 of FIG. 1 is supplied with a Test Mode Select (TMS) signal of a particular sequence. Once the shift state is selected, then the TAP controller 18 causes the actual shifting of data (step 22). A successive one of the bits in the stream of test bits is shifted into a successive one of the cells in the register 14 in the boundary-scan chain in response to a successive &#34;tick&#34; (i.e., alternation of a periodic clock signal TCK input to the TAP controller 18). As indicated in FIG. 2, the shift step 22 is repeatedly executed to shift each of the bits in the stream of test bits (L 1  +L+L 2 ) into a separate one of the (L 1  +L+L 2 ) cells in the chain of devices 10 and 10&#39;. Following the shift step 22, the shifting operation is exited (step 24) whereupon an update operation (step 26) is executed during which the bit in each cell of each test data register 14 is applied to the corresponding input/output pin of the circuit 12 of FIG. 1. 
     During instances other than when carrying out boundary-scan testing as described, it is useful to load the test data register 14 within the device 10 under test with data. Using the above-described scheme for carrying out data transfer, loading of a successive one of an arbitrarily large number (N) of L-bit blocks of data L A ,L B ,L C . . . L N  would be carried out as follows. First, a block of bits (L 1  +L A  +L 2 ) would be shifted through the chain of devices 10 and 10&#39;, where the first and last group of L 1  and L 2  bits, respectively, in the block are &#34;don&#39;t care&#34; values. Successive blocks of bits (L 1  +L B  +L 2 ), (L 1  +L C  +L 2 ) . . . (L 1  +L N  +L 2 ) would then be shifted through the chain of devices 10 and 10&#39;. The strings of L 1  and L 2  bits of don&#39;t care values are necessary to insure that each of the L-bit segments L A  ,L B , L C  . . . L N  is properly positioned for loading in the test data register 14. 
     The above-described process of loading data into the test data register 14 of the device under test 10 is very cumbersome. Because of the need to concatenate each of the N segments L A ,L B , L C  . . . L N  (where there can be an arbitrarily large number of segments) with an upstream and downstream string of L 1  and L 2  don&#39;t care values, respectively, at least L 1  +L+L 2  clock cycles are consumed each time a successive one of the data blocks L A , L B ,L C  . . . L N  is loaded. Depending on the size of the L 1  and L 2  bit strings, the number of such cycles can be large, resulting in a significant degree of inefficiency. 
     In accordance with a first embodiment of the invention, efficient data transfer to and from the device under test 10 may be accomplished by modifying the device, as shown in FIG. 3, to incorporate a down-counter 28 which is controlled by the TAP controller 18. When the TAP 18 enters the shift state (step 22 of FIG. 2), the counter 28, which is initially loaded with the value L 1 , is decremented each time a successive bit of the data stream is shifted into a successive one of the boundary-scan cells 16 in the boundary-scan chain of devices 10. 
     In order to load the test data register 14 in the device under test 10 of FIG. 3 with a successive one of the segments of data L A ,L B ,L C  . . . L N , it is necessary to first concatenate these L-bit segments together ahead of a trailing block of L 1  filler bits of don&#39;t care values to establish a data block of the form (L 1  +NL) bits shown in FIG. 4. Following the concatenation operation, the TAP controller 18 of FIG. 1 executes the operations shown in FIG. 2 associated with data shifting to perform L 1  shift operations, with the counter 28 being decremented each time the shift step 22 is executed. The purpose in counting the first L 1  set of shift operations is to determine when the first L 1  bits in the data block (L 1  +NL) have been shifted into the L 1  boundary-scan cells of the test data registers 14 in the devices 10&#39; upstream of the test data in the device under test 10 so as to flush the data previously contained in these upstream cells. Otherwise, the test data in the device under test 10 could be loaded with &#34;old&#34; (i.e., meaningless) data. 
     Once the down counter 28 has counted to zero, the NL successive shift operations (consuming NL clock cycles) are additionally carried out so that a separate one of the N L-bit segments L A ,L B ,L C  . . . L N  of interest is successively loaded into the boundary-scan data register 14. Every L clock cycles, a successive one of the L-bit segments then loaded into the test data register 14 is applied to the circuit 12 or, alternatively, the circuit applies a new L-bit segment to the register. In this way, the first N L-bit segments of the data block (L 1  +NL) are thus successively unpacked and loaded into the test data register 14 so that data can be transferred thereto or therefrom. The last L 1  bits of the data block (L 1  +NL) are provided to assure that the block is sufficiently long enough so that the last segments of interest up to `N` can be successfully loaded when the last of the L 1  +NL shift operations is completed. 
     As compared to the prior art data transfer technique, the instant data transfer scheme is far more efficient. To transfer N separate L-bit segments of data, the total number of clock cycles required would be on the order of L 1  +NL. By comparison, the prior art scheme would require N(L 1  +L+L 2 ) operations. Thus, with the instant scheme, data transfer can be accomplished more rapidly. 
     The instant data transfer technique, while described for transferring data to a single test data register 14, can easily be employed to transfer data to multiple test data registers within the scan chain comprised of the device 10 under test and the devices 10&#39; upstream and downstream therefrom. To efficiently transfer data to multiple test data registers 14 in a scan chain, it would be necessary to concatenate the NL-bit segments to be transferred to each register behind the data block to be transferred to the register downstream therefrom. In addition, the counter 28 associated with each test data register 14 would have to be loaded with the appropriate value based on the number of scan cells in the test data registers upstream therefrom. 
     It is possible to achieve efficient transfer of data to and from the device under test 10 of FIG. 1 without having to modify the device to incorporate the down counter 28 of FIG. 3. Rather, the unpacking of a stream of bits of the form (L 1  +NL) can be achieved by controlling the manner in which the information from the test data register 14 is entered into the circuit 12, which, as previously indicated, is assumed to be a memory. As discussed previously, when the circuit 12 is a memory, then associated with it is the address counter 16 for storing the address of the location in the memory into which data is to be written or from which data is to be read. 
     Typically, the address counter 16 associated with the memory circuit 12 operates to count upward from the lowest memory address to the highest and then freeze at the highest value. Assuming that the memory 12 is comprised of 256 words (i.e., storage locations), the address register 16, once it has addressed the 256th word, would retain the address of that word. To efficiently load the circuit 12 with data from the test data register 14 in accordance with a second embodiment of the invention, control of the address counter 16 is altered, through a program instruction, so that the address register &#34;wraps around,&#34; that is to say, it automatically returns to zero after addressing the 256th word. 
     With the first embodiment of the invention described previously, the stream of data entered to the boundary-scan chain was obtained by concatenating N separate L-bit segments to, and ahead of, a stream of L 1  filler bits. However, a slightly different data stream format is necessary, in the absence of the counter 28 of FIG. 3, to accomplish efficient data transfer. Referring to FIG. 5, the data stream required for efficient data transfer contains an initial group of L L 1  /L -L 1  filler bits of don&#39;t care value. The reason for providing such a group of bits at the head of the data stream of interest is to ensure that the bits previously existing in the L 1  upstream boundary-scan cells in the boundary-scan chain of devices 10&#39;, together with the group of L L 1  /L -L 1  filler bits, comprises an integral number of L-bit segments. To the group of L L 1  /L -L 1  filler bits, a block of N successive L-bit segments containing the data of interest is concatenated thereto, such that the first L L 1  /L  bits in the block of NL bits lies at the end of the block. The reason for placing the first packet of L L 1  /L bits at the end of the block of NL bits will become better understood below. To the end of this block of (NL+L L 1  /L -L 1 ) bits is appended a packet of L 1  filler bits, as before, yielding a block of (L 1  +NL+L L 1  /L -L 1 ) bits. 
     To load the bit stream of (L 1  +NL+L L 1  /L -L 1 ), the TAP controller 18 of FIG. 1 enters its SHIFT state and commences the operations described in FIG. 3. As the shift operation 22 of FIG. 3 is successively carried out, the bits in the block (L 1  +NL+L L 1  /L -L 1 ) are unpacked by the device under test 10. Since the first packet of L L 1  /L  bits in the block are don&#39;t care values, the first L 1  /L  storage locations in the memory circuit 12 will be filled with filler bits. The next N - L 1  /L  segments which contain valid data will be properly stored in the corresponding locations in the memory circuit 12 in accordance with address information in the address register 14 of FIG. 1. After the last of the N- L 1  /L  segments is stored, the value in the address register 15 wraps around to its lowest address value (zero) so that the initial  L 1  /L  segments in the memory circuit 12 are written over with valid data. The reason for placing the initial packet of  L 1  /L  segments in the data block of N L-bit segments is to compensate for the presence of L 1  scan cells of FIG. 1 in the devices 10&#39; upstream of the device under test 10. 
     The total number of clock cycles required to transfer N separate L-bit segments of data using the above-described scheme will be on the order of (L L 1  /L +NL). As compared to the prior art transfer scheme which would require N(L 1  +L+L 2 ), the instant technique is thus far more efficient. 
     The foregoing describes a technique for efficiently transferring data to (and from) a device under test 10 serially coupled with other devices in a boundary-scan chain. 
     It is to be understood that the above-described embodiments are merely illustrative of the principles of the invention. Various modifications and changes may be made thereto by those skilled in the art which will embody the principles of the invention and fall within the spirit and scope thereof.