Directory memory

Abstract: A semiconductor memory device for a data processing system having a main memory, constituted by N memory sets, and a cache memory which stores n sets of the main memory, each set being constituted by a plurality of memory blocks. The semiconductor memory device comprises a memory unit for storing address data of upper address portions each of which designates a memory set of data stored in an address in the cache memory. The address data are stored in an address in the memory device corresponding to the address in the cache memory. Both the addresses designate a memory block in the designated memory set. A validity unit of the device is provided for storing validity bits for indicating a valid/invalid state of address data in each address of the memory unit, and an initialization circuit of the device is arranged to simultaneously invalidate the valid bits. Accordingly, the generation of an erroneous coincidence signal can be prevented, and a data reading operation from the memory device can be performed quickly and satisfactorily.

Description: The present invention relates to a semiconductor memory device for a data processing system. A semiconductor memory device embodying the present invention may be applied to, for example, a computer incorporating a cache memory. Since a main memory of a computer is generally connected to a processor through a bus and is given a large capacity by using a dynamic random access memory (DRAM), a long access time is required. In order to reduce the access time, a cache memory constituted by a high-speed static random access memory (SRAM) is used. Data read from the main memory is temporarily stored in the cache memory and the supply of the same data is carried out from this cache memory, thereby reducing the total memory access time. It is, however, difficult to produce a large-capacity cache memory since it is constituted by an SRAM. In general, the capacity of the cache memory corresponds to a part of the main memory. The main memory is divided into a plurality of sets, and a cache memory is constituted by one, two or four of such sets. For example, one block is constituted by 16 bytes; one set is constituted by 512 blocks; and a main memory is constituted by 524,288 sets. The address portion A0 to A3 allows a selection of one of the 16 bytes of one block; the address portion A4 to A12 allows a selection of one of the 512 blocks of one set; and the address portion A13 to A31 allows a selection of one of the 524,288 sets of the main memory. Data is stored in the cache memory in units of 16 bytes, as one block of the main memory. The address portion required for storing data in the cache memory is the same lower address portion A4 to A12 of the main memory. In this case, one of the 524,288 sets of the main memory to which the selected block belongs cannot be specified. To prevent inconvenience, the upper address portion A13 to A31 is stored in another memory as a tag memory. The tag memory is accessed by the lower address portion to read the corresponding upper address portion. The upper address portion for accessing the main memory is compared by a comparator with the upper address portion read from the tag memory. If a coincidence between these address portions is established, storage of the desired data in the cache memory has been detected. The cache data memory is then accessed by the lower address portion and the corresponding data is output. Assume that the main memory data is stored at the same upper address portion of the cache memory as the lower address portion A4 to A12 of a given block of the main memory, in units of 16 bytes as one block, and that at the same time, the upper address portion A13 to A31 of the given one block is written in the tag memory. Under these assumptions, the cache memory has a capacity corresponding to four sets of the main memory. Therefore, the cache memory can store a maximum of four blocks having the same lower address portion A4 to A12. The cache memory thus has a capacity of a plurality of sets. However, if all data having the address portion A4 to A12 has already been stored in the cache memory and one block having the address portion A4 to A12 is to be read from a given set of the main memory, the content of the cache memory must be purged. For this purpose, an LRU (Least Recently Used) is often used as a replacement algorithm. The upper address portion is stored in the tag memory. When the upper address portion of the address data for accessing the main memory coincides with the upper address portion read from the tag memory, storage of the corresponding data is detected. However, when the power source is switched on, the memory data is in a random state. In this state, the upper address portion for accessing the main memory may accidentally coincide with the data read from the tag memory, so that storage of the corresponding data in the cache memory is erroneously detected. As a result, the random data is undesirably read from the data memory. US-A-4 567 578 discloses a method of setting all memory cells of an array to the same logic value, by activating all word lines of the array without using the word line decoders. The method is disclosed for use in flushing all tag store locations in a tag store of a cache memory on power-up and periodically during normal operation. This method does not distinguish between tag data and validity data in the tag store. US-A-4 489 404 discloses a memory device having a similar function of forcibly setting all memory cells to the same logic state. This feature is disclosed for general use in initialising static memories on power-up, without reference to a cache memory. Bit lines are not connected to the power supply during initializing, therefore the flushing of the whole memory can be conducted with low power consumption US-A-3 845 474 discloses a multiprocessor system in which each processor has a cache store, and a clearing apparatus invalidates the data in a cache store every time its processor accesses a communication table of a common main store of the system. The cache store includes a tag directory storing tag data and and validity data. To clear the cache only the validity bits are reset, the tag data need not to be cleared. According to the present invention, there is provided a semiconductor memory device as claimed in claim 1. An embodiment of the present invention may provide an improved semiconductor memory device for use with a cache memory, in which the initialization of the device by the clearing of all validity bits is carried out at a high speed, whilst preventing an excessive current flow from the power source during the clearing of the validity bits. An embodiment of the invention may enable appropriate data to be read from a cache memory without producing an erroneous coincidence signal. Reference will now be made, by way of example,to the accompanying drawings, in which: Fig. 1 shows a typical arrangement of a cache memory system; Figs. 2, 3, and 4 show examples of a system using a cache memory to which a semiconductor memory system embodying the present invention is applicable; Fig. 5 is a schematic diagram of a semiconductor memory device according to an embodiment of the present invention; Fig. 6 illustrates the signal input and output operations to and from the semiconductor memory device of Fig. 5 with respect to one memory section; Fig. 7 shows the waveforms of signals appearing in the semiconductor memory device of Fig. 5; Fig. 8 shows an example of an arrangement of the device for the semiconductor memory device of Fig. 5; Fig. 9 shows an example of the constitution of the comparator used in the semiconductor memory device of Fig. 5; and, Figs. 10 and 11 are diagrams for explaining the read operation and the write operation in the semiconductor memory device of Fig. 5. Before describing an embodiment of the present invention, a typical arrangement of a cache memory used in a semiconductor memory system embodying the present invention is shown in Fig. 1. Examples of the system using a cache memory to which a semiconductor memory system embodying the present invention is applicable are shown in Figs. 2, 3, and 4. In the arrangement of Fig. 1, the row of the main memory is designated by the tag portion of the address, each of the columns of the main memory corresponds to each of the columns of the cache memory, and the column of the cache memory is designated by the line address portion of the address. Each of the rows of the main memory is constituted by a sequence of blocks. An example of one such block is illustrated in Fig. 1. The byte of this one block is designated by the byte address portion of the address. The row which corresponds to a word of this one block is designated by the word address portion of the address. In this example of Fig. 1, the cache memory is able to store only two sets which correspond to two rows of the main memory. A tag is attached to each data stored in blocks of the cache memory. The tag and the data can be read from each of the rows of the cache memory. The cache memory can be arranged according to various schemes but generally has a capacity corresponding to one, two, or four of a plurality of sets obtained by dividing the memory area of the main memory. Figure 2 shows a direct map type cache memory whose data memory has a one-set capacity and Fig. 3 shows an associative type cache memory having a 2-sets capacity. An example of the capacity will be described below. One block is constituted by 16 bytes; one set is constituted by 512 blocks; and a main memory is constituted by 524,288 sets. The address portion A0 to A3 allows a selection of one byte as one row portion from 16 bytes as one block; the address portion A4 to A12 allows a selection of one of the 512 blocks constituting one set; and the address portion A13 to A31 allows a selection of one of the 524,288 sets constituting the main memory. Data is stored in the cache memory in units of 16 bytes as one block of the main memory. The address portion required for storing data in the cache memory is the same lower address portion A4 to A12 of the main memory. In this case, one of the 524,288 sets of the main memory to which the selected block belongs cannot be specified. To prevent this inconvenience, the upper address portion A13 to A31 is stored in another memory as a tag memory. The tag memory is accessed by the lower address portion to read the corresponding upper address portion. The upper address portion for accessing the main memory is compared by a comparator with the upper address portion read out from the tag memory. If a coincidence between these address portions is established, storage of the desired data in the cache memory has been detected. The cache data memory is then accessed by the lower address portion and the corresponding data is output. The relationship between the main memory and the cache memory is shown in Fig. 4. Assume that the main memory data is stored at the same upper address portion of the data memory as the lower address portion A4 to A12 of a given block of the main memory in units of 16 bytes as one block, and that at the same time, the upper address portion A13 to A31 of the given one block is written in the tag memory. Under these assumptions, the data memory has a capacity corresponding to four sets of the main memory. Therefore, the cache memory can store a maximum of four blocks having the same lower address portion A4 to A12, as shown in Fig. 4. The cache memory thus has a capacity of a plurality of sets. However, if all data having the address portion A4 to A12 has already been stored in the cache memory and one block having the address portion A4 to A12 is to be read from a given set of the main memory, the content of the cache memory must be purged. For this purpose, an LRU (Least Recently Used) is often used as a replacement algorithm. A semiconductor memory device according to an embodiment of the present invention is shown in Fig. 5. The signal input and output operations to and from the semiconductor memory device of Fig. 5 with respect to one memory section are illustrated in Fig. 6. The timing chart of the signals in the device shown in Fig. 5 is illustrated in Fig. 7. A tag memory constituted by a tag data portion 12b and a validity bit portion 12a and related circuits are shown in Fig. 5. In the device of Fig. 5, a validity bit is attached to each data stored in the tag data portion in the tag memory 12. If the validity bit is logic "1", the data is considered valid, but if the validity bit is logic "0", the data is considered invalid. A comparator 14 compares the tag memory read data (READ DATA) and upper address portion (Au) of the address for accessing the main memory. If a coincidence between the READ DATA and the Au is established, a coincidence signal S₁ is delivered from the comparator 14. That is, the potential of the signal S₁ becomes HIGH level. Reference numeral 16 denotes a write buffer. When a write signal WRITE SIGNAL is input, the write buffer 16 defines the upper address portion Au as the write data WRITE DATA and writes this data at the position of the corresponding lower address portion Ad of the tag memory 12. At this time, the validity bit of the lower address portion Ad is set to logic "1". The tag memory 12 is read-accessed by the lower address portion Ad of the address data for accessing the main memory. The read data READ DATA serves as one input to the comparator 14. The upper address portion Au of the address data for accessing the main memory becomes the comparison data which serves as the other input to the comparator 14. When the READ DATA coincides with the comparison data, the comparator 14 delivers the coincidence signal S₁. The output signal S₁ serves as one input of a NAND gate. When the tag memory is addressed by the portion Ad, a validity bit S₂ of a validity bit portion 12a is also read. The read bit S₂ serves as the other input of the NAND gate. When the signal S₁ is set to a HIGH level as the coincidence output, the signal S₁ is also set to a HIGH level; that is, the validity bit is "1" and the data is valid. An output S₃ from the NAND gate is set to a LOW level. The inverted signal of this output S₃ serves as the coincidence signal, i.e., the hit signal, for giving permission to read the data stored in the cache memory. Even if the coincidence output S₁ is delivered from the comparator 14, the coincidence output S₃ , i.e., a hit output, is not generated when the validity bit is logic "0" and, therefore, S₂ is LOW. Therefore, the error caused by random data is prevented. In a writing mode, the upper address portion Au serves as a write data WRITE DATA and is supplied to the write buffer 16. The write signal WRITE SIGNAL is supplied to the buffer 16 and the tag memory 12. The lower address portion Ad is used to access the tag memory 12, the portion Au is written at the address of a tag data portion 12b corresponding to the address portion Ad, and data "1" is written in the validity bit portion 12a of the tag memory 12. The device shown in Fig. 5 comprises a circuit for simultaneously initializing all validity bits of the validity bit portion 12a of the tag memory 12 when the power source for the device is switched ON. Reference symbols BL and BL denote bit lines of the validity bit portion 12a; and BLi and BLi , bit lines of the tag data portion 12b. The number of bit line pairs is equal to the number of bits Au, but only one pair is illustrated in Fig. 5. The bit lines BL and BL are pulled up to a power source V CC through p-channel MOS transistors Q1 and Q4 and n-channel MOS transistors Q2 and Q5, respectively. The bit lines BLi and BLi are pulled up to a source voltage V CC through a p-channel MOS transistor Qi and corresponding n-channel MOS transistors Q6 and Q7, and the bit line BL is pulled down to ground through an n-channel MOS transistor Q3. One of the word lines W0, W1, ... is selected by the lower address portion Ad by the output from a word decoder. NOR GATE Nos. 0, 1, 2 ... j, INVERTER Nos. 0, 1, 2 ... j, a NAND gate, column gates, and memory cells are arranged in the semiconductor memory device. Since the memory device comprises an SRAM, the memory cell is constituted by a flip-flop circuit. The other end of each of the bit lines BL, BL , BLi, and BLi is connected to a data bus through a corresponding column gate. To set the validity bit of each address portion (Ad) to "0" upon energization of the semiconductor memory device, an external purge signal PURG is input to the device. More specifically, the potential of the purge signal PURG is set to a LOW level, as shown in Fig. 7. When the potential of the signal PURG is set to a LOW level, the potential of a signal PG1 is set to a HIGH level and the potential of a signal PG1 is set to a LOW level by an internal signal generator (not shown). In this state, the transistor Q1 is turned OFF, the transistor Q3 is turned ON, and the transistor Qi is turned OFF. Therefore, the potential of the bit line BL is set to a LOW level, the potential of the bit line BL is set to a HIGH level, and the bit lines BLi and BLi are disconnected from the voltage source V CC . The potential of the output of the NAND gate is set to a HIGH level and the potentials of the outputs of the inverters I are set to a LOW level, so that the column gates become OFF. The signal generator described above then generates a signal PG2. That is, the potential of the signal PG2 becomes HIGH level. The potentials of the outputs from the NOR GATE Nos. 0, 1, 2 ... j, are set to a LOW level, and the potentials of the outputs of the INVERTER Nos. 0, 1, 2 ... j are set to a HIGH level, so that all the word lines W0, W1, ... Wj are selected. The transfer gates of all memory cells are enabled to connect the memory cells to the corresponding bit lines, but since the bit lines BLi and BLi of the data portion 12b are kept open, no data is written in the memory cell of this data portion. It is uncertain how the data in memory cells of the data portion undergo a change. Some information may be further written into such memory cells, and under these circumstances, the operation of invalidating the validity bit is carried out under the consideration that the data in the data portion will not be used again, and accordingly, it does not matter how the data in memory cells of the data portion is changed. Since BL is LOW and BL is HIGH in the validity bit portion 12a, that is, the data is "0", all memory cells in the validity bit portion are set to logic "0". After the writing, the potential of the signal PURG is set to a HIGH level, so that PG2 becomes LOW, PG1 becomes LOW, and PG1 becomes HIGH. The simultaneous clearing of the validity bits allows a simultaneous initialization of all validity bits within one to a few cycles. In addition, since all bit lines are disconnected from the voltage source V CC , current is not supplied from the voltage source. It should be noted that an excessive current is supplied from the voltage source to the bit lines when all word lines are selected while the bit lines are still connected to the voltage source. The validity bit may be constituted by a single bit. However, the validity bit component also can be constituted by a plurality of bits and data detected as validity data upon detection of all "1's" of these bits, so that the operation can be further assured. The simultaneous clearing scheme in the device of Fig. 5 can be utilized for clearing a memory for storing new and old data in the way of the LRU portion. An example of the arrangement of the device of the semiconductor memory device of Fig. 5 is shown in Fig. 8. A comparator and a replace control circuit in a tag memory in the device shown in Fig. 5 are mounted on a single chip. In the arrangement shown in Fig. 8, there are provided four cell array sets 12a to 12d of the tag memory, data bus, comparators C0 to C3, and parity check circuits P0 to P3. For example, the upper address portion read from the cell array 12a serves as one input of the comparator C0 through the data bus. The other input to the comparator C0 is the comparison data COMPARISON DATA. A coincidence output from the comparator C0 is delivered through an output circuit 18. The output circuit 18 comprises a gate logic and delivers a signal S denoting which of the comparators C0 to C3 generated the coincidence signal, signals S0 to S3 as coincidence signals delivered from the comparators C0 to C3, and signals a0, a1 as a 2-bit signal code, that is, "00", "01", "10", or "11", denoting which of the comparators C0 to C3 has generated an output. An LRU logic 12e and an LRU memory 12f for determining an object to be replaced are located at the center of the semiconductor chip. When the comparators are incorporated in the tag memory, a logic operation of coincidence outputs, i.e. hit outputs, is performed to determine whether data is present in the cache memory and a way in which a coincidence, i.e. hit, occurs, as S0 to S3 and a0, a1, and determines which way in the data memory will allow a read access, that is, a0, a1 is used as address data for the data memory. Therefore, the packing density of the device can be increased, and thus the wiring length can be reduced. In addition, the number of elements can be reduced, to obtain high-speed access. The diagrams for explaining the read operation and the write operation in the semiconductor memory system of Fig. 5 are shown in Figs. 10 and 11. Figure 10 shows a read state of the cache memory, and Fig. 11 shows a write state thereof. In the system shown in Fig. 5, the coincidence output from each comparator 14 is supplied to the corresponding data memory, which is then enabled. As shown in Fig. 11, the replace control circuits 12e and 12f determine an object to be replaced. For example, if the object is set-0 in the data memory, the data and tag memories of set-0 are write-enabled, and the corresponding data and the portion Au are written at the address portion Ad. Figure 9 shows a detailed arrangement of the comparator 14. The comparator 14 comprises an EOR gate and a NOR gate. When the read data coincides with the comparison data (Au), the potential of the output from the NOR gate is set to a HIGH level, and the potential of the output (OUTPUT) is also set to a HIGH level.

Claims: A semiconductor memory device for a data processing system having a main memory, a cache memory, and a central processor unit, said main memory comprising N memory sets constituted by a plurality of memory blocks, said cache memory being adapted to store data of n memory sets where n is smaller than N, said memory device comprising:- a tag memory (12a, 12b; fig 5) for storing address data and associated validity data, said address data being data of upper address portions (TAG PORTION) each of which designates a memory set of said main memory from which a block is stored in said cache memory, said address data being stored at an address (LINE ADDRESS PORTION) in said tag memory corresponding to said address in said cache memory, both the addresses together designating a memory block (1,2 ... 36) in said main memory, said validity data including one or more validity bits for indicating a valid/invalid state of the associated address data; an initialization circuit comprising a word line selecting circuit (PG2) for selecting all of the word lines of the tag memory 12a, 12b, and a validity bit invalidation circuit (Q₁, Q₂, Q₃, PG1) writing the invalid state into the memory cells of the validity data and characterised by:- said initialization circuit comprising means (Q i , PG1) to prevent a supply of voltage to all bit lines of the address data portion of said tag memory by a voltage source during the time of writing the invalid state into and only into the validity data, leaving the states of said address data unchanged. A device according to claim 1, wherein said address data portion comprises pairs of bit lines, word lines, memory cells, transfer gates for the memory cells, and source voltage supply control transistors. A device according to claim 2, wherein one of said source voltage supply control transistors receives a control signal (PG₁). A device according to claim 1, wherein the validity data portion comprises a pair of bit lines, word lines, memory cells, transfer gates for the memory cells, and source voltage supply control transistors. A device according to claim 4, wherein one of said source voltage supply control circuits receives a control signal (PG₁). A device according to claim 3, wherein each of the word lines in the validity data portion is connected with a series circuit of a NOR gate and an inverter, and the NOR gate receives a control signal (PG₂). A device according to any of claims 1 to 6, wherein a comparator is connected with each section of the tag memory for making an output signal (S₁) HIGH when a comparison between the data read from the tag data portion and the upper address portion of a memory set of said main memory indicates a coincidence therebetween. A device according to any of claims 1 to 7, wherein a write buffer is connected to each section of the tag memory for writing information of an upper address portion into a designated lower address portion of the tag memory in response to a write signal, a writing of data "1" into the validity bit portion for the lower address portion being simultaneously carried out in correspondence with the write signal.

Inventors: ATSUSHI SUZUKI, ATSUSHI, SUZUKI
Applicants: FUJITSU LTD, FUJITSU LIMITED
Application year: 1987
Main classification: G06F12
IPC codes: G06F12, G11C8