Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explaining the present invention, and be not used in restriction the present invention.
At the problem that prior art exists, the scanning detection method of the dynamic storage that the embodiment of the invention provides is to adopt at least two kinds of different address scan patterns, respectively dynamic storage is detected.
Fig. 1 is the flow process of the scanning detection method of the dynamic storage that provides of the embodiment of the invention.
In step S101, under at least two kinds of different address scan patterns, data are write a plurality of scannings subspace of dynamic storage respectively.
Wherein, the address scan pattern can be word scan pattern, half-word scan pattern or byte scan pattern etc.Under the word scan pattern, each scanning subspace of dynamic storage includes four storage unit, and for dynamic storage, storing 1 bytes of memory space is a storage unit, that is to say that each scanning subspace of dynamic storage comprises 32 storage spaces; Under the half-word scan pattern, each scanning subspace of dynamic storage includes two storage unit, namely comprises 16 storage spaces; Under the byte scan pattern, each scanning subspace of dynamic storage includes a storage unit, namely comprises 8 storage spaces.
Wherein, the data that write a plurality of scannings subspace can be tentation data or random data, and the figure place of this tentation data or random data is according to the difference of the scanning subspace size of different addresses scan pattern correspondence and difference.For fear of the testing result that the data rule makes the mistake, preferably, the data that write a plurality of scannings subspace are random data.
In step S102, under every kind of address scan pattern, after data being write a plurality of scannings subspace, read data respectively from a plurality of scannings subspace.
In step S103, the data that read and the corresponding data that writes a plurality of scannings subspace are compared the output comparative result.
For instance, when the data that write a plurality of scannings subspace are random data, and when with word scan pattern, half-word scan pattern and byte scan pattern dynamic storage being detected in turn respectively, under the word scan pattern, the step that data is write a plurality of scannings subspace of dynamic storage specifically can may further comprise the steps: the first pointer variable current_pre that generates a sensing dynamic storage base address; Adopt iterative algorithm to produce one 32 random data word_pattern; 32 random data word_pattern that produce are write the 32 bit scan subspaces that current address that the first pointer variable current_pre of generation points to begins; Calculate the first pointer variable current_pre, make the pointer variable current_pre that wins point to the first address of one scan subspace down; Adopt shifting algorithm to produce another 32 random data word_pattern '; Another 32 random data word_pattern ' that produce are write the 32 bit scan subspaces that current address that the first pointer variable current_pre points to begins, return afterwards and calculate the first pointer variable current_pre, make the pointer variable current_pre that wins point to the step of the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
Wherein, the step that adopts shifting algorithm to produce another 32 random data word_pattern ' may further comprise the steps again: current 32 random data are moved to left 5; Current 32 random data are moved to right 27; With move to left after 5 data with move to right after 27 data mutually or; With mutually or after 32 random data and 32 random data word_pattern addition of adopting iterative algorithm to produce, obtain another 32 random data word_pattern ', namely can be expressed as:
word_pattern′=((word_pattern′<<5|word_pattern′>>27))+word_pattern
Further, comprehensive scanning in order to ensure storage unit covers, in the embodiment of the invention, under the word scan pattern, after the step that the data that read and the corresponding data that writes a plurality of scannings subspace are compared, can also may further comprise the steps: calculate first pointer variable, make the pointer variable of winning point to the base address of dynamic storage; The 32 bit scan subspaces that begin to the current address of the current sensing of first pointer variable write tentation data; Calculate first pointer variable, make the pointer variable of winning point to the first address of one scan subspace down; The 32 bit scan subspaces that begin to the current address of the current sensing of first pointer variable write tentation data; Return afterwards and calculate first pointer variable, make the pointer variable of winning point to the step of the first address of one scan subspace down, so circulation is all preserved tentation data until whole scannings subspace.Because each of each storage unit is 0 or 1, therefore, tentation data wherein is special data, as: 0x0000,0000,0x5555,5555,0xaaaa, aaaa etc. are to guarantee that storage unit is covered comprehensively.
Afterwards, under the word scan pattern, after the step of output comparative result, also comprise the step of switching the half-word scan pattern, under the half-word scan pattern, the step that data is write a plurality of scannings subspace of dynamic storage specifically can may further comprise the steps: second pointer variable that generates a sensing dynamic storage base address; Adopt iterative algorithm to produce one 16 random data; 16 random data that produce are write the 16 bit scan subspaces that current address that second pointer variable of generation points to begins; Calculate second pointer variable, make second pointer variable point to the first address of one scan subspace down; Adopt shifting algorithm to produce another 16 random data; Another 16 random data that produce are write the 16 bit scan subspaces that current address that second pointer variable points to begins, return afterwards and calculate second pointer variable, make second pointer variable point to the step of the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
Afterwards, under the half-word scan pattern, after the step of output comparative result, also comprise the step of switching the byte scan pattern, under the byte scan pattern, the step that data is write a plurality of scannings subspace of dynamic storage specifically can may further comprise the steps: the 3rd pointer variable that generates a sensing dynamic storage base address; Adopt iterative algorithm to produce one 8 random data; 8 random data that produce are write the 8 bit scan subspaces that current address that the 3rd pointer variable of generation points to begins; Calculate the 3rd pointer variable, make the 3rd pointer variable point to the first address of one scan subspace down; Adopt shifting algorithm to produce another 8 random data; Another 8 random data that produce are write the 8 bit scan subspaces that current address that the 3rd pointer variable points to begins, return afterwards and calculate the 3rd pointer variable, make the 3rd pointer variable point to the step of the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
Unlike the prior art, the scanning detection method of the dynamic storage that the embodiment of the invention provides is to adopt at least two kinds of different address scan patterns, respectively dynamic storage is scanned detection, can cover the address of each storage unit of dynamic storage really, testing result is more accurate; And further, adopt random data that dynamic storage is scanned detection, avoided the influence of data rule to testing result, further improved the degree of accuracy of testing result.
The scanning detection method of the dynamic storage that the embodiment of the invention provides can also be realized the scanning of dynamic storage data line is detected when realizing the detection of dynamic memory address line sweep.At this moment, before step S101 or after the step S103, can also may further comprise the steps: be under 0 the scan pattern and data line is under 1 the scan pattern at data line respectively, test data write a plurality of scannings subspace of dynamic storage; Be under 0 the scan pattern at data line or data line is under 1 the scan pattern, the read test data respectively from a plurality of scannings subspace; The data that read and the corresponding test data that writes a plurality of scannings subspace are compared the output comparative result.
Particularly, be that the step that test data is write a plurality of scannings subspace of dynamic storage may further comprise the steps again under 0 the scan pattern at data line: generate the 4th pointer variable of pointing to the dynamic storage base address; With test data 0x0000, the 32 bit scan subspaces that the current address that 0001 the 4th pointer variable that writes generation is pointed to begins; Calculate the 4th pointer variable, make the 4th pointer variable point to the first address of one scan subspace down; Adopting shifting algorithm to produce next is another test data of 1 according to data line; Another test data is write the 32 bit scan subspaces that current address that the 4th pointer variable points to begins, return afterwards and calculate the 4th pointer variable, make the 4th pointer variable point to the step of the first address of one scan subspace down, so circulation is all preserved test data until whole scannings subspace.
Wherein, adopting shifting algorithm to produce next is that the step of another test data of 1 can may further comprise the steps again according to data line: current test data is moved to left 1; Current test data is moved to right 31; With move to left after 1 data with move to right after 31 data mutually or, can remove in the current test data is 1 position, and is 1 with the Data Position of next data lines correspondence.
Be that the step that test data is write a plurality of scannings subspace of dynamic storage may further comprise the steps again under 1 the scan pattern at data line: generate a five fingers pin variable that points to the dynamic storage base address; With test data 0xFFFF, FFFE writes the 32 bit scan subspaces that current address that the five fingers pin variable of generation points to begins; Calculate the five fingers pin variable, make the five fingers pin variable point to the first address of one scan subspace down; Adopting shifting algorithm to produce next is another test data of 0 according to data line; Another test data is write the 32 bit scan subspaces that current address that the five fingers pin variable points to begins, return afterwards and calculate the five fingers pin variable, make the five fingers pin variable point to the step of the first address of one scan subspace down, so circulation is all preserved test data until whole scannings subspace.
Scanning detection method at the dynamic storage that adopts the embodiment of the invention to provide carries out dynamic storage in the process of address wire detection and data line detection, may produce the detection mistake owing to data logical laws and address logic rule, generation for fear of this kind situation, the embodiment of the invention can also may further comprise the steps before step S101 or after the step S103: start timing; After starting timing, adopt iterative algorithm to produce the interior random address of a dynamic memory address scope; Write the random address that produces in the scanning subspace of this random address correspondence as test data; If timing time reaches when presetting sweep time, then from the scanning subspace, read the random address that writes, otherwise return the step that adopts iterative algorithm to produce the random address in the dynamic memory address scope; The corresponding test data of the random address that reads and the scanning subspace that writes is compared the output comparative result.
Fig. 2 shows the structure of the scanning-detecting system of the dynamic storage that the embodiment of the invention provides, and for convenience of explanation, only shows the part relevant with the embodiment of the invention.
The scanning-detecting system of the dynamic storage that the embodiment of the invention provides comprises: first data write unit 11 is used for respectively data being write a plurality of scannings subspace of dynamic storage under at least two kinds of different address scan patterns; Data-reading unit 12 is used for after first data write unit 11 writes data a plurality of scannings subspace, reading data respectively from a plurality of scannings subspace under every kind of address scan pattern; Relatively output unit 13 is used for the data that data-reading unit 12 is read and the corresponding data that first data write unit 11 writes a plurality of scannings subspace and compares, and exports comparative result.
Wherein, the address scan pattern can be word scan pattern, half-word scan pattern or byte scan pattern etc.Under the word scan pattern, each scanning subspace of dynamic storage includes four storage unit, and for dynamic storage, storing 1 bytes of memory space is a storage unit, that is to say that each scanning subspace of dynamic storage comprises 32 storage spaces; Under the half-word scan pattern, each scanning subspace of dynamic storage includes two storage unit, namely comprises 16 storage spaces; Under the byte scan pattern, each scanning subspace of dynamic storage includes a storage unit, namely comprises 8 storage spaces.
Wherein, the data that write a plurality of scannings subspace can be tentation data or random data, and the figure place of this tentation data or random data is according to the difference of the scanning subspace size of different addresses scan pattern correspondence and difference.For fear of the testing result that the data rule makes the mistake, preferably, the data that write a plurality of scannings subspace are random data.
For instance, when the data that write a plurality of scannings subspace are random data, and when with word scan pattern, half-word scan pattern and byte scan pattern dynamic storage being detected in turn respectively, Fig. 3 shows the structure of first data write unit 11 among Fig. 2.
First data write unit 11 comprises: the first pointer variable generation module 111, be used under the word scan pattern, and generate the first pointer variable current_pre of a sensing dynamic storage base address; The first random data generation module 112 is used for adopting iterative algorithm to produce one 32 random data word_pattern; First writing module 113 is used for 32 random data word_pattern that the first random data generation module 112 produces are write the 32 bit scan subspaces that current address that the first pointer variable current_pre that the first pointer variable generation module 111 generates points to begins; First computing module 114 is used for calculating the first pointer variable current_pre, makes the pointer variable current_pre that wins point to the first address of one scan subspace down; The second random data generation module 115 is used for adopting shifting algorithm to produce another 32 random data word_pattern '; First writing module 113 also is used for another 32 random data word_pattern ' that the second random data generation module 115 produces are write the 32 bit scan subspaces that current address that the first pointer variable current_pre that first computing module 114 calculates points to begins, calculate the first pointer variable current_pre by first computing module 114 afterwards, make the pointer variable current_pre that wins point to the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
Wherein, the second random data generation module 115 adopts step that shifting algorithms produce another 32 random data word_pattern ' as mentioned above, does not repeat them here.
Further, comprehensive scanning in order to ensure storage unit covers, the scanning-detecting system of the dynamic storage that the embodiment of the invention provides can also comprise: second computing module 117, be used for after the corresponding data that data that output unit 13 relatively reads data-reading unit 12 and first data write unit 11 write a plurality of scannings subspace compares, calculate first pointer variable, make the pointer variable of winning point to the base address of dynamic storage; First writing module 113 also is used for writing tentation data to the 32 bit scan subspaces that the current address of the current sensing of first pointer variable begins; Second computing module 117 also is used for calculating first pointer variable, makes the pointer variable of winning point to the first address of one scan subspace down; First writing module 113 also is used for writing tentation data to the 32 bit scan subspaces that the current address of the current sensing of first pointer variable begins; Calculate first pointer variable by second computing module 117 afterwards, make the pointer variable of winning point to the step of the first address of one scan subspace down, so circulation is all preserved tentation data until whole scannings subspace.Because each of each storage unit is 0 or 1, therefore, tentation data wherein is special data, as: 0x0000,0000,0x5555,5555,0xaaaa, aaaa etc. are to guarantee that storage unit is covered comprehensively.
In addition, first data write unit 11 also comprises: handover module 116 is used for switching the half-word scan pattern after relatively output unit 13 is exported comparative result under the word scan pattern; The first pointer variable generation module 111 also is used for after handover module 116 switches to the half-word scan pattern, generates second pointer variable of a sensing dynamic storage base address; The first random data generation module 112 also is used for adopting iterative algorithm to produce one 16 random data; 16 random data that first writing module 113 also is used for producing write the 16 bit scan subspaces that the current address of second pointer variable sensing of generation begins; First computing module 114 also is used for calculating second pointer variable, makes second pointer variable point to the first address of one scan subspace down; The second random data generation module 115 also is used for adopting shifting algorithm to produce another 16 random data; Another 16 random data that first writing module 113 also is used for producing write the 16 bit scan subspaces that the current address of second pointer variable sensing begins, calculate second pointer variable by first computing module 114 afterwards, make second pointer variable point to the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
In addition, handover module 116 also is used for switching the byte scan pattern after relatively output unit 13 is exported comparative result under the half-word scan pattern, and the first pointer variable generation module 111 also is used for the 3rd pointer variable that the dynamic storage base address is pointed in generation one; The first random data generation module 112 also is used for adopting iterative algorithm to produce one 8 random data; 8 random data that first writing module 113 also is used for producing write the 8 bit scan subspaces that the current address of the 3rd pointer variable sensing of generation begins; First computing module 114 also is used for calculating the 3rd pointer variable, makes the 3rd pointer variable point to the first address of one scan subspace down; The second random data generation module 115 also is used for adopting shifting algorithm to produce another 8 random data; Another 8 random data that first writing module 113 also is used for producing write the 8 bit scan subspaces that the current address of the 3rd pointer variable sensing begins, calculate second pointer variable by first computing module 114 afterwards, make second pointer variable point to the first address of one scan subspace down, so circulation is all preserved random data until whole scannings subspace.
The scanning-detecting system of the dynamic storage that the embodiment of the invention provides can also be realized the scanning of dynamic storage data line is detected when realizing the detection of dynamic memory address line sweep.At this moment, the scanning-detecting system of the dynamic storage that the embodiment of the invention provides can also comprise: second data write unit 14, being used for respectively at data line is under 0 the scan pattern and data line is under 1 the scan pattern, test data is write a plurality of scannings subspace of dynamic storage; It is under 0 the scan pattern or data line is under 1 the scan pattern that data-reading unit 12 also is used at data line, reads the test data that second data write unit 14 writes respectively from a plurality of scannings subspace; Relatively output unit 13 also is used for the data that data-reading unit 12 is read and the corresponding test data that second data write unit 14 writes a plurality of scannings subspace and compares, and exports comparative result.
Fig. 4 shows the structure of second data write unit 14 among Fig. 2.
Second data write unit 14 comprises: the second pointer variable generation module 141, be used under data line is 0 scan pattern, and generate the 4th pointer variable of pointing to the dynamic storage base address; Second writing module 142 is used for test data 0x0000, the 32 bit scan subspaces that the current address that 0001 the 4th pointer variable that writes 141 generations of the second pointer variable generation module is pointed to begins; The 3rd computing module 143 is used for calculating the 4th pointer variable, makes the 4th pointer variable point to the first address of one scan subspace down; Test data generation module 144, be used for adopting shifting algorithm to produce next is another test data of 1 according to data line; Second writing module 142 also is used for another test data that test data generation module 144 produces is write the 32 bit scan subspaces that current address that the 4th pointer variable that the 3rd computing module 143 calculates points to begins, calculate the 4th pointer variable by the 3rd computing module 143 afterwards, make the 4th pointer variable point to the first address of one scan subspace down, so circulation is all preserved test data until whole scannings subspace.
Wherein, data generation module 144 adopt shifting algorithms produce next according to data line be another test data of 1 process as mentioned above, do not repeat them here.
In addition, the second pointer variable generation module 141 also is used under data line is 1 scan pattern, generates a five fingers pin variable that points to the dynamic storage base address; Second writing module 142 also is used for test data 0xFFFF, and FFFE writes the 32 bit scan subspaces that current address that the five fingers pin variable that the second pointer variable generation module 141 generates points to begins; The 3rd computing module 143 also is used for calculating the five fingers pin variable, makes the five fingers pin variable point to the first address of one scan subspace down; It is another test data of 0 according to data line that test data generation module 144 also be used for to adopt shifting algorithm to produce next; Second writing module 142 also is used for another test data that test data generation module 144 produces is write the 32 bit scan subspaces that current address that the five fingers pin variable that the 3rd computing module 143 calculates points to begins, calculate the five fingers pin variable by the 3rd computing module 143 afterwards, make the five fingers pin variable point to the first address of one scan subspace down, so circulation is all preserved test data until whole scannings subspace.
For fear of the detection mistake that produces owing to data logical laws and address logic rule, the scanning-detecting system of the dynamic storage that the embodiment of the invention provides can also comprise: timing unit 17 is used for timing; Random address generation unit 16 is used for after timing unit 17 starts timing, adopts iterative algorithm to produce the interior random address of a dynamic memory address scope; The 3rd data write unit 15 is used for the random address that random address generation unit 16 produces is write as test data the scanning subspace of this random address correspondence; When data-reading unit 12 also is used for timing time at timing unit 17 and reaches default sweep time, from the scanning subspace, read the random address that the 3rd data write unit 15 writes; When random address generation unit 16 also is used for timing time at timing unit 17 and does not reach default sweep time, adopt iterative algorithm to produce random address in the dynamic memory address scope; Relatively output unit 13 also is used for the random address that data-reading unit 12 is read and the corresponding test data that the 3rd data write unit 15 writes the scanning subspace and compares, and exports comparative result.
The scanning detection method of the dynamic storage that the embodiment of the invention provides is to adopt at least two kinds of different address scan patterns with system, respectively dynamic storage is scanned detection, can cover the address of each storage unit of dynamic storage really, testing result is more accurate; And further, adopt random data that dynamic storage is scanned detection, avoided the influence of data rule to testing result, further improved the degree of accuracy of testing result.Have again, the scanning detection method of the dynamic storage that the embodiment of the invention provides and system are in the scanning detection that realizes the dynamic memory address line, can also be that 1 scan pattern and/or data line are under 0 the scan pattern at data line, realize the scanning of dynamic storage data line is detected.In addition, the scanning detection method of the dynamic storage that the embodiment of the invention provides and system can also be by constantly generating random address in default sweep time, and read comparison after random address write the respective scanned subspace as data, with the detection mistake of avoiding producing owing to data logical laws and address logic rule, further improve and detect degree of accuracy.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is can control relevant hardware by program to finish, described program can be in being stored in a computer read/write memory medium, described storage medium is as ROM/RAM, disk, CD etc.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.