This application claims priority of Taiwanese application no. 097114220, filed on Apr. 18, 2008.
1. Field of the Invention
This invention relates to a memory device and a test method thereof, more particularly to a memory device and test method thereof capable of detecting a coupling fault between a value memory array and a mask memory array of a ternary content-addressable memory.
2. Description of the Related Art
A ternary content-addressable memory (TCAM) includes a value memory array and a mask memory array. The value memory array is for storing a plurality of value bits, and the mask memory array is for storing a plurality of mask bits for masking the value memory array. In operation, the value bit and the mask bit cooperate to indicate one of three possible states: “0”, “1”, and “don't care”.
In a conventional test method for testing the ternary content-addressable memory in order to determine whether the ternary content-addressable memory is faulty, testing is first performed on the value memory array, and after completing testing of the value memory array, testing is then performed on the mask memory array.
Since the conventional test method tests the value memory array and the mask memory array separately, the conventional test method lacks the ability to detect a coupling fault resulting from an interaction between the value memory array and the mask memory array of the ternary content-addressable memory.
Therefore, an object of the present invention is to provide a memory device that is capable of detecting a coupling fault between two memory arrays.
According to one aspect of the present invention, there is provided a memory device comprising a memory array unit and a test module.
The memory array unit includes a value memory array for storing a value bit, and a mask memory array coupled to the value memory array for storing a mask bit for masking the value memory array. The test module is coupled to the memory array unit for generating a test pattern signal that is based on a test rule and that is provided to the memory array unit for performing testing on the memory array unit.
The test rule includes a number (M) of first test segments for testing the value memory array and a number (N) of second test segments for testing the mask memory array. The first test segments and the second test segments are interleaved in the test rule. M and N are integers not smaller than 2.
Another object of the present invention is to provide a test method capable of detecting a coupling fault between two memory arrays.
According to another aspect of the present invention, there is provided a test method for testing a memory array unit. The memory array unit includes a value memory array and a mask memory array. The test method comprises the steps of:
generating a test pattern signal that is based on a test rule and that is provided to the memory array unit for performing testing on the memory array unit; and
based on an output value from the memory array unit, generating a test result;
wherein, the test rule includes a number (M) of first test segments for testing the value memory array, and a number (N) of second test segments for testing the mask memory array, the first test segments and the second test segments are interleaved in the test rule, and M and N are integers not smaller than 2.
Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which:
In this embodiment, the memory array unit 3 is a ternary content-addressable memory (TCAM) that includes a value memory array 31 and a mask memory array 32. The value memory array 31 is for storing at least one value bit, and the mask memory array 32 is for storing at least one mask bit for masking the value memory array 31.
The multiplexer 2 is for permitting output of one of a test pattern signal (TEST PATTERN) and a data signal (DATA) to the memory array unit 3 in accordance with a selection control signal (SEL). In use, when the memory device operates in a normal mode, the multiplexer 2 permits output of the data signal (DATA). If, in accordance with this embodiment, the memory device is used in a network router, the data signal (DATA) can be a network data signal, such as an IP address. On the other hand, when the memory device operates in a test mode for performing testing on the memory array unit 3, the multiplexer 2 permits output of the test pattern signal (TEST PATTERN).
The test module 1 is coupled to the multiplexer 2 and the memory array unit 3, and generates the test pattern signal (TEST PATTERN) that is based on a test rule 4 (see
In this embodiment, the first test segments 41 and the second test segments 42 of the test rule 4 utilize a test algorithm, more particularly, a March C+ test algorithm. The March C+ test algorithm includes the following six test elements:
test element (1): (w0);
test element (2): (r0,w1,r1);
test element (3): (r1,w0,r0);
test element (4): (r0,w1,r1);
test element (5): (r1,w0,r0); and
test element (6): (r0);
wherein, denotes an ascending progression from address 0 to address n−1,
denotes a descending progression from address n−1 to address 0, w0 denotes an operation in which a bit value of 0 is written, w1 denotes an operation in which a bit value of 1 is written, r0 denotes a read operation in which an expected bit value is 0, and r1 denotes a read operation in which an expected bit value is 1.
The test rule 4 therefore includes six of the first test segments 41 interleaved with six of the second test segments 42 as follows:
first test segment 41 (1): (wI0);
second test segment 42 (1): (wII0)
first test segment 41 (2): (rI0,wI1,rI1)
second test segment 42 (2): (rII0,wII1,rII1)
first test segment 41 (3): (rI1,wI0,rI0);
second test segment 42 (3): (rII1,wII0,rII0);
first test segment 41 (4): (rI0,wI1,rI1);
second test segment 42 (4): (rII0,wII1,rII1);
first test segment 41 (5):(rI1, wI0, rI0);
second test segment 42 (5): (rII1,wII0,rII0);
first test segment 41 (6): (rI0); and
second test segment 42 (6): (rII0);
wherein, I indicates an operation performed on the value memory array 31, and II indicates an operation performed on the mask memory array 32.
The preferred embodiment of the memory device is thus not only capable of providing inherent error detection capabilities of the test algorithm, but owing to the interleaving of the first test segments 41 and the second test segments 42 in the test rule 4, is also capable of detecting a coupling fault between the two memory arrays 31, 32, thereby overcoming the drawback of the prior art.
In addition, the memory device can determine whether the memory array unit 3 is faulty based on an output value detected from the memory array unit 3, such as an output value of a match signal (MATCHOUT) or a data signal (DOUT) as shown in
It is noted that, in this invention, the test algorithm can be one other than the March C+test algorithm, and the memory array unit 3 can be one other than the ternary content-addressable memory, and are not limited to what has been described herein.
While the present invention has been described in connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifications and equivalent arrangements.
Number | Date | Country | Kind |
---|---|---|---|
097114220 | Apr 2008 | TW | national |