Background of the Invention
1. Field of the Invention
The present invention relates generally to digital flip-flops, and, in particular, to a flip-flop which is designed to provide immunity from clock skew.
2. Description of the Related Art
Clock skew can be a major problem in the design of digital circuits having multiple flip-flops and multiple clocks, for example, in an asynchronous environment. As the number of flip-flops and/or the number of clocks increases, so does the possibility of skew being a problem. Two or more clocks can have skew between them for many reasons, including for example, that the clocks are derived from two or more unique clocks or that the clocks are from a different distribution chain for the same clock. Whatever the reason, skew frequently causes a lack of correlation between actual and predicted silicon behavior.
The destructive effects of clock skew are best illustrated by an example. Referring to FIG. 1, the Q output of flip-flop A is connected to the D input of flip-flop B. Flip-flop A receives clock X, and flip-flop B receives clock Y. FIG. 2 illustrates the operation of flip-flops A and B under ideal conditions, i.e., when there is no skew between clocks X and Y. Because flip-flops A and B are rising edge-triggered D flip-flops, the output of flip-flop A goes high 28 in response to the rising edge 20 of clock X, and the output of flip-flop B goes high 30 in response to the rising edge 22 of clock Y. In the scenario illustrated in FIG. 2, flip-flop A's output data will be transferred to flip-flop B one clock period later. For example, when flip-flop A's output goes low 32 in response to rising edge 24, flip-flop B's output goes low 34 in response to rising edge 26 one clock period later. In other words, flip-flop B takes up flip-flop A's "previous" value, while flip-flop A takes up a "new state". This is because both flip-flops A and B are updated at the same time on the rising edge of their respective clocks.
FIG. 3 illustrates the operation of flip-flops A and B when there is skew 44 between clocks X and Y. In this scenario, flip-flop B takes up the "new" value of flip-flop A as opposed to taking up the "previous" value of flip-flop A. Specifically, flip-flop A's output goes high 36 in response to the rising edge 38 of clock X, and flip-flop B's output goes high 40 in response to the rising edge 42 of clock Y.
The skew 44 between clocks X and Y causes the rising edge 42 of clock Y to trigger flip-flop B after the output of flip-flop A has already gone high 36. Because flip-flop A's output is the input of flip-flop B, the output 40 of flip-flop B, in response to rising edge 42, is the "new" value 36 of flip-flop A. In other words, because of the skew 44 between clocks X and Y, the data races through flip-flop A.
Because the existence and/or amount of clock skew tends to be unpredictable, such skew makes the behavior of flip-flop circuits unpredictable. Although FIG. 1 shows the Q output of flip-flop A being connected to the D input of flip-flop B, it will be appreciated that skew has similar "destructive" effects on any other type of connection between flip-flops A and B. For example, if the Q or Q .sub.-- output of flip-flop A is connected to flip-flop B's scan data input, asynchronous set or asynchronous reset, skew between clocks X and Y will similarly make the output of flip-flop B unpredictable. Furthermore, the problems associated with clock skew are not unique to the specific types of D flip-flops shown in FIG. 1. Specifically, flip-flops A and B are so called "scan" flip-flops which include a second "scan data" input (SI), multiplexed with the D input, which allows the flip-flop to operate as a shift register. Skew can have negative effects on the operation of any type of flip-flop, whether or not it includes set and/or reset functions, is a scan flip-flop, or is a D flip-flop.
For example, a normal scan flip flop having the multiplexed D flip-flop arrangement is referred to herein as an "SFFD", a normal scan flip flop with an asynchronous set capability is referred to herein as an "SFFDS", a normal scan flip flop with an asynchronous reset capability is referred to herein as an "SFFDR", and a normal scan flip flop with an asynchronous set and reset is referred to herein as an "SFFDRS". Table I below summarizes many of the connections between flip-flops A and B in which clock skew can create a problem:
Table I deals with connections only between scan flip-flops. Clock skew is also a problem for non-scan flip-flops having similar connections.
One specific example in which skew can have destructive effects on the operation of scan flip-flops is illustrated in FIG. 4. It is well known that the testing of an integrated circuit has become a significant part of its total cost. Thus, techniques which can simplify such testing can help to reduce manufacturing costs. FIG. 4 illustrates a portion of an integrated circuit 45 which has been designed to include features which simplify its own testing. Such circuits are often referred to as having a design for test feature, or DFT. Scan flip-flops have sometimes been used in such circuits to implement DFT.
Integrated circuit 45 includes logic circuits 46, 47. After the manufacturing process of integrated circuit 45 is complete, it may be desirable or necessary to test logic circuits 46, 47. If logic circuits 46, 47 were isolated circuit components, they could be easily tested by providing a set of inputs and verifying that the correct output data is generated. However, logic circuits 46, 47 are "buried" in the integrated circuit 45 such that direct access to their inputs and outputs is not possible, making testing of logic circuits 46, 47 difficult.
In order to provide a way to test logic circuits 46, 47, it is well known in the art to use conventional scan flip-flops 48, 49 to shift test values into the circuit 45, as well as shift the current contents of the flip-flops out of the circuit 45 in order to verify their values. For example, by using flips-flops 48, test values for the inputs of logic circuit 47 can be shifted into scan input A and the current output values of logic circuit 46 can be shifted out of scan output A. By using flip-flops 49, the current output values of logic circuit 47 can be shifted out of scan output B and test values for the inputs of the next logic circuit (not shown) can be shifted into scan input B. These shift operations are referred to as "scan shift" operations. Thus, by using the scan flip-flops 48, 49 (which have the shifting capability), rather than non-scan flip-flops, the integrated circuit 45 has been designed for testing, i.e., Scan-DFT.
The ideal environment for implementing Scan-DFT is the pure computing one, i.e., a single clock and synchronous in nature. However, for practical reasons Scan-DFT is sometimes implemented in a non-computing environment, i.e., multiple clocks and asynchronous in nature. This is the scenario illustrated in FIG. 4, and this is the environment in which clock skew becomes a problem.
Clocks A, B and C are independent clocks. If there is skew between any of them, the scan shift operation can be destroyed in the manner described above with respect to FIG. 3. In other words, certain of the flip-flops 48, 49 in the chain may take the "new" value of the immediately preceding flip-flop. This will create incorrect and meaningless data at the scan outputs A and B, thus defeating the purpose of DFT.
There have been some ad-hoc attempts to solve the skew problem, but they have generally been very silicon intensive and provided limited protection. Such attempts usually involve delaying signals to provide a certain amount of skew protection. The amount of skew protection tends to be somewhat proportional to the amount of delay, i.e., the more silicon that is used to provide delays, the more skew protection that is obtained. In an environment having a large number of clocks, the silicon cost, i.e., die area, can be very high. Thus, a trade-off must be made between skew protection and die area, and, as is common with such trade-offs, a degree of uncertainty usually remains as to whether the chosen amount of skew protection is enough.
Thus, there is a need for an apparatus and method which will solve the problems created by clock skew on flip-flop circuits.
Summary of the Invention
The present invention provides a flip-flop cell having a main data input, a main data output and a main clock input. The flip-flop cell includes a first latch having a data input, a data output and an inverting clock input. The data input of the first latch is coupled to the main data input of the flip-flop cell. A second latch has a data input, a data output and a non-inverting clock input. The data input of the second latch is coupled to the data output of the first latch. A third latch has a data input, a data output and an inverting clock input. The data input of the third latch is coupled to the data output of the second latch, and the data output of the third latch is coupled to the main data output of the flip-flop cell. The inverting clock input of the first latch, the non-inverting clock input of the second latch, and the inverting clock input of the third latch are all coupled to the main clock input of the flip-flop cell.
The present invention also provides a flip-flop cell having a main data input, a main data output and a main clock input. The flip-flop cell includes a flip-flop having a data input, a data output and a clock input. The flip-flop data input forms the main data input for the flip-flop cell and the flip-flop clock input forms the main clock input for the flip-flop cell. The flip-flop is triggered in response to data on the flip-flop data input and a first rising edge of a clock received at the flip-flop clock input. A latch having a data input, a data output and an inverting clock input, has its data input coupled to the data output of the flip-flop. The inverting clock input of the latch is coupled to the clock input of the flip-flop, and the data output of the latch forms the main data output for the flip-flop cell. The latch is triggered in response to data on the flip-flop data output and a first falling edge of the clock immediately following the first rising edge received at the flip-flop clock input.
The present invention also provides a circuit having a design for test feature. The circuit includes a plurality of flip-flops each having a main data input, a main scan data input, a main data output and a main clock input. The flip-flops are arranged serially in a chain with the main data output of each flip-flop being coupled to the main scan data input of an adjacent flip-flop. Each of the flip-flops includes first, second and third latches coupled serially and successively together with the second latch being triggered in response to a first rising edge of a clock received at the flip-flop main clock input and the third latch being triggered in response to a first falling edge immediately following the first rising edge of the clock received at the flip-flop main clock input. A data input of the first latch is coupled to the main data input of the flip-flop and a data output of the third latch is coupled to the main data output of the flip-flop.
The present invention also provides a method of performing a flip-flop function. The method includes the steps of: receiving a data bit at a main data input; receiving a clock signal at a main clock input; latching the data bit with a first latch on a first falling edge of the clock signal; latching an output of the first latch with a second latch on a first rising edge of the clock signal immediately following the first falling edge; latching an output of the second latch with a third latch on a second falling edge of the clock signal immediately following the first rising edge; and transferring an output of the third latch to a main data output.
The present invention also provides a method of providing skew protection in a flip-flop having a data input, a data output and a clock input. The method includes the steps of: coupling the data output of the flip-flop to an input of a latch; coupling the clock input of the flip-flop to a clock input of a latch; generating a data bit at the data output of the flip-flop on a first rising edge of a clock signal received at the clock input of the flip-flop; latching the data bit with the latch on a first falling edge of the clock signal immediately following the first rising edge; and providing an output of the latch as an alternative to the output of the flip-flop.
A better understanding of the features and advantages of the present invention will be obtained by reference to the following detailed description of the invention and accompanying drawings which set forth an illustrative embodiment in which the principles of the invention are utilized.
Brief Description of the Drawings
FIG. 1 is a schematic diagram illustrating two conventional flip-flops.
FIG. 2 is a timing diagram illustrating the operation of the flip-flops shown in FIG. 1 when there is no clock skew.
FIG. 3 is a timing diagram illustrating the operation of the flip-flops shown in FIG. 1 when there is clock skew.
FIG. 4 is a schematic diagram illustrating a conventional design for test (DFT) circuit.
FIG. 5 is a schematic diagram illustrating a flip-flop in accordance with the present invention.
FIG. 6 is a timing diagram illustrating the operation of the flip-flop shown in FIG. 5.
FIG. 7 is a detailed schematic diagram illustrating another flip-flop in accordance with the present invention.
FIG. 8 is a timing diagram illustrating the operation of the flip-flop shown in FIG. 7.
FIG. 9 is a detailed schematic diagram illustrating the flip-flop shown in FIG. 5.
FIG. 10 is a schematic diagram illustrating the flip-flop cell of FIG. 5 replacing flip-flop A of FIG. 1, in accordance with the present invention.
FIG. 11 is a schematic diagram illustrating the flip-flop cell of FIG. 5 replacing all of the scan flip-flops of FIG. 4, in accordance with the present invention.
Detailed Description of the Invention
Referring to FIG. 5, there is illustrated a flip-flop cell 50 in accordance with the present invention. The cell 50 has been designed to provide immunity from skew in a very cost effective and uniform/methodical manner. The cell 50 may or may not include the scan data input, set and/or reset functions, and may be used as a replacement cell, i.e., replacing conventional flip-flops, to provide the same function as the replaced flip-flop, as well as skew immunity. One-half of a clock period worth of skew immunity is provided. One advantage of this is that, assuming a user has the option to run a system at different frequencies, the one-half period of skew immunity can be as large or small as the user chooses.
The flip-flop cell 50 includes a conventional flip-flop, such as flip-flop A, and a latch 52. The latch 52 is connected to the same clock that is used to drive flip-flop A, in this case clock X, and to a data output of flip-flop A. The output of the latch 52 is the new data output for flip-flop A. The latch 52 is triggered on the falling edge of clock X.
FIG. 6 illustrates the operation of the flip-flop cell 50 when it is used to replace flip-flop A in FIG. 1, as is shown in FIG. 10. Again, clocks X and Y have a certain amount of skew 44 between them. Flip-flop A's old data output goes high 36 in response to the rising edge 38 of clock X. Flip-flop A's new data output, i.e., the output of the latch 52, does not go high 54 until the falling edge 56 of clock X. This means that the input of flip-flop B, i.e., the new data output of flip-flop A, is still low 58 on the rising edge 42 of clock Y. This prevents flip-flop B's output from going high in response to the rising edge 42 of clock Y. Instead, flip-flop B's output goes high 62 in response to the rising edge 60 of clock Y. Thus, flip-flop A's output data (from the old data output) is correctly and predictably transferred to flip-flop B one clock period later.
Flip-flop A's old data output goes low 64 in response to the rising edge 66 of clock X. This is followed by flip-flop A's new data output, i.e., the output of the latch 52, going low 70 on the next falling edge 68 of clock X. Because the input of flip-flop B, i.e., the new data output of flip-flop A, is still high 72 on the rising edge 74 of clock Y, the output of flip-flop B remains high after the rising edge 74. Thus, flip-flop B takes up flip-flop A's "previous" value, while flip-flop A takes up a "new state". Finally, one clock period later, on the rising edge 76 of clock Y, the output of flip-flop B goes low 78 because its input, i.e., flip-flop A's new data output, is low.
The flip-flop cell 50 provides normal/expected behavior despite the skew 44 between clocks X and Y. Because flip-flop A's new data output does not go high 54 until the falling edge 56 of clock X, the amount of skew immunity that is provided is equal to one-half of a clock period (or clock cycle), i.e., the period of time between the rising edge 38 of clock X and the falling edge 56 of clock X.
Referring to FIG. 7, there is illustrated a detailed schematic of a flip-flop cell 80 in accordance with the present invention. The flip-flop cell 80 is basically the same as the flip-flop cell 50 except that the "scan data" feature has been omitted. Again, it should be well understood that the teachings of the present invention apply to any type of flip-flop, including but not limited to, D flip-flops, scan flip-flops, flip-flops having set and/or reset functions, etc. In accordance with the present invention, a latch is added to the output of these flip-flops in order to provide one-half period of skew immunity.
The two latches 82, 84 form a conventional D flip-flop 86. The first latch 82 is triggered on the falling edge of clock Z, and the second latch 84 is triggered on the rising edge of clock Z. In accordance with the present invention, a third latch 88 is included. The third latch 88 is triggered on the falling edge of clock Z.
FIG. 8 illustrates the operation of the flip-flop cell 80. Initially, input D.sub.1 goes high 89. Output Q.sub.1 goes high 90 in response to the falling edge 92 of clock Z. Consequently, output Q.sub.2 goes high 94 in response to the rising edge 96 of clock Z, and output Q.sub.3 goes high 98 in response to the falling edge 100 of clock Z. When input D.sub.1 is brought low 102, output Q.sub.1 goes low 104 on the next falling edge 100 of clock Z. Consequently, output Q.sub.2 goes low 106 in response to the rising edge 108 of clock Z, and output Q.sub.3 goes low 110 in response to the falling edge 112 of clock Z.
Referring to FIG. 9, there is illustrated a detailed schematic diagram of the flip-flop cell 50. Specifically, a multiplexer 116 having two inputs has its output coupled to the latch 114. One of the inputs of the multiplexer 116 serves as the D input and the other input serves as the scan data input SI. A control input TE is used to select either the D input or the SI input of the multiplexer 116 to route data to the data input of latch 114.
One particularly advantageous application for the flip-flop cell 50 of the present invention is in the DFT circuit 45 (FIG. 4). Specifically, the flip-flop cell 50 could be used to replace all, or some, of the scan flip-flops 48, 49 in the integrated circuit 45, as is shown in FIG. 11. This would prevent any adverse effect on the scan shift operation caused by the skew between clocks A, B and C.
In general, whenever a connection between conventional flip-flops is likely to encounter a skew problem, the conventional flip-flops can be replaced by one of the flip-flop cells 50, 80. Again, a flip-flop circuit in accordance with the present invention may be a scan or non-scan flip-flop, and may or may not include set and/or reset functions, etc. The flip-flop circuits 50, 80 will provide the same function as the original replaced flip-flop, and in addition, will provide one-half cycle of skew immunity.
The inclusion of the latches 52, 88 in the flip-flop cells 50, 80, respectively, requires less silicon die area than the ad-hoc attempts to solve the skew problem discussed above. For example, Table II below summarizes the estimated increases in cell area, over conventional scan flip-flops having no skew protection, of scan flip-flops having about 4 ns of skew protection using one of the ad-hoc solutions discussed above and several variations of the scan flip-flop 50 of the present invention. As can be seen from Table II, there is a dramatic reduction in the area overhead for the cells of the present invention.
Thus, the flip-flop cells 50, 80 of the present invention provide a less expensive and more reliable solution to the clock skew problem.
It should be understood that various alternatives to the embodiments of the invention described herein may be employed in practicing the invention. It is intended that the following claims define the scope of the invention and that structures and methods within the scope of these claims and their equivalents be covered thereby.