Memory testing method and memory apparatus therefor

A memory testing method for testing a memory apparatus configured with an auxiliary testing circuit is provided. The memory testing method includes: reading a test data from a memory array of the memory; and encoding the test data into an encoded data by the auxiliary testing circuit, wherein the encoded data comprises a first piece data and a second piece data. The encoded data is encoded to include a first piece data and a second piece data, where the first piece data indicates a number of a binary state in the read test data, and the second piece data indicates an error bit in the read test data. In addition, a memory apparatus for the memory testing method is also provided.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention generally relates to a memory storage apparatus, in particular, to a memory testing method and a memory apparatus for the memory testing method.

2. Description of Related Art

Generally, write data to be written to a rewritable non-volatile memory (NVM) adopting an error correcting codes (ECC) scheme may be encoded according to the ECC scheme. Accordingly, data actually written into the memory may include main bits and parity bits of the write data. Data read from the rewritable non-volatile memory may also be processed by a corresponding decoding procedure.

For purposes of improving reliability and quality, comprehensive testing has to be carried out on every memory cells. In the case of the memory adopting the ECC scheme, the main bits and the parity bits should be read separately for testing. Therefore, it takes twice of read times when testing memories adopting the ECC scheme.

SUMMARY OF THE INVENTION

Accordingly, the invention is directed to a memory testing method and a memory apparatus for the memory testing method. By adopting the memory testing method, the testing time may be reduced thus the testing efficiency may be improved.

An exemplary embodiment of the invention provides a memory testing method for testing a memory apparatus configured with an auxiliary testing circuit. The memory testing method includes: reading a test data from a memory array of the memory; and encoding the test data into an encoded data by the auxiliary testing circuit, wherein the encoded data comprises a first piece data and a second piece data. The encoded data is encoded to include a first piece data and a second piece data, where the first piece data indicates a number of a binary state in the read test data, and the second piece data indicates an error bit in the read test data.

An exemplary embodiment of the invention provides a memory apparatus including a connection interface, a memory array, an auxiliary testing circuit, and a memory control circuit. The connection interface is coupled to a host system. The memory array is configured to store test data. The memory control circuit is coupled to the connection interface, the memory array and the auxiliary testing circuit, and configured to read the test data from the memory array. The auxiliary testing circuit is configured to encode the test data read by the memory control circuit into an encoded data. The encoded data in encoded to include a first piece data and a second piece data, where the first piece data indicates a number of a binary state in the read test data, and the second piece data indicates an error bit in the read test data.

Based on the above, by adopting the memory testing method and the memory apparatus provided in the invention, an encoded data may be generated according to test data read from the memory array. The encoded data is encoded to include an information of the number of a binary state in the read test data and an information of the location of an error bit existed in the read test data, such that info nation needed for testing the memory apparatus may be easily obtained from the encoded data. Accordingly, the testing time for testing the memory apparatus may be reduced thus the testing efficiency may be improved.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1is a block diagram illustrating a memory apparatus according to an embodiment of the invention. Referring toFIG. 1, the memory apparatus100includes a connection interface110, a memory array120, a memory control circuit130and an auxiliary testing circuit140. The memory control circuit130is coupled to the connection interface110, the memory array120and the auxiliary testing circuit140. In the present embodiment, the memory apparatus100is a non-volatile memory adopting an ECC scheme.

The connection interface110is coupled to the memory control circuit130and configured to couple to a host system. In the present embodiment, the connection interface110is coupled to the host system for establishing a communication between the host system and the memory control circuit130. In the present embodiment, the connection interface110is compatible with a common flash memory interface (CFI) standard, but the invention is not limited thereto. In other embodiments, the connection interface110may be compatible with a serial advanced technology attachment (SATA) standard, a peripheral component interconnect Express (PCI-E) interface standard, a universal serial bus (USB) standard, an integrated device electronics (IDE) interface standard or other suitable standards.

The memory array120is coupled to the memory control circuit130and includes a plurality of memory cells. In the present embodiment, the memory array120is configured to store data, including test data comprised of 32 main bits and 7 parity bits, for example, but which is not limited herein.

The memory control circuit130is coupled to the connection interface110, the memory array120and the auxiliary testing circuit140. In the present embodiment, the memory control circuit130receives a test command from the host system for writing a test data comprised of 32 main bits and 7 parity bits into the memory array120. Then, the memory control circuit130and the auxiliary testing circuit140may collaboratively perform the memory testing method introduced in the invention for testing the memory array120. The steps of the memory testing method will be described in detail in the following descriptions.

It is noted that, the auxiliary testing circuit140is disposed outside the memory control circuit130in the present embodiment, but which is not limited herein. In other embodiments, the auxiliary testing circuit140and the memory control circuit130may be integrated into a memory controller. It is also noted that the memory control circuit130and the auxiliary testing circuit140may be implemented in a form of hardware or firmware.

FIG. 2illustrates a flowchart of a memory testing method according to an embodiment of the invention. The memory testing method may be performed by the memory apparatus100of the embodiment ofFIG. 1. Therefore, the memory testing method will be illustrated by referring to the aforementioned memory apparatus100in the present embodiment.

In step S210, the memory control circuit130may receive a test command from the host system through the connection interface110for testing the memory array120of the memory apparatus100, and write a test data of one of a target pattern into the memory array120according to the test command.

FIG. 3is a schematic diagram illustrating a target pattern according to an embodiment of the invention. Referring toFIG. 3, in the present embodiment, the target pattern includes an all-one pattern, an all-zero pattern, a checkerboard pattern (i.e., 101010 . . . ), and an inverse checkerboard pattern (i.e., 010101 . . . ). The test data written into the memory array120is in the all-one pattern. To be specific, the test data consists of 32 main bits and 7 parity bits, the memory control circuit130writes 32 main bits and 7 parity bits into the memory array120and all of the written bits are 1's. However, the invention is not limited herein.

In other embodiments, the test data written into the memory array120may be in the all-zero pattern, the checkerboard pattern, or the inverse checkerboard pattern of the target pattern. On the other hands, the target pattern may include only part of those patterns, or the target pattern may include other patterns defined by users performing the introduced memory testing method according to their requirements in the other embodiments, which are not limited in the invention.

After writing the test data into the memory array120, step S220is entered. In step S220, the memory control circuit130may read the test data from the memory array120. In the present embodiment, the memory control circuit130may apply a read voltage on the memory cells storing the test data, so as to read all 39 bits of the test data from the memory array120. It is noted that the test data read in the step S220may not be identical to the test data written in the step S210due to various reasons such as abnormal bits existed in the memory array120, but which is not limited herein. Therefore, it is helpful for testing the memory apparatus100by finding out the abnormal bits/cells existed in the memory array120.

In step S230, the auxiliary testing circuit140may encode the read test data into an encoded data. To be specific, the encoded data includes a first piece data and a second piece data, where the first piece data indicates a number of a binary state in the read test data, and the second piece data indicates an error bit in the read test data. As a result, the margin read voltage of the memory array120may be figured out by referring to the first piece data of the encoded data, and the abnormal bits/cells existed in the memory array120may be easily found and fixed by referring to the second piece data of the encoded data.

In the present embodiment, the step S230further includes steps S231to S235, respectively performed by a counter circuit, a comparing circuit and an encoding circuit included in the auxiliary testing circuit140.

In the step S231, the counter circuit may calculate the number of the binary state in the read test data. In the present embodiment, the counter circuit may calculate the number of 1's in the read test data for recording the calculation result into the first piece data of the encoded data, but which is not limited herein. In other embodiment, the counter circuit may calculate the number of 0's in the read test data.

In the step S233, the comparing circuit may compare the read test data with the target pattern for finding the error bits in the read test data. In the present embodiment, the comparing circuit may compare the read test data with each target pattern shown inFIG. 3to obtain a comparison result. To be specific, the comparing circuit may compare the read test data with the all-one pattern to obtain a first result, compare the read test data with the all-zero pattern to obtain a second result, compare the read test data with the checkerboard pattern to obtain a third result, and compare the read test data with the inverse checkerboard pattern to obtain a fourth result. The first, second, third and fourth result may include the information of the bit differences between the read test data and each pattern.

In the present embodiment, the test data written in the step S210is in the all-one pattern. Therefore, the first result may include the information of the error bit in the test data read in the step S220, where said information may include the number and the location of the error bit existed in the read test data, but which is not limited thereto.

In the step S235, the encoding circuit may record the calculation result of the step S231into the first piece data of the encoded data and record the comparison result of the step S233into the second piece data of the encoded data. Regarding the first piece data, the number of 1's in the read test data is recorded therein in the present embodiment. Regarding the second piece data, the first result, the second result, the third result and the fourth result are recorded therein in the present embodiment. Accordingly, the encoded data may be completed in the step S230.

Several cases of the present embodiment are described in detail below accompanied withFIGS. 4-6.FIGS. 4-6are schematic diagrams illustrating test data and the corresponding encoded data according to an embodiment of the invention.

Referring toFIG. 4, all bits of the read test data RTD are 1's, which means that the test data RTD read in the step S220is identical to the test data WTD written in the step S210. In the present embodiment, the encoded data is a 32-bit data, where the first six bits (i.e., the 1thto 6thbits) are used to record the first piece data. To be specific, the number of 1's in the read test data RTD is 39, therefore the first piece data is recorded as “39” (i.e., “100111” in binary).

In the present embodiment, the 7thto 30thbits of the encoded data are used to record the second piece data. In which, the 7thto 12thbits are used to record the first result, the 13thto 18thbits are used to record the second result, the 19thto 24thbits are used to record the third result, and the 25thto 30thbits are used to record the fourth result. Each result is recorded as the location of the difference between compared corresponding target pattern and the read test data RTD1 when there is only one different bit therebetween.

It is noted that the read test data is a 39-bit data in the present embodiment, therefore numbers of 0 to 38 (i.e., “000000” to “100110” in binary) are enough for recording the location of the different bit. Accordingly, when there is no different bit between the read test data and the compared corresponding target pattern, it can be recorded as “111111” in the present embodiment. On the other hand, when there are more than two different bits between the read test data and the compared corresponding target pattern, it can be recorded as “111110” in the present embodiment.

Referring back toFIG. 4, since the test data written in the step S210is in the all-one pattern, the first result may show that there is no different bit between the read test data RTD and the all-one pattern. Accordingly, the 7thto 12thbits of the encoded data ECD is recorded as “111111” for indicating no different bit. Since the test data written in the step S210is in the all-one pattern as well, no different bit between the read test data RTD and the all-one pattern is also representing no error bit existed in the read test data RTD. Accordingly, the “111111” recorded in the 7thto 12thbits of the encoded data ECD is also indicating the no-error-bit information.

The comparing circuit also compare the read test data RTD with the all-zero pattern to obtain the second result. The second result may show that there are more than one different bits (i.e., 39 different bits) between the read test data RTD and the all-zero pattern. Accordingly, the 13thto 18thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the all-zero pattern. Similarly, the 19thto 24thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the checkerboard pattern, and the 25thto 30thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the inverse checkerboard pattern. Finally, the encoding circuit may generate the encoded data of “xx111110111110111110111111100111”. The 31thand 32thbits of the encoded data are marked as “xx” since these two bits are reserved and bearing no information in the present embodiment.

Referring toFIG. 5, the 27thbit of the read test data RTD is 0, and the other bits of the read test data RTD are 1's. The different bit between the read test data RTD and the all-one pattern (i.e., error bit) is the 27thbit, where the bit address thereof is 26.

Based on the read test data RTD shown inFIG. 5, the 1thto 6thbits of the encoded data ECD is recorded as “100110” for indicating total 38 bits of 1's are read. On the other hand, the 7thto 12thbits of the encoded data ECD is recorded as “011010” for indicating the bit address of the error bit (i.e., 26) in the read test data RTD. Besides, the 13thto 18thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the all-zero pattern. Similarly, the 19thto 24thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the checkerboard pattern, and the 25thto 30thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the inverse checkerboard pattern. Finally, the encoding circuit may generate the encoded data of “xx11111011111011110011010100110”. The 31thand 32thbits of the encoded data are marked as “xx” for the same reason described before.

Referring toFIG. 6, the 1thand 27thbits of the read test data RTD are 0's, and the other bits of the read test data RTD are 1's. The different bits between the read test data RTD and the all-one pattern (i.e., error bits) are the 1thand 27thbits, where the bit addresses thereof are 0 and 26.

Based on the read test data RTD shown inFIG. 6, the 1thto 6thbits of the encoded data ECD is recorded as “100101” for indicating total 37 bits of 1's are read. On the other hand, the 7thto 12thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bits between the read test data RTD and the all-one pattern. Accordingly, the “111110” recorded in the 7thto 12thbits of the encoded data ECD is also indicating the multiple-error-bits information. Besides, the 13thto 18thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the all-zero pattern. Similarly, the 19thto 24thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the checkerboard pattern, and the 25thto 30thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the inverse checkerboard pattern. Finally, the encoding circuit may generate the encoded data of “xx111110111110111110111110100101”. The 31thand 32thbits of the encoded data are marked as “xx” for the same reason described before.

According to the embodiment described in the above, the encoding circuit may encode the test data read from the memory array120into the encoded data. Then, in step S240, the memory control circuit130may output the encoded data to the host system through the connection interface110for later use. For example, the user or tester performing the introduced memory testing method may figure out the location of error bit in the read test data by referring to the second piece data of the encoded data. Based on such information, the user or tester may replace a certain bit line for fixing the abnormal bit.

It is noted that, in the present embodiment of writing test data in the all-one pattern, the user or tester who cares about the abnormal bit existed in the memory array120may focused in the 7thto 12thbits of the encoded data ECD and not aware of the information recorded in the 13thto 32thbits of the encoded data ECD. In the other words, the encoded data ECD may include more than enough information for one testing the memory apparatus100.

In the aforementioned embodiment, the test data written into the memory array120is in the all-one pattern. However, the invention is not limited thereto. In other embodiments, the test command may require the test data to be written in other patterns.

FIG. 7is a schematic diagram illustrating test data and the corresponding encoded data according to another embodiment of the invention. Different from the aforementioned embodiment, the test data WTD written into the memory array120is in the inverse checkerboard pattern in the embodiment ofFIG. 7.

In the embodiment, the test data RTD read from the memory array120is “010111010101010101010101010101010101010”, which means that there is one error bit in the bit address of 34.

Accordingly, the to 6thbits of the encoded data ECD is recorded as “010100” for indicating total 20 bits of 1's are read. The 7thto 12thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bits between the read test data RTD and the all-one pattern. The 13thto 18thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the all-zero pattern. Similarly, the 19thto 24thbits of the encoded data ECD is recorded as “111110” for indicating more than one different bit between the read test data RTD and the checkerboard pattern, and the 25thto 30thbits of the encoded data ECD is recorded as “100010” for indicating the bit address of the error bit (i.e., 34) in the read test data RTD. Finally, the encoding circuit may generate the encoded data of “xx100010111110111110111110010100”. The 31thand 32thbits of the encoded data are marked as “xx” for the same reason described before.

According to the above, the encoding circuit may generate the encoded data according to various patterns of the read test data fed into the auxiliary testing circuit140, and the encoded data may include enough information needed for the user or tester who is testing the memory array120of the memory apparatus100.

In summary, by adopting the memory testing method and the memory apparatus provided in the invention, an encoded data may be generated according to a read after write (RAW) data. The encoded data is encoded to include an information of the number of a binary state in the RAW data and an information of the location of an error or bit existed in the RAW data, such that information needed for testing the memory apparatus may be easily obtained from the encoded data. In one embodiment of the invention, a second read operation for reading the parity bits is not needed anymore for completely testing an ECC memory apparatus. Accordingly, the testing time for testing the memory array of the memory apparatus may be reduced thus the testing efficiency may be improved.