The present invention relates to a data buffer device, a cache device, and a data buffer control method of improving persistence of data and uniformity of use frequency.
RIRO type (Random In Random Out) data buffer commonly adopts control using a priority selection system. Buffers to be released are randomly selected in the RIRO type data buffers controlled under the priority selection system. Buffers are selected in order from one given the smallest number.
At first, buffers 1, 2, and 3 are set to “used” as shown in
As described above, in the conventional priority selection system, the buffer denoted at the smallest number is frequently used and past data does not remain. Further, since use frequencies are unbalanced between individual buffers, operation errors can be detected late if operation errors occur in a buffer assigned to a greater number.
To solve this problem, FIFO (First In First Out) type data buffers popularly use buffer control based on a counter.
At first, as in the first state shown in
However, if such control using a counter is employed in RIRO type data buffers, an unused buffer is used again when a counter designates the unused buffer. Therefore, use efficiency of buffers degrades extremely.
For strict order control, PM (Precedence Matrix) and LRU (Least Recently Used) are used. The PM system will now be described. When a buffer is used, the buffer records that the buffer itself is the newest. When a buffer is released, the buffer records that the buffer is older than the buffer being used.
At first, as in the first state shown in
That is, the more “1” a line denoted at a buffer number in a state includes, the older the data remaining in the corresponding buffer is. The corresponding buffer is dealt with as a target to store data next. Next, the buffer 4 is released as in the sixth state shown in
However, the PM system as described above has an effective feature that order can be controlled strictly. On the other side, the PM system requires (nˆ2)−n latches for controlling n buffers in addition to complex logic of the system. Therefore, the PM system causes increase in exponential circuit scale.
For example, Jpn. Pat. Appln. Laid-Open Publication No. 2003-84999 (pages 3 to 5 and
Problems to be Solved by the Invention
Devices using a conventional data buffer are involving a problem that time required for verifying a design or checking a malfunction extends longer. As a factor causing this problem is that necessary and sufficient information can not be obtained or is lost. In addition, in the RIRO type data buffers as described above, use frequencies vary between data buffers due to its structure. Therefore, even devices including defects at parts which are less frequently used can pass tests. Thus, there can be omissions in running tests.
The present invention has been made to address the above problems and is directed to providing a data buffer device, a cache device, and a data buffer control method which allow information necessary for verifications or inspections to remain and equalize use frequencies, thereby to improve test efficiency.
Means for Solving the Problem
According to one aspect of the invention to address the above problems, there is provided a data buffer device that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the device including: plural buffers that store data and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; and a priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers.
Preferably in the data buffer device, if. there is no non-masked and unused buffer, the mask bit vector is reset.
According to another aspect of the invention, there is provided a data buffer device that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the device including: plural buffers that store data and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; a second priority select section that selects a buffer given the smallest number from unused buffers among the plural buffers; and a selector that selects one of the buffer selected by the first priority select section and the buffer selected by the second priority select section.
Preferably in the data buffer device, if all of the plural buffers are masked, the mask bit vector is reset.
According to further another aspect of the invention, there is provided a data buffer device that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the device including: plural buffers that store data and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; and a second priority select section that selects, if the first priority select section selects no buffer, a buffer given the smallest number from unused buffers among the plural buffers.
According to still another aspect of the invention, there is provided a cache device that selects and uses buffers to improve persistence of request and uniformity in use frequency of the buffers, the device including: plural buffers that store requests and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; a request processing section that processes one after another of the requests stored in the buffers; and a data section that reads or writes data in response to the requests processed by the request processing section.
According to still another aspect of the invention, there is provided a cache device that selects and uses buffers to improve persistence of request and uniformity in use frequency of the buffers, the device including: plural buffers that store requests and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; a second priority select section that selects a buffer given the smallest number from unused buffers among the plural buffers; a selector that selects one of the buffer selected by the first priority select section and the buffer selected by the second priority select section; a request processing section that processes one after another of the requests stored in the buffers; and a data section that reads or writes data in response to the requests processed by the request processing section.
According to still another aspect of the invention, there is provided a cache device that selects and uses buffers to improve persistence of request and uniformity in use frequency of the buffers, the device including: plural buffers that store requests and are given numbers; a mask bit vector that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select section that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; a second priority select section that selects, if the first priority select section selects no buffer, a buffer given the smallest number from unused buffers among the plural buffers; a request processing section that processes one after another of the requests stored in the buffers; and a data section that reads or writes data in response to the requests processed by the request processing section.
According to still another aspect of the invention, there is provided a data buffer control method that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the method including: a mask step that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; and a priority select step that selects a buffer given the smallest number from buffers that are neither masked by the mask step nor used among the plural buffers.
The data buffer control method preferably further includes a mask reset step that resets all of the mask bit patterns if there is not a buffer any more that is neither masked nor used among the plural buffers.
According to still another aspect of the invention, there is provided a data buffer control method that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the method including: a mask step that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select step that selects a buffer given the smallest number from buffers that are neither masked by the mask step nor used among the plural buffers; a second priority select step that selects a buffer given the smallest number from unused buffers among the plural buffers; and a select step that selects one of the buffer selected by the first priority select step and the buffer selected by the second priority select step.
The data buffer control method preferably further includes a reset step that resets all of the mask bit patterns if there is not a buffer any more that is not masked.
According to still another aspect of the invention, there is provided a data buffer control method that selects and uses buffers to improve persistence of data and uniformity in use frequency of the buffers, the method including: plural buffers that store data and are given numbers; a mask step that has mask bit patterns to mask the plural buffers, respectively, and sets corresponding one of the mask bit patterns for a released buffer among the plural buffers; a first priority select step that selects a buffer given the smallest number from buffers that are neither masked by the mask bit vector nor used among the plural buffers; and a second priority select step that selects, if the first priority select step selects no buffer, a buffer given the smallest number from unused buffers among the plural buffers.
The “plural buffers” described above correspond to the REQ_QUEUE in the embodiments.
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
At first, a configuration of a cache device having a data buffer device will be described.
The REQ_QUEUE 11 is constituted by n buffers (where n is an integer) and stores requests from the CPU. Stored requests are supplied one after another to the request processing section 2. Data is read from or written into a main storage device by a data section 3 in response to the requests. Processed requests are erased from the REQ_QUEUE 11. If processing is not completed due to an interlock or the like, the request is supplied again to the request processing section 2 from the REQ_QUEUE 11, and the processing is automatically reexecuted. At this time, processing is completed regardless of order of supplied requests. Therefore, the REQ_QUEUE 11 is constituted by RIRO type buffers.
The mask-bit vector 12 has n mask bit patterns and masks a released buffer when releasing the buffer. That is, a mask bit pattern corresponding to a released buffer is set to “1”. In this embodiment, the mask bit vector 12 is reset to all “0” if all buffers are masked, i.e., if the mask bit vector becomes all “1”.
The first priority select section 13 selects an empty buffer given the smallest number among remaining buffers masked by mask bit vectors. The second priority select section 14 selects an empty buffer given the smallest number among all buffers. The selector 15 selects firstly a buffer selected by the first priority select section 13. If no buffer is selected by the first priority select section 13, a buffer selected by the second priority select section 14 is selected.
Next, operation of the data buffer device will be described.
Firstly, the REQ_QUEUE 11 determines whether a request has been received or not (S1). If no request has been received (S1, N), the processing returns to the processing step S1. Next, the selector 15 determines whether or not the first priority select section (first PS section) 13 has selected a buffer (S2). Operation of buffer selection by the first priority select section 13 will be described later. If a buffer is selected by the first priority select section 13, the selector 15 sets a request in the buffer selected by the first priority select section 13 (S3). This flow is then terminated.
Otherwise, if no buffer is selected by the first priority select section 13 (S2, N), the selector 15 determines whether the second priority select section (second PS section) 14 has selected a buffer or not (S4). Operation of buffer selection by the second priority select section 14 will be described later. If a buffer is selected by the second priority select section 14, the selector 15 sets a request in the buffer selected by the second priority select section 14 (S5). This flow is then terminated. Otherwise, If no buffer is selected by the second priority select section 14 (S4, N), error processing is carried out (S6). This flow is then terminated.
If V+M=0 is satisfied (S21, Y), the buffer 0 is selected (S22), and this flow is then terminated. If V+M=0 is not satisfied (S21, N), whether or not the buffer 1 satisfies V+M=0 is determined (S23). If V+M=0 is satisfied (S23, Y), the buffer 1 is selected (S24), and this flow is then terminated. If V+M=0 is not satisfied (S23, N), whether or not the buffer 2 satisfies V+M=0 is determined (S25). If V+M=0 is satisfied (S25, Y), the buffer 2 is selected (S26), and this flow is then terminated. If V+M=0 is not satisfied (S25, N), whether or not the buffer 3 satisfies V+M=0 is determined (S27). If V+M=0 is satisfied (S27, Y), the buffer 3 is selected (S28), and this flow is then terminated. If V+M 32 0 is not satisfied (S27, N), whether or not the buffer 4 satisfies V+M=0 is determined (S29). If V+M=0 is satisfied (S29, Y), the buffer 4 is selected (S30), and this flow is then terminated. If V+M=0 is not satisfied (S29, N), no buffer is selected, and this flow is then terminated.
That is, whether or not the buffer 0 is unused is determined.
If V=0 is satisfied (S31, Y), the buffer 0 is selected (S32), and this flow is then terminated. If V=0 is not satisfied (S31, N), whether or not the buffer 1 satisfies V=0 is determined (S33). If V=0 is satisfied (S33, Y), the buffer 1 is selected (S34), and this flow is then terminated. If V=0 is not satisfied (S33, N), whether or not the buffer 2 satisfies V=0 is determined (S35). If V=0 is satisfied (S35, Y), the buffer 2 is selected (S36), and this flow is then terminated. If V=0 is not satisfied (S35, N), whether or not the buffer 3 satisfies V=0 is determined (S37). If V=0 is satisfied (S37, Y), the buffer 3 is selected (S38), and this flow is then terminated. If V=0 is not satisfied (S37, N), whether or not the buffer 4 satisfies V=0 is determined (S39). If V=0 is satisfied (S39, Y), the buffer 4 is selected (S40), and this flow is then terminated. If V=0 is not satisfied (S39, N), the buffer 0 is selected (S41), and this flow is then terminated.
Next, a specific example of operation of the data buffer device will be described.
Next, as in the second state shown in
Next, if processing for the buffer 0 is completed, this buffer is released and V=0 is set, as in the third state shown in
Next, as in the fourth state shown in
Next, as in the fifth state shown in
Next, if processing for the buffer 2 is completed, this buffer is released and M=1 is set, as in the sixth state shown in
Next, as in the seventh state shown in
Next, if processing for the buffers 1 and 3 is completed as in the second state shown in
Next, if one request arrives as in the third state shown in
Next, if one request arrives as in the fourth state shown in
Next, if processing for the buffer 1 is completed as in the fifth state shown in
Next, if processing for the buffer 0 is completed as in the sixth state shown in
Next, if processing for the buffer 4 is completed as in the seventh state shown in
Next, if the mask bit vector 12 is set to all “1” as in the eighth state shown in
Next, as in the ninth state shown in
In this embodiment, if the first priority select section 13 selects no buffer, the selector 15 selects a buffer selected by the second priority select section 14. However, the embodiment can be configured such that the selector 15 is omitted and the second priority select section 14 selects a buffer if no buffer is selected by the first priority select section 13.
At first, a configuration of a cache device having a data buffer device will be described.
If existence of an empty buffer can be guaranteed logically, the second priority select section 14 and the selector 15 described above are not indispensable.
In this embodiment, the mask bit vector 112 is reset, if no empty buffer remains after masking.
Next, operation of the data buffer device will be described.
If there is an unused buffer (S54, Y), the first priority select section 113 determines whether or not an unused buffer remains among buffers after masking (S56). If there is no unused buffer among the buffers after masking (S56, N), the mask-bit vector 112 is reset (S57). Next, the first priority select section 113 selects a buffer (S58) and sets a request in the selected buffer (S59). This flow is then terminated. The first priority select section 113 performs the selection of a buffer through the same operation as shown in
Next, a specific example of operation of the data buffer device will be described.
Next, if processing for the buffers 1 and 3 is completed as in the second state shown in
Next, as in the third state shown in
Next, if one request arrives as in the fourth state shown in
Next, if one request arrives as in the fifth state shown in
Next, if processing for the buffer 1 is completed, this buffer is released and M=1 is set, as in the sixth state shown in
Next, if processing for the buffer 0 is completed, this buffer is released and M=1 is set, as in the seventh state shown in
Next, if processing for the buffer 4 is completed, this buffer is released and M=1 is set, as in the eighth state shown in
Next, if one request arrives as in the ninth state shown in
As can be understood from comparison between the state of
By the data buffer device as described above, persistence of data. buffered in the past can be improved and use efficiencies of buffers can be equalized while restricting increase in circuit scale to be as small as possible.
The present invention can be realized by very few circuits, i.e., n latches for buffers in n stages. Although data is not always erased in order from the oldest buffer, a remarkable improvement in persistence of data can be expected. Since activity ratios can be equalized between buffers. In tests concerning screening and the like, time required until all buffers are used become definitive. In addition, program patterns can be created so easily that test efficiencies improve.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP04/17923 | Dec 2004 | US |
Child | 11802069 | May 2007 | US |