Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, 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 explain the present invention, be not intended to limit the present invention.
For prior art Problems existing, the scanning detection method of the dynamic storage that the embodiment of the present invention provides adopts at least two kinds of different address scan patterns, detects respectively to dynamic storage.
Fig. 1 is the flow process of the scanning detection method of the dynamic storage that the embodiment of the present invention provides.
In step S101, respectively under at least two kinds of different address scan patterns, data are write multiple scanning subspaces of dynamic storage.
Wherein, address scan pattern can be word scan pattern, half-word scan pattern or byte scan pattern etc.Under word scan pattern, every one scan subspace of dynamic storage includes four storage unit, and for dynamic storage, the storage space storing 1 byte is a storage unit, that is to say, every one scan subspace of dynamic storage comprises 32 storage spaces; Under half-word scan pattern, every one scan subspace of dynamic storage includes two storage unit, namely comprises 16 storage spaces; Under byte scan pattern, every one scan subspace of dynamic storage includes a storage unit, namely comprises 8 storage spaces.
Wherein, the data writing multiple scanning subspace can be tentation data or random data, and the figure place of this tentation data or random data is different from the difference of scanning subspace size corresponding to different addresses scan pattern.In order to avoid the testing result that data rule makes the mistake, preferably, the data writing multiple scanning subspace are random data.
In step s 102, under often kind of address scan pattern, after data being write multiple scanning subspace, read data respectively from multiple scanning subspace.
In step s 103, the corresponding data of the data read with the multiple scanning subspace of write is compared, exports comparative result.
For example, data when the multiple scanning subspace of write are random data, and when dynamic storage being detected with word scan pattern, half-word scan pattern and byte scan pattern in turn respectively, under word scan pattern, step data being write multiple scanning subspaces of dynamic storage specifically can comprise the following steps: generate the first pointer variable current_pre that points to dynamic storage base address; Iterative algorithm is adopted to produce one 32 random data word_pattern; The 32 bit scan subspaces that the current address 32 the random data word_pattern produced being write the first pointer variable current_pre sensing generated starts; Calculate the first pointer variable current_pre, make the first pointer variable current_pre point to the first address of lower one scan subspace; Shifting algorithm is adopted to produce another 32 random data word_pattern '; The 32 bit scan subspaces that the current address another 32 the random data word_pattern ' produced being write the first pointer variable current_pre sensing starts, return calculating first pointer variable current_pre afterwards, the first pointer variable current_pre is made to point to the step of the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
Wherein, the step adopting shifting algorithm to produce another 32 random data word_pattern ' comprises the following steps again: current 32 random data are moved to left 5; Current 32 random data are moved to right 27; By move to left the data after 5 with move to right the data phase after 27 or; By mutually or after 32 random data be added with 32 random data word_pattern that employing iterative algorithm produces, 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 present invention, under word scan pattern, after the step that the data read and the corresponding data of the multiple scanning subspace of write are compared, can also comprise the following steps: calculate the first pointer variable, make the first pointer variable point to the base address of dynamic storage; The 32 bit scan subspace write tentation datas that current address to the current sensing of the first pointer variable starts; Calculate the first pointer variable, make the first pointer variable point to the first address of lower one scan subspace; The 32 bit scan subspace write tentation datas that current address to the current sensing of the first pointer variable starts; Return calculating first pointer variable afterwards, make the first pointer variable point to the step of the first address of lower one scan subspace, so circulate, until all tentation data is all preserved in scanning subspace.Because each of each storage unit is 0 or 1, therefore, tentation data is wherein special data, as: 0x0000,0000,0x5555,5555,0xaaaa, aaaa etc., to guarantee that storage unit is covered comprehensively.
Afterwards, under word scan pattern, after exporting the step of comparative result, also comprise the step switching half-word scan pattern, under half-word scan pattern, step data being write multiple scanning subspaces of dynamic storage specifically can comprise the following steps: generate the second pointer variable that points to dynamic storage base address; Iterative algorithm is adopted to produce one 16 random data; By the 16 bit scan subspaces that the current address that the second pointer variable that 16 the random data writes produced generate is pointed to starts; Calculate the second pointer variable, make the second pointer variable point to the first address of lower one scan subspace; Shifting algorithm is adopted to produce another 16 random data; The 16 bit scan subspaces that the current address another 16 random data produced being write the second pointer variable sensing starts, return calculating second pointer variable afterwards, the second pointer variable is made to point to the step of the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
Afterwards, under half-word scan pattern, after exporting the step of comparative result, also comprise the step switching byte scan pattern, under byte scan pattern, step data being write multiple scanning subspaces of dynamic storage specifically can comprise the following steps: generate the 3rd pointer variable that points to dynamic storage base address; Iterative algorithm is adopted to produce one 8 random data; By the 8 bit scan subspaces that the current address that the 3rd pointer variable that 8 the random data writes produced generate is pointed to starts; Calculate the 3rd pointer variable, make the 3rd pointer variable point to the first address of lower one scan subspace; Shifting algorithm is adopted to produce another 8 random data; By the 8 bit scan subspaces that the current address that another 8 random data write the 3rd pointer variables produced are pointed to starts, return calculating the 3rd pointer variable afterwards, the 3rd pointer variable is made to point to the step of the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
Unlike the prior art, the scanning detection method of the dynamic storage that the embodiment of the present invention provides adopts at least two kinds of different address scan patterns, respectively Scanning Detction is carried out to dynamic storage, can cover each access unit address of dynamic storage really, testing result is more accurate; And further, adopt random data to carry out Scanning Detction to dynamic storage, avoid the impact of data rule on testing result, further increase the degree of accuracy of testing result.
The scanning detection method of the dynamic storage that the embodiment of the present invention provides, while realization detects dynamic memory address line sweep, can also realize the Scanning Detction to dynamic storage data line.Now, before step S101 or after step S103, can also comprise the following steps: at data line be respectively under the scan pattern of 0 and data line be under the scan pattern of 1, test data is write multiple scanning subspaces of dynamic storage; Be under the scan pattern of 0 at data line or data line is under the scan pattern of 1, the read test data respectively from multiple scanning subspaces; The corresponding test data of the data read to the multiple scanning subspace of write is compared, exports comparative result.
Particularly, be under the scan pattern of 0 at data line, step test data being write multiple scanning subspaces of dynamic storage comprises the following steps again: generate the 4th pointer variable that points to dynamic storage base address; By test data 0x0000, the 32 bit scan subspaces that the current address that the 4th pointer variable that 0001 write generates is pointed to starts; Calculate the 4th pointer variable, make the 4th pointer variable point to the first address of lower one scan subspace; Shifting algorithm is adopted to produce another test data that next according to data line is 1; By the 32 bit scan subspaces that the current address that another test data write the 4th pointer variable is pointed to starts, return calculating the 4th pointer variable afterwards, the 4th pointer variable is made to point to the step of the first address of lower one scan subspace, circulation like this, until all test data is all preserved in scanning subspace.
Wherein, adopting shifting algorithm to produce next is that the step of another test data of 1 can comprise the following steps again according to data line: current test data moved to left 1; Current test data is moved to right 31; By move to left the data after 1 with move to right the data phase after 31 or, can remove in current test data be 1 position, and be 1 by Data Position corresponding for next data lines.
Be under the scan pattern of 1 at data line, step test data being write multiple scanning subspaces of dynamic storage comprises the following steps again: generate the 5th pointer variable that points to dynamic storage base address; By the 32 bit scan subspaces that the current address that the 5th pointer variable that test data 0xFFFF, FFFE write generates is pointed to starts; Calculate the 5th pointer variable, make the 5th pointer variable point to the first address of lower one scan subspace; Shifting algorithm is adopted to produce another test data that next according to data line is 0; By the 32 bit scan subspaces that the current address that another test data write the 5th pointer variable is pointed to starts, return calculating the 5th pointer variable afterwards, the 5th pointer variable is made to point to the step of the first address of lower one scan subspace, circulation like this, until all test data is all preserved in scanning subspace.
Carry out in the process of address wire detection and data line detection at the scanning detection method of the dynamic storage adopting the embodiment of the present invention to provide to dynamic storage, detection mistake may be produced due to mathematical logic rule and address logic rule, in order to avoid the generation of this kind of situation, the embodiment of the present invention, before step S101 or after step S103, can also comprise the following steps: start timing; After startup timing, employing iterative algorithm produces the random address within the scope of a dynamic memory address; The random address of generation is write in scanning subspace corresponding to this random address as test data; If when timing time reaches default sweep time, then from scanning subspace, read the random address of write, otherwise return the step adopting iterative algorithm to produce the random address within the scope of a dynamic memory address; The corresponding test data of the random address read to the scanning subspace of write is compared, exports comparative result.
Fig. 2 shows the structure of the scanning-detecting system of the dynamic storage that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
The scanning-detecting system of the dynamic storage that the embodiment of the present invention provides comprises: the first data write unit 11, for respectively under at least two kinds of different address scan patterns, data is write multiple scanning subspaces of dynamic storage; Data-reading unit 12, under often kind of address scan pattern, after data are write multiple scanning subspace by the first data write unit 11, reads data respectively from multiple scanning subspace; Relatively output unit 13, the corresponding data that data and the first data write unit 11 for data-reading unit 12 being read write multiple scanning subspace compares, output comparative result.
Wherein, address scan pattern can be word scan pattern, half-word scan pattern or byte scan pattern etc.Under word scan pattern, every one scan subspace of dynamic storage includes four storage unit, and for dynamic storage, the storage space storing 1 byte is a storage unit, that is to say, every one scan subspace of dynamic storage comprises 32 storage spaces; Under half-word scan pattern, every one scan subspace of dynamic storage includes two storage unit, namely comprises 16 storage spaces; Under byte scan pattern, every one scan subspace of dynamic storage includes a storage unit, namely comprises 8 storage spaces.
Wherein, the data writing multiple scanning subspace can be tentation data or random data, and the figure place of this tentation data or random data is different from the difference of scanning subspace size corresponding to different addresses scan pattern.In order to avoid the testing result that data rule makes the mistake, preferably, the data writing multiple scanning subspace are random data.
For example, the data when the multiple scanning subspace of write are random data, and when detecting dynamic storage with word scan pattern, half-word scan pattern and byte scan pattern in turn respectively, Fig. 3 shows the structure of the first data write unit 11 in Fig. 2.
First data write unit 11 comprises: the first pointer variable generation module 111, under word scan pattern, generates the first pointer variable current_pre that points to dynamic storage base address; First random data generation module 112, produces one 32 random data word_pattern for adopting iterative algorithm; First writing module 113, the 32 bit scan subspaces that the current address that 32 random data word_pattern for being produced by the first random data generation module 112 write the first pointer variable current_pre sensing that the first pointer variable generation module 111 generates starts; First computing module 114, for calculating the first pointer variable current_pre, makes the first pointer variable current_pre point to the first address of lower one scan subspace; Second random data generation module 115, produces another 32 random data word_pattern ' for adopting shifting algorithm; The 32 bit scan subspaces that the current address that first writing module 113 another 32 random data word_pattern ' also for being produced by the second random data generation module 115 write the first pointer variable current_pre sensing that the first computing module 114 calculates starts, the first pointer variable current_pre is calculated afterwards by the first computing module 114, the first pointer variable current_pre is made to point to the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
Wherein, the second random data generation module 115 adopts shifting algorithm to produce the step of 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 present invention provides can also comprise: the second computing module 117, after the corresponding data writing multiple scanning subspace for the data that data-reading unit 12 read at relatively output unit 13 and the first data write unit 11 compares, calculate the first pointer variable, make the first pointer variable point to the base address of dynamic storage; The 32 bit scan subspace write tentation datas of the first writing module 113 also for starting to the current address of the current sensing of the first pointer variable; Second computing module 117, also for calculating the first pointer variable, makes the first pointer variable point to the first address of lower one scan subspace; The 32 bit scan subspace write tentation datas of the first writing module 113 also for starting to the current address of the current sensing of the first pointer variable; Calculate the first pointer variable by the second computing module 117 afterwards, make the first pointer variable point to the step of the first address of lower one scan subspace, so circulate, until all tentation data is all preserved in scanning subspace.Because each of each storage unit is 0 or 1, therefore, tentation data is wherein special data, as: 0x0000,0000,0x5555,5555,0xaaaa, aaaa etc., to guarantee that storage unit is covered comprehensively.
In addition, the first data write unit 11 also comprises: handover module 116, for after relatively output unit 13 exports comparative result under word scan pattern, switches half-word scan pattern; First pointer variable generation module 111, also for after handover module 116 switches to half-word scan pattern, generates the second pointer variable that points to dynamic storage base address; First random data generation module 112 is also for adopting iterative algorithm to produce one 16 random data; The 16 bit scan subspaces that the current address that first writing module 113 also points to for the second pointer variable 16 that produce random data writes generated starts; First computing module 114, also for calculating the second pointer variable, makes the second pointer variable point to the first address of lower one scan subspace; Second random data generation module 115 is also for adopting shifting algorithm to produce another 16 random data; The 16 bit scan subspaces that the current address that first writing module 113 also points to for another 16 random data produced being write the second pointer variable starts, the second pointer variable is calculated afterwards by the first computing module 114, the second pointer variable is made to point to the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
In addition, handover module 116 is also for after relatively output unit 13 exports comparative result under half-word scan pattern, and switch byte scan pattern, the first pointer variable generation module 111 is also for generating the 3rd pointer variable of a sensing dynamic storage base address; First random data generation module 112 is also for adopting iterative algorithm to produce one 8 random data; The 8 bit scan subspaces that the current address that first writing module 113 also points to for the 3rd pointer variable 8 that produce random data writes generated starts; First computing module 114, also for calculating the 3rd pointer variable, makes the 3rd pointer variable point to the first address of lower one scan subspace; Second random data generation module 115 is also for adopting shifting algorithm to produce another 8 random data; The 8 bit scan subspaces of the first writing module 113 also for the current address of another 8 random data write the 3rd pointer variables sensing produced is started, the second pointer variable is calculated afterwards by the first computing module 114, the second pointer variable is made to point to the first address of lower one scan subspace, circulation like this, until all random data is all preserved in scanning subspace.
The scanning-detecting system of the dynamic storage that the embodiment of the present invention provides, while realization detects dynamic memory address line sweep, can also realize the Scanning Detction to dynamic storage data line.Now, the scanning-detecting system of the dynamic storage that the embodiment of the present invention provides can also comprise: the second data write unit 14, for at data line be respectively 0 scan pattern under and under data line is the scan pattern of 1, test data is write multiple scanning subspaces of dynamic storage; Data-reading unit 12 also at data line be 0 scan pattern under or under data line is the scan pattern of 1, read the test data that the second data write unit 14 writes respectively from multiple scanning subspace; Relatively the data of output unit 13 also for data-reading unit 12 being read compare to the corresponding test data that the second data write unit 14 writes multiple scanning subspace, export comparative result.
Fig. 4 shows the structure of the second data write unit 14 in Fig. 2.
Second data write unit 14 comprises: the second pointer variable generation module 141, at data line be 0 scan pattern under, generate one and point to the 4th pointer variable of dynamic storage base address; Second writing module 142, for by test data 0x0000, the 32 bit scan subspaces that the current address that the 4th pointer variable that 0001 write second pointer variable generation module 141 generates is pointed to starts; 3rd computing module 143, for calculating the 4th pointer variable, makes the 4th pointer variable point to the first address of lower one scan subspace; Test data generation module 144, produces for adopting shifting algorithm another test data that next according to data line is 1; The 32 bit scan subspaces that the current address that the 4th pointer variable that second writing module 142 also calculates for another test data write the 3rd computing module 143 Test data generation module 144 produced is pointed to starts, the 4th pointer variable is calculated afterwards by the 3rd computing module 143, the 4th pointer variable is made to point to the first address of lower one scan subspace, circulation like this, until all test data is all preserved in scanning subspace.
Wherein, it is that the process of another test data of 1 is described above according to data line that data generation module 144 adopts shifting algorithm to produce next, does not repeat them here.
In addition, the second pointer variable generation module 141 also at data line be 1 scan pattern under, generate one and point to the 5th pointer variable of dynamic storage base address; The 32 bit scan subspaces that the current address that the 5th pointer variable that second writing module 142 also generates for test data 0xFFFF, FFFE being write the second pointer variable generation module 141 is pointed to starts; 3rd computing module 143, also for calculating the 5th pointer variable, makes the 5th pointer variable point to the first address of lower one scan subspace; Test data generation module 144 is also for adopt shifting algorithm to produce another test data that next according to data line is 0; The 32 bit scan subspaces that the current address that the 5th pointer variable that second writing module 142 also calculates for another test data write the 3rd computing module 143 Test data generation module 144 produced is pointed to starts, the 5th pointer variable is calculated afterwards by the 3rd computing module 143, the 5th pointer variable is made to point to the first address of lower one scan subspace, circulation like this, until all test data is all preserved in scanning subspace.
In order to avoid the detection mistake produced due to mathematical logic rule and address logic rule, the scanning-detecting system of the dynamic storage that the embodiment of the present invention provides can also comprise: timing unit 17, for timing; Random address generation unit 16, for after timing unit 17 starts timing, employing iterative algorithm produces the random address within the scope of a dynamic memory address; 3rd data write unit 15, writes in scanning subspace corresponding to this random address for the random address produced by random address generation unit 16 as test data; Data-reading unit 12, also for when the timing time of timing unit 17 reaches default sweep time, reads the random address that the 3rd data write unit 15 writes from scanning subspace; Random address generation unit 16 is not also for when the timing time of timing unit 17 reaches default sweep time, and employing iterative algorithm produces the random address within the scope of a dynamic memory address; The random address of comparison output unit 13 also for data-reading unit 12 being read writes to the 3rd data write unit 15 the corresponding test data scanning subspace and compares, and exports comparative result.
The scanning detection method of the dynamic storage that the embodiment of the present invention provides and system adopt at least two kinds of different address scan patterns, respectively Scanning Detction is carried out to dynamic storage, can cover each access unit address of dynamic storage really, testing result is more accurate; And further, adopt random data to carry out Scanning Detction to dynamic storage, avoid the impact of data rule on testing result, further increase the degree of accuracy of testing result.Have again, the scanning detection method of the dynamic storage that the embodiment of the present invention provides and system are while realizing the Scanning Detction to dynamic memory address line, under data line is the scan pattern of 1 and/or data line is the scan pattern of 0, the Scanning Detction to dynamic storage data line can also be realized.In addition, the scanning detection method of the dynamic storage that the embodiment of the present invention provides and system can also by constantly generating random address within default sweep time, and random address is read and compares behind data write respective scanned subspace, to avoid the detection mistake produced due to mathematical logic rule and address logic rule, improve further and detect degree of accuracy.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can control to be correlated with by program completes, described program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk, CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.