Memory testing methods, apparatus, equipment, and media based on random out-of-order read / write.
By dividing memory into blocks and generating a sequence of non-repeating random block numbers, and combining various test patterns for out-of-order read and write operations, the problems of insufficient cache masking and fault determination in memory testing are solved, achieving more efficient memory defect detection and fault location.
Patent Information
- Application Number
- CN202611624668.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing memory testing methods are easily affected by CPU caching mechanisms, leading to test shielding, difficulty in simulating random memory access behavior under real business conditions, and lack of effective fault diagnosis methods, resulting in missed detection of memory hardware defects.
By dividing the memory into blocks with a capacity greater than the CPU cache capacity, a non-repeating random block number sequence is generated. This sequence is then combined with various test patterns to perform out-of-order read and write operations, record and compare the data, and combine this with underlying hardware signals to locate the fault.
It effectively avoids test blocking caused by cache hits, improves memory defect detection capabilities, can trigger hidden faults in simulated real business scenarios, accurately identify storage errors and distinguish the source of faults.
Smart Images

Figure CN123114841A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of memory testing technology, and specifically to a memory testing method, apparatus, device, and medium based on random out-of-order read and write. Background Technology
[0002] As the core data carrier of a computer system, memory's performance and reliability are crucial to the stable operation of the entire system. In the processes of memory factory testing, system compatibility verification, and hardware fault screening, achieving efficient and reliable memory testing is a key step in ensuring the quality of memory products and locating potential hardware problems. Existing memory testing methods typically employ a full disk traversal approach to test memory read / write capabilities and the health status of storage units, primarily relying on sequential read / write or simple random read / write to simulate business access scenarios.
[0003] However, in terms of anti-interference strategies, existing testing schemes are easily affected by the CPU cache mechanism. When the test access range falls within the CPU cache capacity, the read and write operations are actually completed inside the cache and do not actually access the physical memory chip, which can easily lead to test masking and missed detection of memory hardware defects. Regarding access patterns, some schemes that avoid cache interference still use a fixed order to traverse each memory block. The access pattern has strong regularity, which differs significantly from the random out-of-order memory access behavior during actual operation of the operating system and business programs. This makes it difficult to fully stimulate latent faults such as address crosstalk and timing coupling that only appear under random access conditions. In terms of random sequence generation, conventional software-generated random numbers are prone to duplicate block numbers, posing a risk of missing some memory blocks. Regarding test stimulus sources, existing tests mostly use a limited variety of fixed test patterns, resulting in insufficient defect stimulus coverage. Furthermore, the fault determination stage generally only marks the fault address, lacking integration with underlying hardware signals to determine the root cause of the fault, making it impossible to distinguish whether the fault originates from the memory storage itself or the motherboard bus link.
[0004] Therefore, how to simulate memory access behavior under real business conditions and improve memory defect detection capabilities is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] This invention provides a memory testing method, apparatus, device, and medium based on random out-of-order read and write, which solves the technical problem of how to simulate memory access behavior under real business conditions and improve the ability to detect memory defects.
[0006] In a first aspect, the present invention provides a memory testing method based on random out-of-order read / write, comprising: Obtain the capacity of the memory to be tested and the corresponding CPU cache capacity, and divide the memory to be tested into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity; Random numbers are generated recursively based on a random number seed generated by a hardware register, and the random numbers are mapped to the block numbers of each memory block. The block numbers are then deduplicated to obtain a sequence of random block numbers without repetition. Multiple test patterns are used to write each memory block in random order according to the random block number sequence, and the correspondence between the block number and the test pattern is recorded. Data is read from each memory block according to the random block number sequence, and the read data is compared with the test pattern in the corresponding relationship to obtain the comparison result; The test result of the memory under test is determined based on the comparison result, and the fault is located when the comparison result is abnormal.
[0007] Optionally, the step of obtaining the capacity of the memory to be tested and the corresponding CPU cache capacity, and dividing the memory to be tested into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity, includes: Obtain the total CPU cache capacity corresponding to the memory to be tested, and set the capacity of a single memory block to a preset multiple of the total CPU cache capacity; The number of memory blocks is determined based on the capacity of the memory to be tested and the capacity of a single memory block, and a mapping relationship between the block number and the memory block address is established.
[0008] Optionally, the step of recursively generating random numbers based on a random number seed generated by hardware registers, mapping the random numbers to block numbers of each memory block, and removing duplicates from the block numbers to obtain a sequence of random block numbers without repetition includes: Read the CPU's timestamp counter or hardware random number register to generate the random number seed; Using the aforementioned random number seed as the initial random value, random values are generated according to the linear congruential recursive algorithm; The generated random value is used as the block number, and it is determined whether the block number has been recorded in the generated sequence cache. When the block number is not recorded in the generated sequence cache, the block number is written into the random block number sequence; When the block number has been recorded in the generated sequence cache, a random value is regenerated until the random block number sequence contains all the block numbers without repetition.
[0009] Optionally, the step of using multiple test patterns, writing each memory block in random order according to the random block number sequence, and recording the correspondence between the block number and the test pattern includes: Multiple test patterns are selected from a preset pattern library, which includes basic test patterns, composite test patterns, and pseudo-random test patterns. Perform pattern transformation processing on the selected current test pattern to obtain a derived test pattern; The test pattern and the derived test pattern are used alternately in different test rounds, and the memory blocks are written out of order according to the random block number sequence.
[0010] Optionally, the step of alternating the use of the test pattern and the derived test pattern in different test rounds, and performing out-of-order writing on each memory block according to the random block number sequence, includes: In the current test round, the test pattern is loaded, and each memory block is written sequentially according to the random block number sequence, while the correspondence between the block number and the test pattern is recorded synchronously. After the full block write of the current test round, the current test pattern is replaced with the next test pattern, and the out-of-order write is repeated. Perform a bit-flip on the next test pattern to obtain a flipped test pattern, and write the flipped test pattern into each memory block according to the random block number sequence.
[0011] Optionally, the step of reading data from each memory block according to the random block number sequence and comparing the read data with the test pattern in the correspondence to obtain the comparison result includes: Read the data in each memory block sequentially according to the random block number sequence or the reverse of the random block number sequence; The test pattern written to each memory block is determined according to the correspondence, and the read data is compared with the corresponding test pattern. When the read data is inconsistent with the corresponding test pattern, the comparison result is determined to be abnormal, and the fault block address, abnormal data and corresponding test pattern are recorded.
[0012] Optionally, the step of determining the test result of the memory under test based on the comparison result, and locating the fault when the comparison result is abnormal, includes: When all the memory blocks match, the memory under test is determined to be normal. When any of the aforementioned memory blocks do not match, the faulty block is marked, and the DMI pin level is recorded. The fault type is determined based on the DMI pin level record and the abnormal data, and a test report containing the fault block address, abnormal data, and fault type is generated.
[0013] Secondly, the present invention provides a memory testing device based on random out-of-order read / write, comprising: The acquisition module is used to acquire the CPU cache capacity corresponding to the memory under test, and divide the memory under test into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity. The generation module is used to generate a sequence of non-repeating random block numbers, including the block numbers of each memory block, based on a random number seed generated by a hardware register. The write module is used to write each memory block in random order according to the random block number sequence using multiple preset test patterns, and to record the correspondence between the block number and the test pattern. The verification module is used to read data from each memory block according to the random block number sequence, and compare the read data with the test pattern in the corresponding relationship to obtain the comparison result; The positioning module is used to determine the test result of the memory under test based on the comparison result, and to locate the fault by combining the data mask function log when the comparison result is abnormal.
[0014] Thirdly, the present invention provides a computer device, the device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the memory testing method based on random out-of-order read / write as described in any of the first aspects above.
[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the memory testing method based on random out-of-order read / write as described in any one of the first aspects above.
[0016] Compared with existing technologies, this invention provides a memory testing method, apparatus, device, and medium based on random out-of-order read and write. It divides memory blocks by CPU cache capacity, ensuring that the capacity of a single memory block is greater than the CPU cache capacity, forcing read and write requests to penetrate the CPU cache and avoiding cache hits that could mask the test. It generates and removes duplicate random block number sequences based on a random number seed from a hardware register, balancing access randomness with test completeness. By combining various test patterns to perform out-of-order read and write operations, it simulates real-world random access scenarios, facilitating the detection of latent memory defects such as address crosstalk. It identifies storage errors by comparing read and write data and performs fault location when comparison anomalies occur, effectively improving the ability to detect memory defects. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and not all embodiments. For those skilled in the art, other drawings obtained from these drawings without creative effort are all within the scope of protection of this application.
[0018] Figure 1 This is a flowchart of a memory testing method based on random out-of-order read and write provided by an embodiment of the present invention.
[0019] Figure 2 This is a flowchart of generating a non-repeating random block number sequence provided by an embodiment of the present invention.
[0020] Figure 3 This is a flowchart of selecting and deriving test patterns provided in an embodiment of the present invention.
[0021] Figure 4 This is a flowchart of reading memory block data provided in an embodiment of the present invention.
[0022] Figure 5 This invention provides a memory testing device based on random out-of-order read and write.
[0023] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.
[0024] Figure 7 This is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0026] To make the description of this disclosure more detailed and complete, illustrative descriptions of embodiments and specific examples of the present invention are provided below; however, these are not the only forms of implementing or utilizing the specific embodiments of the present invention. The embodiments cover features of multiple specific embodiments and the methods, steps, and their order for constructing and operating these specific embodiments. However, other specific embodiments may also be used to achieve the same or equivalent functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0028] In the description of the embodiments of the present invention, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The word "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more. Other quantifiers should be understood similarly. The preferred embodiments described herein are only used to illustrate and explain the present invention and are not intended to limit the present invention. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0029] To address the low accuracy of existing memory testing methods based on random out-of-order read / write operations, this invention provides a memory testing method based on random out-of-order read / write operations, such as... Figure 1 The flowchart described above is a memory testing method based on random out-of-order read / write provided in an embodiment of the present invention, including the following steps.
[0030] S10: Obtain the capacity of the memory under test and the corresponding CPU cache capacity, and divide the memory under test into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity. Specifically, in this embodiment of the invention, by obtaining the capacity of the memory under test and the corresponding CPU cache capacity, the memory under test is divided into multiple memory blocks, each with a capacity greater than the CPU cache capacity. This ensures that a complete read / write access to any memory block will inevitably trigger cache invalidation, forcing read / write requests to penetrate the CPU cache and directly access physical memory. This avoids test masking caused by cache hits, prevents memory hardware defects from being missed due to cache substitution, effectively improves test coverage in cache invalidation scenarios, and also helps improve the access activation rate of data masking function-related circuits, covering DM-related defects that are difficult to detect in conventional tests.
[0031] S20: Random numbers are recursively generated based on a random number seed generated by hardware registers, and these random numbers are mapped to the block numbers of each memory block. The block numbers are then deduplicated to obtain a sequence of random block numbers without repetition. Specifically, in this embodiment of the invention, random numbers are recursively generated based on a random number seed generated by hardware registers, ensuring that the starting point of the random sequence originates from a true random signal from the CPU hardware, thus avoiding the inherent regularity of software pseudo-random numbers. By deduplicating the block numbers to obtain a sequence of random block numbers without repetition, it is ensured that each memory block is included in the test traversal, thereby avoiding the omission of some memory blocks due to repeated random numbers, eliminating test blind spots, and providing a reliable and fully covered access order benchmark for subsequent out-of-order read / write operations.
[0032] S30: Using multiple test patterns, each memory block is written out of order according to the random block number sequence, and the correspondence between the block number and the test pattern is recorded. Specifically, in this embodiment of the invention, by using multiple test patterns and writing each memory block out of order according to the random block number sequence, the random access behavior of the CPU to DRAM under real business scenarios such as random database queries and random access to multimedia streams is simulated. At the same time, the multiple pattern stimulation covers a variety of data characteristics, which is beneficial to stimulate latent memory faults such as address crosstalk and timing coupling that only appear under random access conditions, thereby improving the detection capability of memory defects, and simultaneously recording the correspondence between the block number and the test pattern to provide a comparison benchmark for subsequent reading and verification.
[0033] S40: Read the data in each memory block according to the random block number sequence, and compare the read data with the test pattern in the correspondence relationship to obtain the comparison result. Specifically, in this embodiment of the invention, by reading the data of each memory block according to the random block number sequence and comparing it block by block with the recorded test pattern correspondence relationship, the entire writing and reading process maintains a random access mode. This avoids the memory prefetching and internal caching mechanisms from masking data errors under sequential access, thereby accurately identifying data errors occurring in memory units and obtaining reliable comparison results.
[0034] S50: Determine the test result of the memory under test based on the comparison result, and locate the fault when the comparison result is abnormal. Specifically, in this embodiment of the invention, by locating the fault when the comparison result is abnormal, it is possible to trace the root cause of the fault by combining the underlying hardware signals while determining the memory fault, and to distinguish whether the fault originates from an abnormal DM function circuit or a memory storage unit fault, thereby improving the fault location capability and facilitating rapid handling and accurate repair by testers.
[0035] As an optional implementation, in step S10, obtaining the capacity of the memory to be tested and the corresponding CPU cache capacity, and dividing the memory to be tested into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity, includes: S11: Obtain the total CPU cache capacity corresponding to the memory under test, and set the capacity of a single memory block to a preset multiple of the total CPU cache capacity. Specifically, in this embodiment of the invention, the test program reads CPU cache information after system startup, obtains the total CPU cache capacity, and sets the capacity of a single memory block to a preset multiple of the total CPU cache capacity, for example, 1.2 times the total CPU cache capacity. The preset multiple can be selected from 1.2 times to 1.5 times. Since the capacity of a single memory block is greater than the total CPU cache capacity, when performing a complete read / write access on any memory block, its data cannot all reside inside the CPU cache, inevitably resulting in cache misses. This forces read / write requests to penetrate the cache and interact directly with DRAM. This invention, through a block-based strategy based on cache miss thresholds, fundamentally avoids test shielding caused by CPU cache hits, ensuring that each block access actually falls into physical memory.
[0036] S12: Determine the number of memory blocks based on the capacity of the memory under test and the capacity of a single memory block, and establish a mapping relationship between block numbers and memory block addresses. Specifically, in this embodiment of the invention, the selected contiguous space of the memory under test is divided based on the capacity of a single memory block. The number of memory blocks is obtained by dividing the capacity of the memory under test by the capacity of a single memory block. For each memory block obtained, a unique block number is assigned, and the mapping relationship between the block number and the physical starting address of the memory block is recorded to form a block address mapping table. All subsequent random read and write operations obtain the corresponding physical address by querying the mapping relationship through the block number. This embodiment supports dynamically adjusting the number of memory blocks based on the capacity of the memory under test, which can balance test coverage and test efficiency. For example, when pursuing high coverage, the number of blocks can be divided according to the full capacity, and when pursuing efficiency, the number of blocks can be appropriately reduced. At the same time, the one-to-one mapping between block numbers and physical addresses provides a unified address reference for subsequent random out-of-order access.
[0037] As an optional implementation method, such as Figure 2 As shown, Figure 2 This is a flowchart of generating a non-repeating random block number sequence provided by an embodiment of the present invention. In step S20, the random number seed generated based on the hardware register is recursively generated to generate random numbers, and the random numbers are mapped to the block numbers of each memory block. The block numbers are then deduplicated to obtain a non-repeating random block number sequence, including: S21: Read the CPU's timestamp counter or hardware random number register to generate the random number seed. Specifically, in this embodiment of the invention, the hardware random number generator is initialized, and the original signal is obtained by reading the CPU's timestamp counter or hardware random number engine register as the random number seed. This seed originates from the CPU hardware register and has better true randomness characteristics compared to pure software pseudo-random numbers. It avoids the inherent regularity of software pseudo-random number sequences and provides an unpredictable starting point for subsequent random access sequences.
[0038] S22: Using the random number seed as the initial random value, generate random values according to the linear congruential recursion algorithm. Specifically, in this embodiment of the invention, the generated random number seed is used as the initial random value, and random values are continuously generated through linear congruential recursion. The range of random values is constrained by the modulo operation, so that they are evenly distributed within the block number value space, thereby mapping the random values to the block numbers of each memory block.
[0039] S23: Use the generated random value as the block number, and determine whether the block number has been recorded in the generated sequence cache. Specifically, in this embodiment of the invention, a generated sequence cache is set up to record the block numbers that have been written into the random block number sequence; each time a random value is obtained through recursion, it is used as a candidate block number, and the generated sequence cache is queried to see if the block number has been recorded, so as to determine whether the generated block number is duplicated.
[0040] S24: When the block number is not recorded in the generated sequence cache, the block number is written into the random block number sequence. Specifically, in this embodiment of the invention, when the candidate block number is not recorded in the cache, it is appended to the random block number sequence, and at the same time, the block number is registered in the generated sequence cache.
[0041] S25: When the block number has been recorded in the generated sequence cache, a random value is regenerated until the random block number sequence contains all block numbers without duplicates. Specifically, in this embodiment of the invention, when a candidate block number has been cached, it indicates that a duplicate number has been generated in this recursion. The current random value is then discarded, and the process returns to S22 to regenerate the next random value and perform deduplication again. This process iterates until the random block number sequence contains the block numbers of all memory blocks without any duplicates. This embodiment, through the generated sequence cache combined with the mechanism of rejecting duplicates, ensures that the block number of each memory block appears only once in the sequence, structurally avoiding test blind spots caused by repeated writes and ensuring that all memory blocks are traversed and tested.
[0042] As an optional implementation, in step S30, such as Figure 3 As shown, Figure 3 This is a flowchart of selecting and deriving test patterns provided in an embodiment of the present invention. The process involves using multiple test patterns, writing memory blocks in random order according to the random block number sequence, and recording the correspondence between block numbers and test patterns. S31: Select multiple test patterns from a preset pattern library, wherein the preset pattern library includes basic test patterns, composite test patterns, and pseudo-random test patterns. Specifically, in this embodiment of the invention, the preset pattern library contains three types of test patterns: basic test patterns, such as all 0s or all 1s; composite test patterns, such as 0x55aa55aa, 0xaa55aa55, checkerboard patterns, and other high and low bit alternation patterns; and pseudo-random test patterns, which are bit streams generated by pseudo-random algorithms and support custom extensions. After the test begins, multiple test patterns are selected from the pattern library as the stimulus data source for this round of testing. The various types of patterns cover different data characteristics such as 0-dense, 1-dense, bit alternation, and pseudo-random distribution, which can stimulate data correlation faults in memory from multiple dimensions.
[0043] S32: Perform pattern transformation processing on the selected current test pattern to obtain a derived test pattern. Specifically, in this embodiment of the invention, a pattern transformation process is performed on the current test pattern selected from the pattern library to generate a derived test pattern that has a definite transformation relationship with the test pattern. The transformation methods include bit-by-bit flipping, byte swapping, etc. For example, bit-by-bit flipping is performed on the current test pattern 0x55aa55aa to obtain the derived test pattern 0xaa55aa55. The derived test pattern has complementary or misaligned data characteristics with the original test pattern, thereby expanding the diversity of test patterns without increasing the storage overhead of the pattern library.
[0044] S33: The test pattern and the derived test pattern are used alternately in different test rounds, and out-of-order writes are performed on each memory block according to the random block number sequence. Specifically, in this embodiment of the invention, the original test pattern and its derived test patterns are assigned to different test rounds, and different patterns are used alternately between test rounds. In each round, out-of-order writes are performed on each memory block according to the generated non-repeating random block number sequence. By combining pattern rotation with random out-of-order access, a single test round can cover multiple pattern variations, increasing pattern complexity while maintaining the randomness of access order, which is beneficial for stimulating data correlation faults and hidden memory defects under random access conditions.
[0045] As an optional implementation, step S33, which involves alternating the use of the test pattern and the derived test pattern in different test rounds and performing out-of-order writing on each memory block according to the random block number sequence, includes: S331: Load the test pattern in the current test round, write it sequentially to each memory block according to the random block number sequence, and synchronously record the correspondence between the block number and the test pattern. Specifically, in this embodiment of the invention, the first test round loads the first round test pattern, for example, 0x55aa55aa, and sequentially accesses each memory block according to the random block number sequence, writing the current test pattern to the corresponding memory block; after each memory block is written, the correspondence between the block number and the test pattern written this time is synchronously recorded, forming a mapping table between the block number and the test pattern. This mapping table provides a comparison benchmark for subsequent reading and verification.
[0046] S332: After the full block write in the current test round, the current test pattern is replaced with the next test pattern, and the out-of-order write is repeated. Specifically, in this embodiment of the invention, after completing a round of out-of-order write covering all memory blocks, the current test pattern is replaced with the next test pattern, for example, 0x55aa55aa is replaced with 0xaa55aa55, all 0s, all 1s, or a checkerboard pattern, and the out-of-order write process is repeated for each memory block according to the same random block number sequence, so that test patterns with different data characteristics are applied to all memory blocks in rotation.
[0047] S333: Perform bit-flipping on the next test pattern to obtain a flipped test pattern, and write the flipped test pattern into each of the memory blocks according to the random block number sequence. Specifically, in this embodiment of the invention, perform bit-flipping on the replaced next test pattern to obtain a flipped test pattern that is completely complementary to its bits. For example, perform bit-flipping on 0xaa55aa55 to obtain 0x55aa55aa, and then write the flipped test pattern into each memory block again according to the random block number sequence. Bit-flipping enhancement allows the same round of testing to contain both the original pattern and its bit-complementary pattern, further increasing the pattern complexity and providing stronger stimulation for data-related defects such as crosstalk and coupling between storage units.
[0048] As an optional implementation method, such as Figure 4 As shown, Figure 4 This is a flowchart of reading memory block data provided in an embodiment of the present invention. In step S40, the data in each memory block is read according to the random block number sequence, and the read data is compared with the test pattern in the corresponding relationship to obtain the comparison result, including: S41: Read the data in each memory block sequentially according to the random block number sequence or the reverse of the random block number sequence. Specifically, in this embodiment of the invention, after all out-of-order writing is completed, read the data in each memory block sequentially according to the random block number sequence consistent with the writing; as another optional method, the data in each memory block can also be read sequentially in the reverse order of the random block number sequence. This embodiment adopts a reverse reading method, and the writing and reading are misaligned in the access order, which can avoid the prefetching mechanism or internal cache of some memory hardware from masking data errors, and further improve the probability of defect detection.
[0049] S42: Determine the test pattern written to each memory block according to the correspondence, and compare the read data with the corresponding test pattern. Specifically, in this embodiment of the invention, during the reading process, according to the correspondence between the block number and the test pattern recorded in step S30, query the standard test pattern used by the current memory block in the writing stage, compare the actually read data bit by bit with the corresponding standard test pattern, and determine whether the read data and the written data are consistent.
[0050] S43: When the read data is inconsistent with the corresponding test pattern, the comparison result is determined to be abnormal, and the faulty block address, abnormal data, and corresponding test pattern are recorded. Specifically, in this embodiment of the invention, if the read data of a memory block is completely consistent with the standard test pattern, the comparison of that block is normal; if the read data is inconsistent with the standard test pattern, the comparison result of that memory block is determined to be abnormal, and the physical address corresponding to the faulty block, the captured abnormal data, and the test pattern corresponding to the block being written are recorded. The above information is saved to a temporary fault record table for subsequent test result determination and fault location.
[0051] As an optional implementation, in step S50, determining the test result of the memory under test based on the comparison result, and locating the fault when the comparison result is abnormal, includes: S51: When all the memory blocks match, the memory under test is determined to be normal. Specifically, in this embodiment of the invention, the comparison results of all memory blocks are traversed. When the read data of all memory blocks are consistent with the corresponding test pattern, it indicates that the read and write function of the memory under test is normal, the memory under test is determined to be normal, and the test result of passing the memory test is output.
[0052] S52: When any of the memory blocks fails to match, the faulty block is marked, and the DMI pin level record is obtained. Specifically, in this embodiment of the invention, when the matching result of at least one memory block is abnormal, the memory block is marked as a faulty block, and the DMI pin level record during the test is obtained. The DMI pin carries a data masking function, and the DM function uses the DMI pin to mask the writing of specific bytes. Since the DMI pin is normally accessed and occupied in conventional linear tests, and the DM function has a low utilization rate, defects in DM-related circuits are difficult to detect through conventional tests. This embodiment actively obtains the DMI pin level record after detecting the matching anomaly, providing a low-level hardware basis for determining whether the fault is related to the DM function.
[0053] S53: Determine the fault type based on the DMI pin level record and the abnormal data, and generate a test report containing the fault block address, abnormal data, and fault type. Specifically, in this embodiment of the invention, the fault type is determined by combining the DMI pin level record and the captured abnormal data: when the DMI pin level record is abnormal and the abnormal data is related to the DM shielding behavior, the fault can be considered to originate from DM shielding failure, and the fault type is determined to be DM function abnormality; when the DMI pin level record is normal, the fault can be considered to originate from the memory unit itself, and the fault type is determined to be memory unit failure. Finally, a test report is generated, which includes the fault block address, abnormal data, and the parsed fault type. Based on this, testers can distinguish whether the fault originates from the DM functional circuit or the memory storage unit, achieving rapid root cause localization.
[0054] In this embodiment of the invention, memory blocks are divided by CPU cache capacity, making the capacity of a single memory block larger than the CPU cache capacity. This forces read and write requests to penetrate the CPU cache, avoiding cache hits that could cause test blocking. A non-repeating random block number sequence is obtained by generating and deduplicating a random number seed based on a hardware register, balancing access randomness and test completeness. Random read and write operations are performed using various test patterns to simulate real random access scenarios, which helps to stimulate latent memory defects such as address crosstalk. Storage errors are identified by comparing read and write data, and fault location is performed when an anomaly occurs, which can distinguish the source of the fault and effectively improve the memory defect detection capability.
[0055] Based on the above-described memory testing method based on random out-of-order read / write, this embodiment of the invention provides a memory testing device based on random out-of-order read / write, such as... Figure 5 As shown, its structural diagram is as follows: Figure 5 As shown, the memory testing device based on random out-of-order read / write includes: an acquisition module 71, used to acquire the CPU cache capacity corresponding to the memory under test, and divide the memory under test into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity; a generation module 72, used to generate a non-repeating random block number sequence including the block number of each memory block based on a random number seed generated by a hardware register; a writing module 73, used to use multiple preset test patterns to write each memory block in random order according to the random block number sequence, and record the correspondence between the block number and the test pattern; a verification module 74, used to read the data in each memory block according to the random block number sequence, and compare the read data with the test pattern in the correspondence to obtain a comparison result; and a positioning module 75, used to determine the test result of the memory under test according to the comparison result, and to locate the fault by combining the data mask function log when the comparison result is abnormal.
[0056] For other details regarding the implementation of the above technical solution by each module in the memory testing device based on random out-of-order read and write, please refer to the description in the memory testing method based on random out-of-order read and write provided in the above embodiments of the invention, which will not be repeated here.
[0057] Please refer to Figure 6This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The device includes a processor 801, which can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application; and a memory 802, which can be implemented using a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM), etc. The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and is called and executed by the processor 801. The input / output interface 803 is used to implement information input and output. The communication interface 804 is used to realize communication interaction between this device and other devices. Communication can be realized through wired means (such as USB, network cable, etc.) or through wireless means (such as mobile network, WIFI, Bluetooth, etc.). The bus 805 transmits information between various components of the device (such as processor 801, memory 802, input / output interface 803 and communication interface 804). The processor 801, memory 802, input / output interface 803 and communication interface 804 realize communication connection between each other within the device through the bus 805.
[0058] Please refer to Figure 7 This is a schematic diagram of a computer-readable storage medium structure according to an embodiment of the present invention. The storage medium 90 of this embodiment stores program instructions 91 capable of implementing the aforementioned memory testing method based on random out-of-order read / write. These program instructions 91 can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0059] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0060] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
[0061] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A memory testing method based on random out-of-order read / write, characterized in that, include: Obtain the capacity of the memory to be tested and the corresponding CPU cache capacity, and divide the memory to be tested into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity; Random numbers are generated recursively based on a random number seed generated by a hardware register, and the random numbers are mapped to the block numbers of each memory block. The block numbers are then deduplicated to obtain a sequence of random block numbers without repetition. Multiple test patterns are used to write each memory block in random order according to the random block number sequence, and the correspondence between the block number and the test pattern is recorded. Data is read from each memory block according to the random block number sequence, and the read data is compared with the test pattern in the corresponding relationship to obtain the comparison result; The test result of the memory under test is determined based on the comparison result, and the fault is located when the comparison result is abnormal.
2. The memory testing method based on random out-of-order read / write according to claim 1, characterized in that, The process of obtaining the capacity of the memory under test and the corresponding CPU cache capacity, and dividing the memory under test into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity, includes: Obtain the total CPU cache capacity corresponding to the memory to be tested, and set the capacity of a single memory block to a preset multiple of the total CPU cache capacity; The number of memory blocks is determined based on the capacity of the memory to be tested and the capacity of a single memory block, and a mapping relationship between the block number and the memory block address is established.
3. The memory testing method based on random out-of-order read / write according to claim 1, characterized in that, The random number seed generated based on hardware registers is used to recursively generate random numbers, and the random numbers are mapped to the block numbers of each memory block. The block numbers are then deduplicated to obtain a sequence of unique random block numbers, including: Read the CPU's timestamp counter or hardware random number register to generate the random number seed; Using the aforementioned random number seed as the initial random value, random values are generated according to the linear congruential recursive algorithm; The generated random value is used as the block number, and it is determined whether the block number has been recorded in the generated sequence cache. When the block number is not recorded in the generated sequence cache, the block number is written into the random block number sequence; When the block number has been recorded in the generated sequence cache, a random value is regenerated until the random block number sequence contains all the block numbers without repetition.
4. The memory testing method based on random out-of-order read / write according to claim 1, characterized in that, The process involves using multiple test patterns, writing memory blocks out of order according to the random block number sequence, and recording the correspondence between block numbers and test patterns, including: Multiple test patterns are selected from a preset pattern library, which includes basic test patterns, composite test patterns, and pseudo-random test patterns. Perform pattern transformation processing on the selected current test pattern to obtain a derived test pattern; The test pattern and the derived test pattern are used alternately in different test rounds, and out-of-order writing is performed on each memory block according to the random block number sequence.
5. The memory testing method based on random out-of-order read / write according to claim 4, characterized in that, The step of rotating the test pattern and the derived test pattern in different test rounds, and performing out-of-order writing on each memory block according to the random block number sequence, includes: In the current test round, the test pattern is loaded, and each memory block is written sequentially according to the random block number sequence, while the correspondence between the block number and the test pattern is recorded synchronously. After the full block write of the current test round, the current test pattern is replaced with the next test pattern, and the out-of-order write is repeated. Perform a bit-flip on the next test pattern to obtain a flipped test pattern, and write the flipped test pattern into each memory block according to the random block number sequence.
6. The memory testing method based on random out-of-order read / write according to claim 1, characterized in that, The step of reading data from each memory block according to the random block number sequence and comparing the read data with the test pattern in the corresponding relationship to obtain the comparison result includes: Read the data in each memory block sequentially according to the random block number sequence or the reverse of the random block number sequence; The test pattern written to each memory block is determined according to the correspondence, and the read data is compared with the corresponding test pattern. When the read data is inconsistent with the corresponding test pattern, the comparison result is determined to be abnormal, and the fault block address, abnormal data and corresponding test pattern are recorded.
7. The memory testing method based on random out-of-order read / write according to claim 6, characterized in that, The step of determining the test result of the memory under test based on the comparison result, and locating the fault when the comparison result is abnormal, includes: When all the memory blocks match, the memory under test is determined to be normal. When any of the aforementioned memory blocks do not match, the faulty block is marked, and the DMI pin level is recorded. The fault type is determined based on the DMI pin level record and the abnormal data, and a test report containing the fault block address, abnormal data, and fault type is generated.
8. A memory testing device based on random out-of-order read / write, characterized in that, include: The acquisition module is used to acquire the CPU cache capacity corresponding to the memory under test, and divide the memory under test into multiple memory blocks according to the CPU cache capacity, wherein the capacity of a single memory block is greater than the CPU cache capacity. The generation module is used to generate a sequence of non-repeating random block numbers, including the block numbers of each memory block, based on a random number seed generated by a hardware register. The write module is used to write each memory block in random order according to the random block number sequence using multiple preset test patterns, and to record the correspondence between the block number and the test pattern. The verification module is used to read data from each memory block according to the random block number sequence, and compare the read data with the test pattern in the corresponding relationship to obtain the comparison result; The positioning module is used to determine the test result of the memory under test based on the comparison result, and to locate the fault by combining the data mask function log when the comparison result is abnormal.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the memory testing method based on random out-of-order read and write as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the memory testing method based on random out-of-order read and write as described in any one of claims 1 to 7.
