Storage controller and test data generating method

By using a predetermined zero-to-one ratio and integer range in the storage controller to generate test data that conforms to a specific ratio, the problem of testing sensitive blocks in flash memory devices is solved, and the stability and testing efficiency of flash memory read and write are improved.

CN112764977BActive Publication Date: 2024-08-27HOSIN GLOBAL ELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN201911072876.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-05
Publication Date
2024-08-27
Estimated Expiration
2039-11-05

AI Technical Summary

Technical Problem

During the mass production of large-capacity flash memory storage devices, data read and write tests need to be performed on the flash memory to determine the available blocks. However, some blocks are sensitive to specific data, making it difficult to effectively improve the read and write stability of the flash memory.

Method used

A memory controller is designed, including a connection interface circuit, a memory interface control circuit and a test data circuit unit. The conversion threshold is determined by predetermining the zero-to-one ratio and the integer range, and the test data is randomly generated to ensure the 0 and 1 ratio of the test data. Meets specific ratios and is used for reliability testing of rewritable non-volatile memory modules.

Benefits of technology

On the basis of ensuring the naturalness of the data, it is possible to generate customized zero-to-one ratio test data to ensure the integrity of the test data for the reliability test of the rewritable non-volatile memory module block, and improve the test efficiency and flexibility. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112764977B
    Figure CN112764977B
Patent Text Reader

Abstract

The present invention provides a storage controller and a test data generation method. The method comprises the following steps: (1) determining a conversion threshold value according to the predetermined zero-one ratio corresponding to the test data and the predetermined integer range, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range; (2) generating a target random integer in the predetermined integer range; (3) determining whether the target random integer is greater than the conversion threshold value; wherein in response to determining that the target random integer is greater than or not greater than the conversion threshold value, the target random integer is converted to 1 or 0, and the i-th bit of the test data is set to the target random integer; and (4) determining whether i is equal to N, wherein in response to determining that i is not equal to N, i is added by 1, and step (2) is re-executed; wherein in response to determining that i is equal to N, the test data is responded to according to the set N bits of the test data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a storage controller and a test data generating method used by the storage controller. Background Art

[0002] In the mass production of some large-capacity flash storage devices, in order to confirm the quality of the flash memory, some or all of the data read and write tests will be performed on the flash memory to determine the available blocks in the flash memory. In particular, some flash memory blocks are more sensitive to specific data, so different data needs to be used to test these blocks, so that the blocks with higher sensitivity can be eliminated, thereby improving the stability of flash memory reading and writing. Summary of the invention

[0003] The present invention is directed to a storage controller for controlling a storage device equipped with a rewritable non-volatile memory module and a test data generating method used by the storage controller.

[0004] An embodiment of the present invention provides a storage controller for controlling a storage device configured with a rewritable non-volatile memory module. The storage controller includes: a connection interface circuit, a memory interface control circuit, a test data circuit unit and a processor. The connection interface circuit is used to couple to a host system. The memory interface control circuit is used to couple to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical pages. The processor is coupled to the connection interface circuit, the memory interface control circuit and the test data circuit unit. The processor is used to instruct the test data circuit unit to perform a test data generation operation according to a predetermined zero-to-one ratio and a predetermined integer range of corresponding test data to generate test data. The test data generation operation includes the following steps: (1) determining a conversion threshold value according to the predetermined zero-to-one ratio corresponding to the test data and the predetermined integer range, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range; (2) generating a target random integer within the predetermined integer range; (3) determining whether the target random integer is greater than the conversion threshold value; wherein in response to determining that the target random integer is greater than the conversion threshold value, converting the target random integer to 1, and setting the i-th bit of the test data to the target random integer, wherein the initial value of i is 1, The test data has a total of N bits, where N is a positive integer, wherein in response to determining that the target random integer is not greater than the conversion threshold value, the target random integer is converted to 0, and the i-th bit of the test data is set to the target random integer; and (4) determining whether i is equal to N, wherein in response to determining that i is not equal to N, 1 is added to i, and step (2) is re-executed; wherein in response to determining that i is equal to N, the test data is responded to the processor according to the set N bits of the test data, so that the test data is written to the rewritable non-volatile memory module via the processor.

[0005] In an embodiment of the present invention, the plurality of consecutive integers in the predetermined integer range are 1 to 100.

[0006] In one embodiment of the present invention, the predetermined zero-to-one ratio is used to represent the ratio of the total number of the plurality of bit values ​​“0” and the total number of the plurality of bit values ​​“1” in all the bit values ​​of the test value after the expected generation.

[0007] In one embodiment of the present invention, the conversion threshold value is equal to the sum of the starting values ​​of the multiple consecutive integers plus a first value, wherein the first value is the second value minus 1, wherein the second value is the total number of the multiple consecutive integers multiplied by the proportion of the value 0, wherein the proportion of the value 0 is calculated via the predetermined zero-to-one ratio.

[0008] An embodiment of the present invention provides a test data generation method for generating test data for a rewritable non-volatile memory module to be written into a storage device. The method comprises the following steps: (1) determining a conversion threshold value according to the predetermined zero-one ratio corresponding to the test data and the predetermined integer range, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range; (2) generating a target random integer within the predetermined integer range; (3) determining whether the target random integer is greater than the conversion threshold value; wherein in response to determining that the target random integer is greater than the conversion threshold value, the target random integer is converted to 1, and the i-th bit of the test data is set to the target random integer, wherein the initial value of i is The value is 1, and the test data has a total of N bits, wherein N is a positive integer, wherein in response to determining that the target random integer is not greater than the conversion threshold value, the target random integer is converted to 0, and the i-th bit of the test data is set to the target random integer; and (4) determining whether i is equal to N, wherein in response to determining that i is not equal to N, 1 is added to i, and step (2) is re-executed; wherein in response to determining that i is equal to N, the test data is responded to according to the set N bits of the test data, so that the test data is written to the rewritable non-volatile memory module.

[0009] Based on the above, the storage controller and test data generation method provided by the embodiment of the present invention can correspond to the predetermined zero-to-one ratio and the predetermined integer range of the test data, and control the ratio between the total number of 0s and 1s in all bit values ​​of the test data generated in a random manner by customizing the predetermined zero-to-one ratio and the predetermined integer range. In this way, customized test data with different zero-to-one ratios can be generated while ensuring that the data is relatively natural, so as to efficiently and flexibly generate test data that meets the specific zero-to-one ratio requirements, thereby maintaining the integrity of the reliability test performed on multiple blocks of the rewritable non-volatile memory module through the generated test data. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and together with the description serve to explain the principles of the present invention.

[0011] Figure 1 FIG. 4 is a block diagram of a host system and a storage device according to an embodiment of the present invention.

[0012] Figure 2 The figure is a flow chart of a test data generating method according to an embodiment of the present invention.

[0013] Figure 3 FIG. 4 is a schematic diagram of a predetermined zero-to-one ratio and a conversion threshold value according to an embodiment of the present invention.

[0014] Figure 4 FIG. 4 is a schematic diagram of setting test data according to an embodiment of the present invention.

[0015] Description of Figure Numbers

[0016] 10: Host system

[0017] 110, 211: Processor

[0018] 120: Host memory

[0019] 130: Data transmission interface circuit

[0020] 210: Storage controller

[0021] 212: Data management circuit

[0022] 213: Memory interface control circuit

[0023] 214: Error checking and correction circuit

[0024] 215: Test data circuit unit

[0025] 216: Buffer memory

[0026] 217: Power Management Circuit

[0027] 220: Rewritable non-volatile memory module

[0028] 230: Connecting interface circuit

[0029] S21, S22, S23, S24, S25, S26, S27, S28: Process steps 300, 400 of the test data generation method: test data

[0030] A31, A411-A412, A421-A422, A431-A432, A441-A442, A451-A452, A461-A462, A471-A472, A481-A482: Arrow

[0031] 400(1)~400(8): bit / bit DETAILED DESCRIPTION

[0032] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0033] Figure 1 FIG. 1 is a block diagram of a host system and a storage device according to an embodiment of the present invention. Figure 1 , the host system 10 is, for example, a personal computer, a notebook computer, or a server. The host system 10 includes a processor 110, a host memory 120, a data transfer interface circuit 130, and a storage device 140. In the present embodiment, the processor 110 is coupled (also referred to as electrically connected) to the host memory 120, the data transfer interface circuit 130, and the storage device. In another embodiment, the processor 110, the host memory 120, the data transfer interface circuit 130, and the storage device 140 are coupled to each other using a system bus. In the present embodiment, the processor 110, the host memory 120, and the data transfer interface circuit 130 can be disposed on a motherboard of the host system 10.

[0034] The storage device 20 includes a storage controller 210, a rewritable non-volatile memory module 220 and a connection interface circuit 230. The storage controller 210 includes a processor 211, a data management circuit 212 and a memory interface control circuit 213.

[0035] In this embodiment, the host system 10 is coupled to the storage device 20 through the data transmission interface circuit 130 and the connection interface circuit 230 of the storage device 20 to perform data access operations. For example, the host system 10 can store data to the storage device 20 or read data from the storage device 20 via the data transmission interface circuit 130.

[0036] In this embodiment, the number of the data transmission interface circuit 130 can be one or more. Through the data transmission interface circuit 130, the motherboard can be coupled to the storage device 20 via a wired or wireless manner. The storage device 20 can be, for example, a USB flash drive, a memory card, a solid state drive (SSD) or a wireless memory storage device. The wireless memory storage device can be, for example, a near field communication (NFC) memory storage device, a wireless fax (WiFi) memory storage device, a Bluetooth memory storage device or a low power consumption Bluetooth memory storage device (e.g., iBeacon) and other memory storage devices based on various wireless communication technologies. In addition, the motherboard can also be coupled to various I / O devices such as a global positioning system (GPS) module, a network interface card, a wireless transmission device, a keyboard, a screen, a speaker, etc. through the system bus.

[0037] In this embodiment, the data transmission interface circuit 130 and the connection interface circuit 230 are interface circuits compatible with the high-speed peripheral component interconnect interface (Peripheral Component Interconnect Express, PCI Express) standard. In addition, the data transmission interface circuit 130 and the connection interface circuit 230 use the fast non-volatile memory interface standard (Non-Volatile Memory express, NVMe) communication protocol to transmit data.

[0038] However, it should be understood that the present invention is not limited thereto, and the data transmission interface circuit 130 and the connection interface circuit 230 may also comply with the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, the Serial Advanced Technology Attachment (SATA) standard, the Universal Serial Bus (USB) standard, the SD interface standard, the Ultra High Speed-I (UHS-I) interface standard, the Ultra High Speed-II (UHS-II) interface standard, the Memory Stick (MS) interface standard, the Multi-Chip Package (MCP) interface standard, the Multi Media Card (MMC) interface standard, the eMMC interface standard, the Universal Flash Storage (UFS) interface standard, the eMCP interface standard, the CF interface standard, the Integrated Device Electronics (IDE) standard or other suitable standards. Furthermore, in another embodiment, the connection interface circuit 230 and the memory controller 210 may be packaged in one chip, or the connection interface circuit 230 may be disposed outside a chip including the memory controller 210 .

[0039] In the present embodiment, the host memory 120 is used to temporarily store instructions or data executed by the processor 110. For example, in the present embodiment, the host memory 120 may be a dynamic random access memory (DRAM), a static random access memory (SRAM), etc. However, it should be understood that the present invention is not limited thereto, and the host memory 120 may also be other suitable memories.

[0040] The storage controller 210 is used to execute a plurality of logic gates or control instructions implemented in hardware or firmware and perform operations such as writing, reading and erasing data in the rewritable non-volatile memory module 220 according to instructions of the host system 10 .

[0041] In more detail, the processor 211 in the storage controller 210 is hardware with computing capabilities, which is used to control the overall operation of the storage controller 210. Specifically, the processor 211 is programmed by a plurality of control instructions / program codes, and when the storage device 20 operates, these control instructions / program codes are executed to perform operations such as writing, reading, and erasing data. In addition, in this embodiment, the control instructions / program codes can also be executed to perform test data generation operations to implement the test data generation method provided by the present invention.

[0042] It is worth mentioning that in the present embodiment, the processor 110 and the processor 211 are, for example, a central processing unit (CPU), a microprocessor, or other programmable processing units (Microprocessor), a digital signal processor (DSP), a programmable controller, an application specific integrated circuit (ASIC), a programmable logic device (PLD) or other similar circuit elements, but the present invention is not limited thereto.

[0043] In one embodiment, the storage controller 210 also has a read-only memory (not shown) and a random access memory (not shown). In particular, the read-only memory has a boot code, and when the storage controller 210 is enabled, the processor 211 first executes the boot code to load the control instructions stored in the rewritable non-volatile memory module 220 into the random access memory of the storage controller 210. Afterwards, the processor 211 runs these control instructions to perform operations such as writing, reading and erasing data. In another embodiment, the control instructions of the processor 211 can also be stored in a specific area of ​​the rewritable non-volatile memory module 220 in the form of program code, for example, in a physical storage unit in the rewritable non-volatile memory module 220 dedicated to storing system data.

[0044] In this embodiment, as described above, the storage controller 210 further includes a data management circuit 212 and a memory interface control circuit 213. It should be noted that the operations performed by the components of the storage controller 210 can also be regarded as the operations performed by the storage controller 210.

[0045] The data management circuit 212 is coupled to the processor 211, the memory interface control circuit 213 and the connection interface circuit 230. The data management circuit 212 is used to receive instructions from the processor 211 to transmit data. For example, data is read from the host system 10 (e.g., the host memory 120) via the connection interface circuit 230, and the read data is written to the rewritable non-volatile memory module 220 via the memory interface control circuit 213 (e.g., the write operation is performed according to the write instruction from the host system 10). For another example, data is read from one or more physical units of the rewritable non-volatile memory module 220 via the memory interface control circuit 213 (the data can be read from one or more storage units in the one or more physical units), and the read data is written to the host system 10 (e.g., the host memory 120) via the connection interface circuit 230 (e.g., the read operation is performed according to the read instruction from the host system 10). In another embodiment, the data management circuit 212 can also be integrated into the processor 211.

[0046] The memory interface control circuit 213 is used to receive instructions from the processor 211 and cooperate with the data management circuit 212 to perform a write (also called programming) operation, a read operation or an erase operation on the rewritable non-volatile memory module 220 .

[0047] For example, the processor 211 may execute a write instruction sequence to instruct the memory interface control circuit 213 to write data into the rewritable non-volatile memory module 220; the processor 211 may execute a read instruction sequence to instruct the memory interface control circuit 213 to read data from one or more physical units of the rewritable non-volatile memory module 220 corresponding to the read instruction; the processor 211 may execute an erase instruction sequence to instruct the memory interface control circuit 213 to perform an erase operation on the rewritable non-volatile memory module 220. The write instruction sequence, the read instruction sequence, and the erase instruction sequence may respectively include one or more program codes or instruction codes and are used to instruct the execution of corresponding write, read, and erase operations on the rewritable non-volatile memory module 220. In one embodiment, the processor 211 may also issue other types of instruction sequences to the memory interface control circuit 213 to execute corresponding operations on the rewritable non-volatile memory module 220.

[0048] In addition, the data to be written to the rewritable non-volatile memory module 220 will be converted into a format acceptable to the rewritable non-volatile memory module 220 via the memory interface control circuit 213. Specifically, if the processor 211 wants to access the rewritable non-volatile memory module 220, the processor 211 will transmit a corresponding instruction sequence to the memory interface control circuit 213 to instruct the memory interface control circuit 213 to perform a corresponding operation. For example, these instruction sequences may include a write instruction sequence indicating writing data, a test data write instruction sequence indicating writing test data, a read instruction sequence indicating reading data, an erase instruction sequence indicating erasing data, and corresponding instruction sequences for indicating various memory operations. These instruction sequences may include one or more signals, or data on the bus. These signals or data may include instruction codes or program codes. For example, in a read instruction sequence, information such as a read identification code and a memory address may be included.

[0049] In addition, the storage controller 210 will establish a logical to physical address mapping table (Logical To Physical address mapping table) and a physical to logical address mapping table (Physical To Logical address mapping table) to record the address mapping relationship between the logical unit (e.g., logical block, logical page or logical sector) and the physical unit (e.g., physical erase unit / physical block, physical page, physical sector) configured for the rewritable non-volatile memory module 220. In other words, the storage controller 210 can use the logical to physical address mapping table to find the physical unit mapped by a logical unit (e.g., find the physical page mapped by the logical page; find the physical address mapped by the logical address), and the storage controller 210 can use the physical to logical address mapping table to find the logical unit mapped by a physical unit (e.g., find the logical page mapped by the physical page; find the logical address mapped by the physical address). However, the above technical concepts related to the mapping of logical units and physical units are conventional technical means of those skilled in the art and are not the technical solutions to be described in the present invention, and will not be repeated here.

[0050] In the present embodiment, the error checking and correction circuit 214 is coupled to the processor 211 and is used to perform an error checking and correction procedure to ensure the correctness of the data. Specifically, when the processor 211 receives a write instruction from the host system 10, the error checking and correction circuit 214 generates a corresponding error correction code (ECC) and / or an error detecting code (EDC) for the data corresponding to the write instruction, and the processor 211 writes the data corresponding to the write instruction and the corresponding error correction code and / or error checking code into the rewritable non-volatile memory module 220. Afterwards, when the processor 211 reads data from the rewritable non-volatile memory module 220, the error correction code and / or error checking code corresponding to the data will be read at the same time, and the error checking and correction circuit 214 will perform an error checking and correction procedure on the read data according to the error correction code and / or error checking code. In addition, after the error checking and correction process, if the read data is successfully decoded, the error checking and correction circuit 214 may return the error bit number (also called error bit value) to the processor 211. If the error bit number corresponding to a piece of data is higher, the processor 211 may determine that the physical state of the physical unit (e.g., physical sector / physical page / physical block) used to store the data is worse.

[0051] In one embodiment, the storage controller 210 further includes a buffer memory 216 and a power management circuit 217. The buffer memory is coupled to the processor 211 and is used to temporarily store data and instructions from the host system 10, data from the rewritable non-volatile memory module 220, or other system data used to manage the storage device 20, so that the processor 211 can quickly access the data, instructions or system data from the buffer memory 216. The power management circuit 217 is coupled to the processor 211 and is used to control the power of the storage device 20.

[0052] The rewritable non-volatile memory module 220 is coupled to the memory controller 210 (memory interface control circuit 213 ) and is used to store data written by the host system 10 . The rewritable non-volatile memory module 220 may be a single-level cell (SLC) NAND flash memory module (i.e., a flash memory module in which one storage cell can store one bit), a multi-level cell (MLC) NAND flash memory module (i.e., a flash memory module in which one storage cell can store two bits), a triple-level cell (TLC) NAND flash memory module (i.e., a flash memory module in which one storage cell can store three bits), a quadruple level cell (QLC) NAND flash memory module (i.e., a flash memory module in which one storage cell can store four bits), a three-dimensional NAND flash memory module (3D NAND flash memory module) or a vertical NAND flash memory module (Vertical NAND flash memory module) or other flash memory modules or other memory modules with the same characteristics. The storage units (also called memory cells) in the rewritable non-volatile memory module 220 are arranged in an array.

[0053] In this embodiment, the rewritable non-volatile memory module 220 has a plurality of word lines, wherein each of the plurality of word lines is coupled to a plurality of memory cells. A plurality of memory cells on the same word line constitute a physical programming unit (also called a physical page). In addition, a plurality of physical pages may constitute a physical block (also called a physical erasing unit).

[0054] In this embodiment, the minimum unit of the data size of the write data written to the rewritable non-volatile memory module 220 each time is a cluster. The operating system executed by the host system 10 uses the cluster as the minimum unit to access / manage the data written to the logical page, and the operating system can grasp / manage the logical address and size of each data. The size of a cluster can be less than or equal to the size of a physical page. A cluster can have multiple sectors. The size of a cluster can be less than or equal to a logical page.

[0055] For the convenience of explanation, in the following embodiments, the size of a cluster is equal to the size of a physical page, and the size of a physical page is also equal to the size of a logical page. In addition, it is assumed that the size of each physical page of the rewritable non-volatile memory module 220 is 1024 bytes. However, it should be noted that the present invention is not limited to the size of each physical page, logical page, or cluster.

[0056] In this embodiment, in order to perform reliability testing on physical blocks or physical pages, the processor 211 may first instruct the test data circuit unit 215 to perform a data test data generation operation to implement the test data generation method provided by the present invention, thereby obtaining test data for reliability testing. More specifically, the processor 211 instructs the test data circuit unit to perform a test data generation operation according to the "predetermined zero-one ratio" and "predetermined integer range" corresponding to the test data for the reliability test to generate the test data. The following will use Figure 2 The test data generating method provided by the present invention is described below.

[0057] Figure 2 FIG. 1 is a flow chart of a method for generating test data according to an embodiment of the present invention. Figure 2 In step S21, the test data circuit unit 215 determines the conversion threshold value according to the predetermined zero-to-one ratio of the corresponding test data and the predetermined integer range, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range. Specifically, the test data circuit unit 215 can calculate the corresponding specific value in the predetermined integer range according to the predetermined zero-to-one ratio, and use the corresponding specific value as the conversion threshold value. Figure 3 To explain.

[0058] Figure 3 Schematic diagram of a predetermined zero-to-one ratio and a conversion threshold value according to an embodiment of the present invention. Figure 3 In this embodiment, the user can customize the predetermined zero-to-one ratio and the multiple consecutive integers in the predetermined integer range. Here, it is assumed that the multiple consecutive integers in the predetermined integer range are "1" to "100", and the predetermined zero-to-one ratio is "3:1".

[0059] More specifically, the predetermined zero-to-one ratio is used to represent the ratio of the total number of the plurality of bit values ​​"0" and the plurality of bit values ​​"1" in all the bit values ​​(bits) of the test value to be generated. Figure 3As shown by arrow A31, the predetermined zero-to-one ratio pre-set by the user is 3 to 1. This predetermined zero-to-one ratio indicates that the user expects the ratio of the total number of bits "0" to the total number of bits "1" in the test data 300 generated to be 3:1 (i.e., 3).

[0060] The test data circuit unit 215 can calculate a specific value within the predetermined integer range based on the total number of multiple consecutive integers in the predetermined integer range (e.g., 100) and the predetermined zero-to-one ratio, so that within the predetermined integer range, the ratio between the specific value and the total number of multiple integers sorted before the specific value and the total number of multiple consecutive integers sorted after the specific value is equal to the predetermined zero-to-one ratio.

[0061] For example, the specific value (ie, the conversion threshold) may be calculated by the following formula:

[0062] Conversion threshold value = starting value + [(total number of predetermined integer range) * (proportion of value 0) - 1]

[0063] Among them, the "starting value" is the value of the first integer among the multiple consecutive integers in the predetermined integer range; the "total number in the predetermined integer range" is the total number of the multiple consecutive integers; the "proportion of value 0" is the percentage of the bit "0" in the overall test data calculated according to the predetermined zero-to-one ratio (for example, the predetermined zero-to-one ratio is "3:1", and the corresponding "proportion of value 0" is 3 / (3+1)*100=75(%)).

[0064] The calculation formula of the above conversion threshold value is only exemplary, and the present invention is not limited thereto. A person skilled in the art can derive a specific value corresponding to the predetermined zero-to-one ratio within the predetermined integer range as the conversion threshold value based on the concept of setting the conversion threshold value above and the predetermined integer range and the predetermined zero-to-one ratio.

[0065] Please come back Figure 2 After determining / obtaining the conversion threshold value, the test data circuit unit 215 sets all the bit values ​​of the test value (steps S22 to S26).

[0066] More specifically, in step S22, the test data circuit unit 215 generates a target random integer within the predetermined integer range. For example, the test data circuit unit 215 may generate the target random integer using a random function while limiting the generated random number within the predetermined integer range (e.g., specifying the maximum value and the minimum value of the generated random number to be the maximum value and the minimum value of the predetermined integer range, respectively).

[0067] Next, in step S23 , the test data circuit unit 215 determines whether the target random integer is greater than the conversion threshold value.

[0068] In response to determining that the target random integer is greater than the conversion threshold value (S23→Yes), the test data circuit unit 215 executes step S24; in response to determining that the target random integer is not greater than the conversion threshold value (S23→No), the test data circuit unit 215 executes step S25.

[0069] In step S24, the test data circuit unit 215 converts the target random integer to 1, and sets the i-th bit of the test data to the target random integer, where the initial value of i is 1, and the test data has a total of N bits, where N is a positive integer.

[0070] In step S25 , the test data circuit unit 215 converts the target random integer into 0, and sets the i-th bit of the test data to the target random integer.

[0071] In short, during steps S23 to S25, the test data circuit unit 215 will decide whether to convert the generated target random integer from the current value to "1" or "0" based on whether the generated target random integer is greater than the conversion threshold value, and assign / set the converted bit value (bit value) to the i-th bit (bit) of the test data.

[0072] Next, in step S26 , the test data circuit unit 215 determines whether i is equal to N.

[0073] In response to the determination that i is not equal to N, the test data circuit unit 215 executes step S27 ( S26 →No); in response to the determination that i is equal to N ( S26 →Yes), the test data circuit unit 215 executes step S28.

[0074] In step S27, the test data circuit unit 215 adds 1 to i to set the value of the next bit of the test data.

[0075] That is, after repeatedly executing steps S22 to S27 for N times, the values ​​of the N bits (N bit values) of the test data are all set, that is, the test data generation operation is completed.

[0076] In step S28 , the test data circuit unit 215 responds the test data to the processor 211 according to the set N bits (N bit values) of the test data, so that the test data is written into the rewritable non-volatile memory module 220 via the processor 211 .

[0077] Specifically, the test data circuit unit 215 can return the set / generated test data to the processor 211, so that the processor 211 can write the test to the rewritable non-volatile memory module by instructing the memory interface control circuit 213 according to the test data to perform reliability testing.

[0078] Figure 4 This is a schematic diagram of setting test data according to an embodiment of the present invention. Figure 4 For the sake of convenience, it is assumed that the test data 400 to be generated has 8 bits 400(1) to 400(8) (ie, N=8), the predetermined integer range is "1" to "100", and the corresponding conversion threshold value is 75.

[0079] For the bit 400(1) to be set, the test data circuit unit 215 generates a target random integer "97" (step S22); as shown by arrow A411, the target random integer "97" is converted to "1" (step S23→S24) based on the determination that the target random integer "97" is greater than the conversion threshold value "75"; then, as shown by arrow A412, the bit 400(1) is set to "1" based on the converted target random integer "1". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0080] Next, for the bit 400(2) to be set, the test data circuit unit 215 generates a target random integer "36" (step S22); as shown by arrow A421, the target random integer "36" is converted to "0" (step S23→S25) based on the determination that the target random integer "36" is not greater than the conversion threshold value "75"; then, as shown by arrow A422, the bit 400(1) is set to "0" based on the converted target random integer "0". Next, the test data circuit unit 215 sets the next bit of the test data 400.

[0081] For the bit 400(3) to be set, the test data circuit unit 215 generates a target random integer "17" (step S22); as shown by arrow A431, the target random integer "17" is converted to "0" (step S23→S25) according to the determination that the target random integer "17" is not greater than the conversion threshold value "75"; then, as shown by arrow A432, the bit 400(3) is set to "0" according to the converted target random integer "0". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0082] For the bit 400(4) to be set, the test data circuit unit 215 generates a target random integer "74" (step S22); as shown by arrow A441, the target random integer "74" is converted to "0" (step S23→S25) according to the determination that the target random integer "74" is not greater than the conversion threshold value "75"; then, as shown by arrow A442, the bit 400(4) is set to "0" according to the converted target random integer "0". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0083] For the bit 400(5) to be set, the test data circuit unit 215 generates a target random integer "36" (step S22); as shown by arrow A451, the target random integer "36" is converted to "0" (step S23→S25) according to the determination that the target random integer "36" is not greater than the conversion threshold value "75"; then, as shown by arrow A452, the bit 400(5) is set to "0" according to the converted target random integer "0". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0084] For the bit 400(6) to be set, the test data circuit unit 215 generates a target random integer "5" (step S22); as shown by arrow A461, the target random integer "5" is converted to "0" (step S23→S25) according to the determination that the target random integer "5" is not greater than the conversion threshold value "75"; then, as shown by arrow A462, the bit 400(6) is set to "0" according to the converted target random integer "0". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0085] For the bit 400(7) to be set, the test data circuit unit 215 generates a target random integer "89" (step S22); as shown by arrow A471, the target random integer "89" is converted to "1" (step S23→S24) based on the determination that the target random integer "89" is greater than the conversion threshold value "75"; then, as shown by arrow A472, the bit 400(7) is set to "1" based on the converted target random integer "1". Then, the test data circuit unit 215 sets the next bit of the test data 400.

[0086] For the bit 400(8) to be set, the test data circuit unit 215 generates a target random integer "49" (step S22); as shown by arrow A481, the target random integer "49" is converted to "0" (step S23→S25) based on the determination that the target random integer "49" is not greater than the conversion threshold value "75"; then, as shown by arrow A482, the bit 400(8) is set to "0" based on the converted target random integer "0".

[0087] At this time, all bits of the test data 400 have been set, and the test data circuit unit 215 responds with the set test data 400 (ie, “10000010”) to the processor 211 .

[0088] It is worth mentioning that, in other embodiments, the test data circuit unit 215 may be implemented in the form of software or firmware and executed by the processor 211 , thereby realizing the test data generating method provided by the present invention.

[0089] Based on the above, the storage controller and test data generation method provided by the embodiment of the present invention can correspond to the predetermined zero-to-one ratio and the predetermined integer range of the test data, and control the ratio between the total number of 0s and 1s in all bit values ​​of the test data generated in a random manner by customizing the predetermined zero-to-one ratio and the predetermined integer range. In this way, customized test data with different zero-to-one ratios can be generated while ensuring that the data is relatively natural, so as to efficiently and flexibly generate test data that meets the specific zero-to-one ratio requirements, thereby maintaining the integrity of the reliability test performed on multiple blocks of the rewritable non-volatile memory module through the generated test data.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A storage controller for controlling a storage device equipped with a rewritable non-volatile memory module, It is characterized in that The storage controller comprises: A connection interface circuit for coupling to a host system; A memory interface control circuit, used for coupling to the rewritable non-volatile memory module; testing data circuit unit; and a processor, coupled to the connection interface circuit, the memory interface control circuit and the test data circuit unit, The processor is used to instruct the test data circuit unit to perform a test data generation operation according to a predetermined zero-to-one ratio and a predetermined integer range of the corresponding test data to generate test data, and the test data generation operation includes the following steps: (1) calculating a conversion threshold value according to the predetermined zero-to-one ratio corresponding to the test data and the predetermined integer range, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range, wherein the conversion threshold value is equal to the sum of the starting values ​​of the plurality of consecutive integers plus a first value, wherein the first value is a second value minus 1, wherein the second value is the total number of the plurality of consecutive integers multiplied by a proportion of the value 0, wherein the proportion of the value 0 is calculated according to the predetermined zero-to-one ratio; (2) generating a target random integer within the predetermined integer range; (3) determining whether the target random integer is greater than the conversion threshold value; In response to determining that the target random integer is greater than the conversion threshold value, the target random integer is converted to 1, and the i-th bit of the test data is set to the target random integer, wherein the initial value of i is 1, and the test data has a total of N bits, wherein N is a positive integer, wherein in response to determining that the target random integer is not greater than the conversion threshold value, the target random integer is converted to 0, and the i-th bit of the test data is set to the target random integer; and (4) Determine whether i is equal to N, In response to determining that i is not equal to N, 1 is added to i and step (2) is executed again; In response to determining that i is equal to N, the test data is responded to the processor according to the set N bits of the test data, so that the test data is written into the rewritable non-volatile memory module via the processor.

2. The storage controller according to claim 1, It is characterized in that The plurality of consecutive integers in the predetermined integer range are 1 to 100.

3. The storage controller according to claim 2, It is characterized in that The predetermined zero-to-one ratio is used to represent the ratio of the total number of a plurality of bit values ​​0 and a plurality of bit values ​​1 in all bit values ​​of the test data expected to be generated.

4. A test data generation method, suitable for generating test data to be written into a rewritable non-volatile memory module of a storage device, It is characterized in that The method comprises the following steps: (1) calculating a conversion threshold value according to a predetermined zero-to-one ratio and a predetermined integer range corresponding to the test data, wherein the conversion threshold value is one of a plurality of consecutive integers in the predetermined integer range, wherein the conversion threshold value is equal to the sum of the starting values ​​of the plurality of consecutive integers plus a first value, wherein the first value is a second value minus 1, wherein the second value is the total number of the plurality of consecutive integers multiplied by a proportion of the value 0, wherein the proportion of the value 0 is calculated according to the predetermined zero-to-one ratio; (2) generating a target random integer within the predetermined integer range; (3) determining whether the target random integer is greater than the conversion threshold value; In response to determining that the target random integer is greater than the conversion threshold value, the target random integer is converted to 1, and the i-th bit of the test data is set to the target random integer, wherein the initial value of i is 1, and the test data has a total of N bits, wherein N is a positive integer, wherein in response to determining that the target random integer is not greater than the conversion threshold value, the target random integer is converted to 0, and the i-th bit of the test data is set to the target random integer; as well as (4) Determine whether i is equal to N, In response to determining that i is not equal to N, 1 is added to i and step (2) is executed again; In response to determining that i is equal to N, the test data is responded to according to the set N bits of the test data so that the test data is written into the rewritable non-volatile memory module.

5. The test data generating method according to claim 4, It is characterized in that The plurality of consecutive integers in the predetermined integer range are 1 to 100.

6. The test data generating method according to claim 5, It is characterized in that The predetermined zero-to-one ratio is used to represent the ratio of the total number of a plurality of bit values ​​0 and a plurality of bit values ​​1 in all bit values ​​of the test data expected to be generated.

Citation Information

Patent Citations

  • Data write-in method, memory control circuit unit and memory storing device

    CN104765569A

  • Apparatus and method for processing digital value

    CN106030605A

  • Method for producing random numeral

    CN1340759A

  • Testing data compression code, decoding method and special decoding element of slice system

    CN1476174A

  • Apparatus and method for testing randomness

    TW201520761A