|Publication number||US4803616 A|
|Application number||US 06/781,512|
|Publication date||Feb 7, 1989|
|Filing date||Sep 30, 1985|
|Priority date||Oct 1, 1984|
|Publication number||06781512, 781512, US 4803616 A, US 4803616A, US-A-4803616, US4803616 A, US4803616A|
|Inventors||Kunio Uchiyama, Tadahiko Nishimukai, Atsushi Hasegawa|
|Original Assignee||Hitachi, Ltd., Hitachi Microcomputer Eng. Ltd.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (15), Referenced by (9), Classifications (5), Legal Events (4)|
|External Links: USPTO, USPTO Assignment, Espacenet|
The present invention relates to a buffer memory or cache memory, and more particularly to a way of judging the presence or absence of necessary data and dealing with the information on validity of the data.
A cache memory of this type has been disclosed in Japanese Unexamined Patent Publications Nos. 58-68286 and 58-68287 laid open in public on Apr. 23, 1983 and claiming a Priority right of West German Patent application filed on Sept. 30, 1981.
A buffer memory or cache memory copies and retains a portion of the contents of a main memory. When a data processing device requests data in the main memory, the buffer memory is first searched. If the data is present in the buffer memory, the data in the buffer memory is used without accessing the main memory. The main memory is accessed only when the data is not present in the buffer memory. In the above operation, a hit judgement, i.e., a judgement whether necessary data is present, i.e., a hit, is made wherein a certain time. In the case of a miss judgement, the activation of an access operation to the main memory is correspondingly delayed so that the processing speed lowers.
According to one of the control methods for a buffer memory, a validity flag is set for each data portion, e.g., each byte in the buffer memory. The validity flag indicates whether the contents of the data portion coincide with the corresponding data in the main memory. For instance, when the contents of some data portion in the main memory are updated for example by writing data in the main memory with an associated device in the system (e.g., I/0 devices) and if the old data which was stored in the corresponding location of the main memory has been copied to the buffer memory, then the contents of the corresponding validity flag are changed to indicate "invalid", i.e., to indicate that there was a renewal of data in the main memory, thus preventing processing of the old data.
With such a method, a check of a validity flag is unavoidable for a hit judgement. It is therefore desirable to shorten the check time for a validity flag so that a hit judgement on the cache memory is conducted at a high speed.
An object of the present invention is to make the time required for a hit judgement of a buffer memory as short as possible.
Another object of the present invention is to provide a cache memory which can make a hit judgement immediately after the end of searching a tag array, without waiting until the end of reading a data array.
A still further object of the present invention is to provide a buffer memory in which the overhead is reduced if valid data is not present in the buffer memory and thus improving the overall processing speed of a data processing device using buffer memories.
According to the present invention, validity flags for respective data portions are inputted to a tag array of a buffer memory. In searching the tag array, first it is decided based upon the data portion to be searched and an access mode whether the corresponding validity flag is to be considered as a search object or not. Thereafter, the corresponding address and validity flags are searched at the same time to thereby obtain a hit judgement signal directly from the search result outputs, i.e., word coincidence signals. Thus, it is possible to obtain a result of hit judgement without waiting for a data array readout.
FIG. 1 is a block diagram associated with a buffer memory;
FIG. 2 is a timing chart showing the operation of the device of FIG. 1;
FIG. 3 is a block diagram showing an embodiment of the present invention; and
FIG. 4 is an input/output comparison table for the mask control circuit shown in FIG. 3.
FIG. 1 shows the construction of a provisional circuit which ultimately leads to the present invention and has been obtained by an analysis of a conventional cache memory described above and having a function to perform a hit judgement including a validity flag search. A memory including a tag array 100 and a data array 130 constitutes a main part of a buffer memory.
A main memory 500 stores data D0, D1, ... having a byte unit length. The data array 130 in a first processor using the main memory 500 has data storage words 140-1 to 140-n each having data D0 to D3 of 4 byte unit length. Each word 110-1 to 110-n of the tag array has the upper 30 bits of the address (32 bits) at the main memory of the corresponding word 140-1 to 140-n of the data array 130. In this case, if the computer using this cache memory is constructed as a 32 bit machine, the cache memory is preferably constructed as having a 4 byte arrangement. Each word of the data array 130 comprises 4 byte data D0 to D3 and 1 bit validity flags V0 to V3 corresponding to the respective 4 byte data. If the first processor 600 requests data of the main memory 500, access control circuit 700 outputs an address data of 32 bits on an address line 170. The upper 30 bits 150 are supplied as a search input to the tag array 100. At the tag array 100, the coincidence or difference between the 30 bit address data contained in each word and the address data supplied as a search input is checked in parallel for the n words. If there is a coincidence, one of the word coincidence lines 120-1 to 120-n corresponding to the word having a coincidence is activated. In response to the activation, D0 to D3 and V0 to V3 of the corresponding word in the data array 130 are read out, V0 to V3 of which are transferred to a hit judgement circuit 190. The hit judgement circuit 190 checks a validity flag corresponding to the necessary data byte among the 4 byte data, based upon the lower 2 bit address data 160 and data length information 180 respectively sent from the access control circuit 700. After all of the necessary bytes are confirmed as valid, then a hit signal 200 is generated. A validity flag will be cleared if the access control circuit 700 has received a purge signal 760, from a second processor 800 which has updated the content of the main memory, or from an unrepresented peripheral device.
In the above construction, as shown in FIG. 2, three operational steps are needed before completion of a hit judgement 210, that is, a tag array search 220, a data array readout 230 and a hit judgement logical operation 240.
The data array readout time (t1 to t2) is time from when the voltage at the work coincidence line 120 of FIG. 1 is established to when the flag lines 270 are established.
If the number of words (4Śn) of the data array 130 becomes great, the number of connection MOS transistors in the data array 130 to be connected to the flag lines 270 also becomes great. The wiring length of each flag line becomes accordingly long, so that the establishment of a hit signal on the hit signal line 200 by the hit judgement circuit 190 is delayed.
FIG. 3 shows an embodiment of a circuit diagram associated with hit judgement according to the present invention, wherein the access control circuit 700 is for simplicity of description. A memory constructed of a tag array 300 and a data array 330 constitutes a main part of a buffer memory. The data array 330 is constructed of words 340-1 to 340-n each copying and storing a data block of 4 bytes (D0 to D3) from a main memory. The tag array 300 is constructed of words 310-1 to 310-n (for example, n =64), each of the words storing the upper 30 bits of the address data (32 bits) of the corresponding data array word and one-bit validity flags V0 to V3 corresponding to each byte D0 to D3. It is noted that the address is allocated for each byte and a validity flag "1" indicates valid, while "0" indicates invalid. The search result of each word of the tag array appears as a signal on a corresponding one of word coincidence lines 320-1 to 320-n, wherein "1" represents a success of search (or coincidence between the search input and the word contents), while "0" represents a failure.
A signal line 420 is supplied with address data (32 bits) for access of the main memory, the upper 30 bits 400 thereof being transferred to the tag array 300 as an search input while the lower 2 bits are transferred to a mask control circuit 480. The mask control circuit 480 also receives the length (the number of bytes) of the data to be accessed and an access mode (read or write) command 470. Based upon received input information, mask signals M0 to M3 are generated which indicate whether the respective validity flags V0 to V3 in the tag array are used as search objects. The mask signals M0 to M3 correspond respectively to the validity flags V0 to V3, wherein "1" indicates that the corresponding validity flag is to be used as a search object while "0" indicates that the corresponding validity flag is not used as a search object. Data to be accessed is here identified by the address of the lowest byte and the number of bytes or data length. The mask signals M0 to M3 take the values as shown in FIG. 4 in accordance with the combination of the lower 2 bits 410 of the address, data length 460 and access mode 470. In FIG. 4 "φ" indicates that the values have no connection with the operation.
Referring back to FIG. 3, signals 490-0 to 490-3 are search inputs relative to the validity flags V0 to V3 of the tag array 300, the signal always taking "1" when a search is needed. The signal 490 becomes an effective search input when the corresponding mask signal M0 to M3 is "1", while on the other hand it does not act as a search input at "0". If any one of the mask signals M0 to M3 is "0", then the validity flag at the position corresponding to this mask signal is excluded from a search object to be subjected to coincidence comparison.
An OR gate 430 functions as a hit judgement circuit and generates a hit judgement signal 440 upon reception of any one of the signals from word coincidence lines 320-1 to 320-n.
The time from when the voltage of a signal on the word coincidence line is established to when the hit judgement signal 440 is established becomes very short. The reason is that a hit judgement signal can be obtained by merely inputting a word coincidence signal to the OR circuit 430 and the afore-mentioned data array readout time is avoided which depends on the number of words n of the cache memory. If any one of the word coincidence lines becomes "1", the hit judgement signal 440 becomes "1" to indicate the presence of the requested data. Signals 450 represent the input/output data of the data array 330.
Next, the operation will be described. First, in case of data readout, the access control circuit of the first processor 600, without conducting a fetch activation to the main memory, starts operating to check whether the data to be read is present in the buffer memory. To this end, 32 bit address data 420 and a data length 460 are supplied from the access control circuit 700, and the access mode 470 shows a read mode. The mask control circuit 480 generates the mask signals M0 to M3 in conformity with FIG. 4 to indicate which validity flags V0 to V3 become search objects. The tag array 300 conducts a search in connection with the validity flags designated as search objects and the upper 30 bits of the address. The search result immediately appears as a hit judgement signal 440 through the word coincidence lines 320-1 to 320-n and the OR gate 430.
If the hit judgement signal 440 is a "hit" or "1", this means that the requested data is present in the data array 330 and also that it is valid. Therefore, instead of commanding a fetch activation to the main memory, an output signal 450 from the data array word corresponding to the tag array word which has been decided to have a coincidence at the search, is transferred to the access control circuit.
If the hit judgement signal 440 is "missed" or "0", this means that either the data at the designated address is not present or it is invalid even if it is present. Therefore, the access control circuit commands a fetch activation to the main memory 500 to read the requested data. It is to be appreciated that in the present invention the result of hit judgement is obtained prior to the readout of the data array 330.
Data read out from the main memory is used not only as an object of operation in the data processing device, but also the data is written in the data array 330. To this end, the access mode is changed to a write mode and the tag array 300 is again searched for decision of a storage location of the data. In this case, the address data 420 is retained to have the same address as in the previous search. It is noted that a write access mode is effected upon readout operation of the main memory. All of the mask signals M0 to M3 however become "0" in the write access mode as shown in FIG. 4, so that the validity flags V0 to V3 are excluded from search objects. In other words, only the values of the address are searched. If a word having a coincidence is detected during such a search, 4 byte data read out from the main memory is written in the corresponding data array word location, and simultaneously therewith the corresponding validity flags for the 4 bytes are set at "1". If on the other hand a word having a coincidence is not detected during such a search, one of the vacant word locations is selected as well known in accordance with a predetermined rule. The data read out from the main memory is written in the data array 330 at the selected word, its address is written in the tag array 300, and the validity flags are set.
Next, the write operation of data to the main memory will be described.
If data has been stored in the main memory, the access mode 470 indicates a write mode and the mask control circuit 480 is supplied with address data 420 and a data length 460. As shown in the bottom line of FIG. 4, the signals M0 to M3 are not activated in the write access mode and the validity flags V0 to V3 are not searched.
Only the addresses in the tag array 300 are searched. In the presence of a word having a coincidence, the same data stored in the main memory is written in the corresponding data array word. In the absence of a word having a coincidence, one of the vacant locations is selected, where the data, address and validity bits are written. These operations are substantially the same as those operations wherein the data read out from the main memory is written when requested data is not present in the data array. Whether the actual writing operation to the main memory is conducted in parallel with the above operation or at other timings varies in accordance with a buffer memory control method. This however is not directly related to the gist of the present invention.
Although the logical sum circuit 430 of FIG. 3 employs an OR circuit using positive logic signals, an AND circuit using negative logic signals may be replaced therewith.
In the foregoing description, although a buffer memory constructed by using a 32 bit address, a lower 2 bit address and 64 stages of 4 byte data has been employed, other bit arrangements, such as using a 64 or 16 bit address, the lower 3 bit address and 8 byte data are also applicable.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4332010 *||Mar 17, 1980||May 25, 1982||International Business Machines Corporation||Cache synonym detection and handling mechanism|
|US4349870 *||Sep 5, 1979||Sep 14, 1982||Motorola, Inc.||Microcomputer with programmable multi-function port|
|US4363095 *||Dec 31, 1980||Dec 7, 1982||Honeywell Information Systems Inc.||Hit/miss logic for a cache memory|
|US4400770 *||Nov 10, 1980||Aug 23, 1983||International Business Machines Corporation||Cache synonym detection and handling means|
|US4410944 *||Mar 24, 1981||Oct 18, 1983||Burroughs Corporation||Apparatus and method for maintaining cache memory integrity in a shared memory environment|
|US4426682 *||May 22, 1981||Jan 17, 1984||Harris Corporation||Fast cache flush mechanism|
|US4442487 *||Dec 31, 1981||Apr 10, 1984||International Business Machines Corporation||Three level memory hierarchy using write and share flags|
|US4493026 *||May 26, 1982||Jan 8, 1985||International Business Machines Corporation||Set associative sector cache|
|US4580240 *||Dec 14, 1982||Apr 1, 1986||Nippon Electric Co., Ltd.||Memory arrangement operable as a cache and a local memory|
|US4713752 *||Dec 5, 1984||Dec 15, 1987||Fujitsu Limited||Buffer storage system|
|US4714990 *||Aug 22, 1983||Dec 22, 1987||International Computers Limited||Data storage apparatus|
|US4733350 *||Dec 17, 1984||Mar 22, 1988||Fujitsu Limited||Improved purge arrangement for an address translation control system|
|US4736287 *||Nov 14, 1986||Apr 5, 1988||Rational||Set association memory system|
|US4751638 *||Dec 5, 1984||Jun 14, 1988||Fujitsu Limited||Buffer storage control system having buffer storage unit comparing operand (OP) side and instruction fetch (IF) side tag storages|
|US4755936 *||Jan 29, 1986||Jul 5, 1988||Digital Equipment Corporation||Apparatus and method for providing a cache memory unit with a write operation utilizing two system clock cycles|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US5136702 *||May 17, 1990||Aug 4, 1992||Hitachi, Ltd.||Buffer storage control method and apparatus|
|US5193166 *||Apr 20, 1992||Mar 9, 1993||Bell-Northern Research Ltd.||Cache-memory architecture comprising a single address tag for each cache memory|
|US5426749 *||Aug 13, 1992||Jun 20, 1995||Fujitsu Limited||Buffer control system using synonymic line address to retrieve second tag portion for fetch and store accesses while first tag portion is invalidated|
|US5664224 *||Dec 18, 1995||Sep 2, 1997||Escom Ag||Apparatus for selectively loading data blocks from CD-ROM disks to buffer segments using DMA operations|
|US5860127 *||May 24, 1996||Jan 12, 1999||Hitachi, Ltd.||Cache memory employing dynamically controlled data array start timing and a microcomputer using the same|
|US6070234 *||Jul 20, 1998||May 30, 2000||Hitachi, Ltd.||Cacche memory employing dynamically controlled data array start timing and a microcomputer using the same|
|US6389523||Apr 25, 2000||May 14, 2002||Hitachi, Ltd.||Cache memory employing dynamically controlled data array start timing and a microprocessor using the same|
|US6601154||Feb 28, 2002||Jul 29, 2003||Hitachi, Ltd.||Cache memory employing dynamically controlled data array start timing and a microcomputer using the same|
|US20070203657 *||Jun 30, 2005||Aug 30, 2007||Dieter Keese||Method And Device For Determining The Density And Speed Of Free-Flowing Media|
|U.S. Classification||710/52, 711/E12.042|
|Sep 30, 1985||AS||Assignment|
Owner name: HITACHI MICROCOMPUTER ENGINEERING LTD., 1479 JOSU
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST.;ASSIGNORS:UCHIYAMA, KINIO;NISHIMUKAI, TADAHIKO;HASEGAWA, ATSUSHI;REEL/FRAME:004464/0085
Effective date: 19850920
Owner name: HITACHI, LTD. 6, KANDA SURUGADAI 4-CHOME, CHIYODA-
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST.;ASSIGNORS:UCHIYAMA, KINIO;NISHIMUKAI, TADAHIKO;HASEGAWA, ATSUSHI;REEL/FRAME:004464/0085
Effective date: 19850920
|Aug 5, 1992||FPAY||Fee payment|
Year of fee payment: 4
|Aug 7, 1996||FPAY||Fee payment|
Year of fee payment: 8
|Aug 1, 2000||FPAY||Fee payment|
Year of fee payment: 12