WO2005008501A1 - Cache memory device and cache memory control method - Google Patents

Cache memory device and cache memory control method Download PDF

Info

Publication number
WO2005008501A1
WO2005008501A1 PCT/JP2003/009237 JP0309237W WO2005008501A1 WO 2005008501 A1 WO2005008501 A1 WO 2005008501A1 JP 0309237 W JP0309237 W JP 0309237W WO 2005008501 A1 WO2005008501 A1 WO 2005008501A1
Authority
WO
WIPO (PCT)
Prior art keywords
way
prediction
hitway
cache memory
history data
Prior art date
Application number
PCT/JP2003/009237
Other languages
French (fr)
Japanese (ja)
Inventor
Takuma Chiba
Original Assignee
Fujitsu Limited
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Limited filed Critical Fujitsu Limited
Priority to PCT/JP2003/009237 priority Critical patent/WO2005008501A1/en
Publication of WO2005008501A1 publication Critical patent/WO2005008501A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0864Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using pseudo-associative means, e.g. set-associative or hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/608Details relating to cache mapping
    • G06F2212/6082Way prediction in set-associative cache

Definitions

  • the present invention relates to a cache memory device having an n-way set associative type cache memory and a cache memory control method, and more particularly to a cache memory device and a cache memory control method capable of achieving high-speed operation.
  • FIG. 8 is a block diagram showing a configuration of a conventional cache memory device.
  • the cache memory device shown in this figure is a device provided with a cache memory 12 in order to bridge the speed difference between the CPU (Central Processing Unit) 10 and the main memory 13.
  • CPU Central Processing Unit
  • the CPU 10 reads / writes data by accessing the cache memory 12 or the main memory 13.
  • the main memory 13 has a large capacity and the access time is slower than that of the cache memory 12. As shown in FIG. 9, the main memory 13 stores all data used in the CPU 10.
  • each data of the 64 bit configuration is associated with 6 3: 0> (0 bits to 63 bits), and each data of the 64 bit configuration ⁇ 6 3: 0> is stored.
  • the cache memory 12 is, for example, a static random access memory (SRAM), and has a characteristic that the access time is shorter than that of the main memory 13.
  • SRAM static random access memory
  • the storage capacity of the main memory 13 is Memory 12 is larger than the storage capacity.
  • data transfer between the CPU and the cache memory is generally performed in line units, and there are several methods for associating data in the main memory with lines in the cache memory.
  • the main memory and the cache memory are divided into a plurality of sets (a set of lines: this is called a way), and certain data in the main memory is stored only in a predetermined line in each way.
  • a set associative method that cannot be placed.
  • the cache memory When the cache memory is treated as one way in the set associative method, it is called 'direct mapping method (or 1-way set associative method)' and when there are n ways Is called the n-way set-associative method.
  • Fig. 10 shows the cache memory 12 (tag RAM 12a and data RAM 1
  • FIG. 3 is a diagram illustrating a 4-way set associative method in 2b).
  • the tag RAMI 2a and the data RAMI 2b have four ways (WAY 0).
  • the index ⁇ 13: 4> is for uniquely specifying the line (horizontal direction) of the tag RAMI 2a and the data RAMI 2b, and the main memory 13 (see FIG. 9). It consists of 10 bits (4th to 13th bits) in address 63: 0>.
  • each entry specified by the index and the way includes the address stored in the main memory 13 at 63: 0>.
  • each entry is stored as a tag.
  • a valid bit V indicating whether the tag is valid or not is stored. If the valid bit V is 1, the tag is valid. On the other hand, if the valid bit V is 0, the tag is invalid.
  • the data RAMI 2 b each entry specified by the index and the way stores data 63: 0> stored in the main memory 13.
  • the cache access control unit 11 controls access to the cache memory 12.
  • FIG. 11 is a diagram showing the configuration of the cache access control unit 11 and the cache memory 12 shown in FIG.
  • a latch circuit 20 is a circuit for latching an address byte offset part 3: 0> included in an address 63: 0> from the CPU 10 (see FIG. 8).
  • the latch circuit 21 is a circuit that latches the address tag portion 63:14> included in the address portion 63: 0>.
  • the address index part 13: 4> included in the address 63: 0> is input as a search key.
  • an index that matches the address index part 13: 4> is searched among a plurality of indexes, and the line corresponding to the index is uniquely identified. Is specified.
  • the tag RAMI 2a outputs the tags 63:14> and the effective bits V stored in the respective entries of WAY0 to WAY3 corresponding to the above line.
  • the latch circuits 22 to 25 are circuits for latching the respective tags 63:14>, and correspond to WAY0 to WAY3 of the tag RAMI 2a (see FIG. 10).
  • the latch circuits 26 to 29 are circuits for latching the above-mentioned effective bits, and correspond to WAY 0 to 3 (see FIG. 10) of the tag RAM 12a.
  • the data RAMI 2b outputs the data 63: 0> stored in the respective entries of WAY 0 to 3 corresponding to the above line.
  • the latch circuits 30 to 33 store the above data ⁇ 63: 0>. This circuit corresponds to WAY 0-3 of data RAMI 2b (see Fig. 10).
  • the comparators 40 to 43 and AND circuits 50 to 53 correspond to WAYs 0 to 3, respectively.
  • the comparator 40 compares the address tag section 63:14> latched by the latch circuit 21 with the tag section 63:14> (corresponding to WAY 0) latched by the latch circuit 22.
  • the AND circuit 50 is a circuit for ANDing the output of the comparator 40 and the valid bit V latched by the latch circuit 26. When the AND condition is satisfied, the AND circuit 50 outputs WAY 0 — H IT to the OR circuit 60 and outputs WAY 0 — H IT to the selector 70 as a selection signal SEL 70 (corresponding to WAY 0).
  • the comparator 41 compares the address tag portion 63:14> latched by the latch circuit 21 with the tag tag 63:14> (corresponding to WAY 1) latched by the latch circuit 23, and when they match, WAY 1—HI T (See Fig. 12: Way 1 hits).
  • the AND circuit 51 is a circuit that ANDs the output of the comparator 41 and the valid bit V latched by the latch circuit 27. When the AND condition is satisfied, the AND circuit 51 outputs WAY 1 — HIT to the OR circuit 60 and outputs WAY 1 — HIT to the selector 70 as the selection signal SEL 70 (corresponding to WAY 1). .
  • the comparator 42 compares the address tag portion 63:14> latched by the latch circuit 21 with the tag ⁇ 63:14> (corresponding to WAY 2) latched by the latch circuit 24, and when they match, WAY2_HIT (see Fig. 12: Pay 2 hit) is output.
  • the AND circuit 52 is a circuit that ANDs the output of the comparator 42 and the valid bit V latched by the latch circuit 28.
  • the AND circuit 52 has the AND condition When the condition is satisfied, WAY 2 — HIT is output to the OR circuit 60, and WAY 2 — HIT is output to the selector 70 as the selection signal SEL 70 (corresponding to WAY 2).
  • the comparator 43 compares the address tag section 63:14> latched by the latch circuit 21 with the tag section 63:14> (corresponding to WAY 3) latched by the latch circuit 25, and when they match, Outputs WAY 3_H IT (see Fig. 12: way 3 hits).
  • the AND circuit 53 is a circuit that ANDs the output of the comparator 43 and the valid bit V latched by the latch circuit 29. When the AND condition is satisfied, the AND circuit 53 outputs WAY 3—HI ⁇ to the OR circuit 60, and outputs WAY 3—HIT as the selection signal SEL 70 (corresponding to WAY 3) to the selector 70. I do.
  • the OR circuit 60 ORs the outputs of the AND circuits 50 to 53 (WAYO—HIT to WAY3—HIT). After latching the output of the OR circuit 60, the latch circuit 34 outputs CACHE-HIT (cache hit).
  • the selector 70 outputs the data ⁇ 63: 0> latched in the latch circuit corresponding to the selection signal SEL70 (one of WAY0 to 3) among the data 63: 0> latched by the latch circuits 30 to 33. Select > and output this. After latching the data ⁇ 63: 0> selected by the selector 70, the latch circuit 35 outputs the result as a cache hit result.
  • the CPU 10 transfers the necessary data from the cache memory 12 (the main memory 13 in the case of a cache miss).
  • : 0> is output to the cache access control unit 11 to read out the address 63: 0> corresponding to the data 63: 0>.
  • the processing of the tag RAMI 2a and the processing of the data RAMI 2b are executed in parallel. That is, in the tag: RAMI 2a, the address index part 13: 4> included in the address ⁇ 63: 0> is used as a search key, As shown in FIG. 10, an index matching the indexless index part 13: 4> is searched from a plurality of indexes, and a line corresponding to the index is specified at will.
  • the tag RAM 63 a from the tag RAMI 2 a stored in the respective entries of WAY 0 to WAY 3 corresponding to the above-mentioned line is latch circuit 22. Latched to ⁇ 25.
  • the address index portion included in the address 63: 0> is used as a search key, and as shown in FIG. : 4 An index matching> is searched, and the line corresponding to the index is uniquely specified.
  • the address byte offset portion 3: 0> is latched in the latch circuit 20
  • the address tag portion 63:14> is latched in the latch circuit 21.
  • comparison processing and hitway selection processing are performed. That is, in the comparison process, in the comparators 40 to 43, the address tags 63:14> latched by the latch circuit 21 and the tags respectively latched by the latch circuits 22 to 25:63:14> (Corresponding to WAY 0 to 3). In this case, assuming that the address tag 63:14> matches the tag 63:14> corresponding to WAY 0, the comparator 40 outputs WAYO-HIT to the AND circuit 50. The comparison results of the other comparators 41 to 43 are all inconsistent.
  • the AND circuit 50 performs an AND operation on the output of the comparator 40 (WAY 0—HI T) and the output of the latch circuit 26 (valid bit V: supposed to be valid), and sends WAY 0 — HIT to the OR circuit 60 Output.
  • WAYO-HIT from the AND circuit 50 is input to the selector 70 as a selection signal SEL70 (corresponding to WAYO).
  • the selector 70 selects and outputs the data 63: 0> latched by the latch circuit 30 (corresponding to WAYO).
  • Patent Document 1 JP 2001-075864 A
  • a hitway is selected after an address 63: 0> is output from the CPU 10, and a data address 63: 0> is output from the cache memory 12. It takes four cycles (time t0 to time t3 in Fig. 13) to output, and there was a problem that it was not possible to sufficiently meet the needs for high speed.
  • the present invention has been made in view of the above, and has as its object to provide a cache memory device and a cache memory control method that can achieve high speed. Disclosure of the invention
  • the present invention relates to a cache memory adopting a set associative method having a plurality of ways, and a way address selected from a plurality of ways in a memory access in the past.
  • Hitway history data storage means for storing hitway history data; a search means for searching a way from the hitway history data using an address at the time of memory access as a key; Data corresponding to the And reading means for reading out the memory.
  • the present invention is a cache memory control method for controlling access to a cache memory employing a set associative method having a plurality of ways, wherein the cache memory is selected from a plurality of ways by memory access in the past.
  • a search is made from the hitway history data using the hitway history data storage amount for storing the hitway history data corresponding to the accessed way and address, and the address at the time of memory access as a key, and the way is searched for.
  • the method includes: a prediction step of setting a prediction way; and a reading step of reading data corresponding to the prediction layer from the cache memory.
  • hitway history data corresponding to a way address selected from a plurality of ways in a memory access in the past is stored, and the way is set using the address at the time of memory access as a key.
  • the data corresponding to the prediction way is read from the cache memory, so that the way to determine the data reading is determined earlier than in the past, High speed riding can be achieved.
  • FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention.
  • FIG. 2 is a diagram showing the configuration of the cache access control unit 80 and the cache memory 12 shown in FIG.
  • FIG. 3 is a diagram showing the configuration of the hitway history data storage unit 90 shown in FIG. 2, and
  • FIG. 4 is a diagram for explaining the operation of the first embodiment.
  • FIG. 6 is a block diagram showing a configuration of a second embodiment according to the present invention.
  • FIG. 6 is a diagram showing a configuration of the cache access control unit 140 and the cache memory 12 shown in FIG.
  • FIG. 7 is a diagram showing the configuration of the hitway history data storage section 150 shown in FIG. 6, and
  • FIG. 8 is a block diagram showing the configuration of a conventional cache memory device.
  • FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention.
  • FIG. 2 is a diagram showing the configuration of the cache access control unit 80 and the cache memory 12 shown in FIG.
  • FIG. 3 is
  • FIG. 9 is a diagram showing the main memory 13 shown in FIG. 8, and FIG. Tag shown in FIG. 8 R AM I 2 a, and data R
  • FIG. 11 is a diagram showing AM I 2b
  • FIG. 11 is a diagram showing the configuration of the cache access control unit 11 and the cache memory 12 shown in FIG. 8, and
  • FIG. 13 is a diagram for explaining the operation of the cache memory device.
  • FIG. 13 is a diagram for explaining the operation of the conventional cache memory device.
  • FIG. 1 is a block diagram showing a configuration of a first embodiment according to the present invention.
  • parts corresponding to the respective parts in FIG. 8 are denoted by the same reference numerals, and description thereof will be omitted.
  • a cache access control unit 80 is provided instead of the cache access control unit 11 in FIG.
  • the cache access control unit 80 has a function of predicting a way in addition to the function of the cache access control unit 11.
  • FIG. 2 is a diagram showing a configuration of the cache access control unit 80 and the cache memory 12 shown in FIG. In this figure, parts corresponding to those in FIG. 11 are denoted by the same reference numerals, and description thereof will be omitted.
  • a hitway history data storage unit 90 a selector 100, a latch circuit 110 to 112, and a comparator 120 are newly provided.
  • the hitway history data storage section 90 stores history data of the latest four hitways, that is, the hitway selected by the hit selection processing (selection signal SEL70 (WAY0 to 3—HIT)). Is stored.
  • FIG. 3 is a diagram showing a configuration of the hitway history data storage unit 90 shown in FIG.
  • the FIFO (Fast In Fast Out) register 91 stores the latest four hitways (WAY 0 HIT to WAY 3 HIT) and hits. Key when selecting way Stores history data consisting of the dress index part 13: 4>.
  • the way register section 91WO and the address register section 91AO store the latest hitway and address index section 13: 4> of the past four times.
  • the way register section 91W1 and the address register section 91A1 store the second newest hitway and address index section 13: 4> of the past four times.
  • the way register section 91W2 and address register section 91A2 store the third newest hitway address index section 13: 4> of the past four times.
  • the way register section 91W3 and the address register section 91A3 store the oldest hitway and address index section ⁇ 13: 4> of the past four times.
  • each piece of history data is shifted rightward in the figure, and the oldest history data is expelled.
  • the comparators 93 to 96 are provided corresponding to the address register sections 91 A0 to 91 A3, and have an address index section 13: 4> and an address index section stored in the address register sections 91 A0 to 91 A3. 13: 4> and compare.
  • the comparators 93 to 96 output a selection signal SEL 97 for selecting the address register section (corresponding way register section) to the selector 97 when they match.
  • the selector 97 selects the hit way stored in the way register corresponding to the selection signal SEL 97 from among the hit ways stored in the pay registers 91W0 to 91W3, and predicts the hit way (P_WAY0_HIT to P—WAY). 3—HIT) and output to latch circuit 110 (see Fig. 2).
  • the latch circuit 110 latches the predicted hitway.
  • the selector 97 selects the prediction hitway (P WAYO HIT to P WA Y3—HIT) is output to the selector 100 as the selection signal SEL 100 shown in FIG.
  • Selector 100 outputs the data corresponding to WAY 0 to 3 output from data RAMI 2b 63: 0> to the data of the way corresponding to selection signal SEL 100 (predicted hit way). Select> and output to the latch circuit 111.
  • the latch circuit 111 latches the data of the way 63: 0> as the prediction data 63: 0> based on the prediction hitway.
  • the comparator 120 compares the prediction hitway latched by the latch circuit 110 with the selection signal SEL70 (WAYO to 3—HI T), and turns on P_WA Y—HI T (prediction way hit) if they match. And outputs it to the latch circuit 112.
  • the latch circuit 112 latches P—WAY_HIT (predicted way hit).
  • the fact that this P—WAY-HIT (prediction way hit) is on means that the prediction hitway predicted by the hitway history data storage unit 90 and the actual hitway match, and the prediction was successful. Means that.
  • the latch circuit 112 that latches P—WAY—HIT (predicted way hit) outputs P—DATA—V (predicted data valid bit) to the CPU 10 (see FIG. 1).
  • P—DATA—V predicted data valid bit
  • the CPU 10 (see FIG. 1) reads out the necessary data (63: 0) from the cache memory 12 (in the case of a cache miss, the main memory 13). Then, the address ⁇ 63: 0> corresponding to the data ⁇ 63: 0> is output to the cache access control unit 140.
  • the processing of the tag RAMI 2a and the processing of the data RAMI 2b are executed in parallel. That is, in the tag RAMI 2a, the address index portion 13: 4> included in the address 63: 0> is used as a search key, and as shown in FIG. An index that matches 3: 4 > is searched, and the line corresponding to the index is uniquely specified.
  • the tag RAMI2a outputs the tag data 63:14> stored in each of the WAY0 to WAY3 entries corresponding to the above line to the latch circuit. Latched at 22-25.
  • the valid bits V stored in the respective entries of WAY0 to WAY3 corresponding to the above line are latched by the latch circuits 26 to 29.
  • the address index part 13: 4> included in the address index 63: 0> is used as a search key, and as shown in FIG. : 4 An index matching ⁇ > is searched, and a line corresponding to the index is uniquely specified.
  • the data RAMI 2 b outputs the data stored in each of the WAY 0 to WAY 3 entries corresponding to the above line.
  • the address tag section 63:14> is latched in the latch circuit 21. Further, at time t1, way prediction processing is executed in parallel with the processing of the tag RAMI 2a and the data RAMI 2b described above. Specifically, the address index part 13: 4> included in the address ⁇ 63: 0> from the CPU 11 is input to the comparators 93 to 96 of the hitway history data storage unit 90 shown in FIG. You. As a result, the comparators 93 to 96 compare the input address index portion 13: 4> with the address index portion 13: 4> stored in the address register portions 91 A0 to 91 A3.
  • the comparator 93 sets the address register portion.
  • a select signal SEL 97 for selecting the way register section 91W0 corresponding to 91 AO is output to the selector 97.
  • the selector 97 selects a hit way (WAY 0—HI T) stored in the way register section 91WO corresponding to the selection signal SEL 97 among the hit ways stored in the way register sections 91W0 to 91W3, and predicts the hit. It outputs to the latch circuit 110 shown in FIG. 2 as a way (P-WAYO-HI T).
  • the latch circuit 110 latches the predicted hit time (P—WAY 0—HI T) at time t 2 (see FIG. 4).
  • the selector 97 outputs the predicted hitway (P—WAY 0—HIT) to the selector 100 as a selection signal SEL100.
  • the selector 100 outputs the data corresponding to WAY0 to 3 output from the data RAMI 2b (63: 0), and selects the WAY0 corresponding to the selection signal SEL100 (predicted hitway (P-WAYO-HIT)). Select data 63: 0> and output it to the latch circuit 111.
  • the latch circuit 111 latches the data of the WAY 0, 63: 0>, as prediction data ⁇ 63: 0> based on the prediction way, and then latches this prediction. Outputs data ⁇ 63: 0> to CPU10.
  • the CPU 10 has one cycle more than before (in the case of FIG. 13, Execute processing at time t3. In contrast, in the case of Fig. 4, processing is performed at time t2. ) Perform processing based on the predicted data 63: 0> quickly.
  • comparison processing From time t2 to time t3, comparison processing, hitway selection processing, and prediction verification processing are performed. That is, in the comparison processing, in the comparators 40 to 43, the address tag section 63:14> latched by the latch circuit 21 and the tag ⁇ 63:14> (WAY 0) latched by the latch circuits 22 to 25 respectively. (Corresponds to ⁇ 3).
  • WAYO-HIT from the AND circuit 50 is input to the selector 70 as a selection signal SEL70 (corresponding to WAY 0).
  • the selector 70 selects and outputs the data 63: 0> latched by the latch circuit 30 (corresponding to WAYO).
  • the comparator 120 compares the prediction hitway latched by the latch circuit 110 with the selection signal SEL 70 (WAY 0 to 3—HI T), and when they match, P_WAY_HIT Latch circuit (prediction way hit) 1
  • the CPU 10 validates the predicted data ⁇ 63: 0> output from the latch circuit 111, and invalidates the data 63: 0> output from the latch circuit 35.
  • P-WAY-HI T predicted way hit
  • P-DATA-V predicted data valid bit
  • the CPU 10 invalidates the prediction data 63: 0> output from the latch circuit 111, while validating the data 63: 0> output from the latch circuit 35.
  • the CPU 10 executes the process using the data 63: 0> as in the conventional case.
  • hitway history data corresponding to a way address selected from a plurality of ways in the past memory access is stored in the hitway history data storage unit 90. Then, using the address index part 13: 4> at the time of memory access as a key, a way is searched, and after predicting the way as a predicted way, data corresponding to the predicted way is read from the data RAMI 2b.
  • the determination of the wire involved in the data reading is quicker, and the speed can be increased.
  • FIG. 5 is a block diagram showing a configuration of a second exemplary embodiment according to the present invention.
  • parts corresponding to the respective parts in FIG. 1 are denoted by the same reference numerals, and description thereof will be omitted.
  • the cache access control unit 80 shown in FIG. In addition, a cache access control unit 140 is provided.
  • the cache access control unit 140 has a function of predicting a way in the same way as the cache access control unit 80 (see FIG. 1), in addition to the function of the cache access control unit 11 (see FIG. 8). Have.
  • FIG. 6 is a block diagram showing a configuration of the cache access control unit 140 and the cache memory 12 shown in FIG.
  • a hitway history data storage unit 150 is provided in place of the hitway history data storage unit 90 shown in FIG.
  • the hitway history data storage section 150 includes 4-way RAMs 60 to 163 in the same manner as the tag RAM 12a and the data RAMI 2b (see FIG. 6). .
  • the data corresponding to the access address (63: 0) from the CPU 10 is returned to the CPU 10 and the data from the CPU 10 is returned.
  • the access address 17: 4> and the information of the WAY hit by the access are sent to the hit way history data storage unit 150.
  • the access address 17:14> of the received access address ⁇ 17: 4> is stored in the hitway history write data 17:14> and the access address 13: Data is written to RAMIs 60 to 163, with 4> being the hitway history write index 13: 4> and the hit WAY information being the hitway history storage section write way 3: 0>.
  • the hitway history data storage unit 150 When the hitway history data storage unit 150 receives the hitway history write data # 17: 14>, the hitway history write index # 13: 4>, and the hitway history storage unit write way # 3: 0>, the RAMI 60 ⁇ 163 of Of these, four bits of hitway history write data ⁇ 17:14> are located at the position corresponding to the hitway history write index 13: 4> in the RAM indicated by the hit history history storage unit write 3: 0>.
  • the hitway history data storage unit 150 when there is an access request from the CPU 10 to the cache access control unit 140 (cache memory 12), the hitway history data storage unit 150 stores the access address from the CPU 10 in the access address 63: 0>. Address 1 7: 4> is input.
  • the access address ⁇ 17:14> of the input access address ⁇ 17: 4> is used as way history comparison data 17:14>.
  • the access address ⁇ 13: 4> of the access address ⁇ 17: 4> is used as the default address 13: 4>.
  • the hitway history read data 3: 0> which is 4-bit data corresponding to the index, is output.
  • address index 13: 4> is also input to RAMI 61 ⁇ : AMI 63, and hitway history read data 3: 0> is output from each.
  • the comparators 170 to 173 are provided corresponding to the RAMIs 60 to 163.
  • the comparators 170 to 173 read the hitway history read data 3: 0> from the RAMIs 60 to 163 and the addresses 63: 0> from the CPU 10.
  • the obtained hitway history comparison data ⁇ 17:14> is compared, and if they match, the predicted hittuy corresponding to the way (one or more of P—WAYO—HIT to P—WAY3—HIT) Is output to the selector 180.
  • the selector 180 selects one of the predicted hitways (P—WAYO—HIT to P—WAY3—HIT in FIG. 6). Output to latch circuit 110.
  • the selector 180 selects the predicted hitway (P WAYO HI T ⁇ P _WAY 3 _HIT) is output to the selector 100 as the selection signal SEL 100 0 shown in FIG.
  • the selector 180 sets a plurality of predicted hitways (P—WAY 0—HIT to P—WAY). 3—HIT), the predicted hit way corresponding to the youngest way (or the predicted hit way corresponding to one randomly selected way or the predicted hit way corresponding to the newest one way) is output.
  • the method of selecting a predicted hitway in the case of a multi-hit is also applicable to the first embodiment (selection signal SEL97 in FIG. 3).
  • the value of the access address 17:14> used as the write data of the hitway history is changed according to the environment and the application to be used and the program to be executed. It may be configured to change to a value other than 4>. In this case, the accuracy of way prediction can be improved.
  • the history data selection signal (not shown) causes the history write data 17: 14> or history write data ⁇ 21: 18> is selected, and the 4-bit data obtained by that is used as way history comparison data.
  • access address ⁇ 21:18> or access address 17:14> is selected by the history data selection signal.
  • the selected access address is used as hitway history write data.
  • the selected hitway history write data is hitway history write data.
  • hitway history data corresponding to a way and an address selected from a plurality of ways in a past memory access is stored, and the address at the time of the memory access is used as a key. Since the way is searched, the way is predicted as the predicted way, and the data corresponding to the predicted way is read from the cache memory, the way to read the data is determined earlier than in the past. This has the effect of increasing the speed.
  • the cache memory device and cache memory control method according to the present invention is useful for cache memory access control.

Abstract

A cache memory device includes a cache memory (12) based on the set associative method having a plurality of ways and a hit way history data storage section (90) for storing hit way history data corresponding to the way and address selected from a plurality of ways by a memory access in the past. In the hit way history data storage section (90), a way is searched by using as a key the address index section <13:4> during memory access and the way is output as a prediction way.

Description

キャッシュメモリ装置およびキャッシュメモリ制御方法 Cache memory device and cache memory control method
技術分野 Technical field
本発明は、 nウェイセットァソシァティプ方式のキャッシュメモリを有するキ ャッシュメモリ装置およびキヤッシュメモリ制御方法に関するものであり、 特に、 高速化を図ることができるキャッシュメモリ装置およびキャッシュメモリ制御方 明  The present invention relates to a cache memory device having an n-way set associative type cache memory and a cache memory control method, and more particularly to a cache memory device and a cache memory control method capable of achieving high-speed operation.
法に関するものである。 1 It is about the law. 1
 Thread
田 背景技術  Field background technology
第 8図は、 従来のキャッシュメモリ装置の構成を示すブロック図である。 この 図に示したキャッシュメモリ装置は、 C P U (Central Processing Unit) 1 0 とメインメモリ 1 3との間の速度差を埋めるために、 キャッシュメモリ 1 2を備 えた装置である。  FIG. 8 is a block diagram showing a configuration of a conventional cache memory device. The cache memory device shown in this figure is a device provided with a cache memory 12 in order to bridge the speed difference between the CPU (Central Processing Unit) 10 and the main memory 13.
C P U 1 0は、 キャッシュメモリ 1 2またはメインメモリ 1 3にアクセスする ことで、 データのリード/ライトを行う。  The CPU 10 reads / writes data by accessing the cache memory 12 or the main memory 13.
メインメモリ 1 3は、 大容量であってかつアクセス時間がキャッシュメモリ 1 2に比して遅いという特性を備えている。 このメインメモリ 1 3には、 第 9図に 示したように、 C P U 1 0で用いられるデータの全てが記憶されている。  The main memory 13 has a large capacity and the access time is slower than that of the cache memory 12. As shown in FIG. 9, the main memory 13 stores all data used in the CPU 10.
すなわち、 同図において、 メインメモリ 1 3には、 6 4ビット構成の各ァドレ スく 6 3 : 0〉 (0ビット〜 6 3ビット) に対応付けて、 6 4ビット構成の各デ 一タ< 6 3 : 0 >が記憶されている。  That is, in the figure, in the main memory 13, each data of the 64 bit configuration is associated with 6 3: 0> (0 bits to 63 bits), and each data of the 64 bit configuration < 6 3: 0> is stored.
第 8図に戻り、 キャッシュメモリ 1 2は、 例えば、 S R AM (Static Random Access Memory) であり、 アクセス時間がメインメモリ 1 3に比して短いという 特性を備えている。  Returning to FIG. 8, the cache memory 12 is, for example, a static random access memory (SRAM), and has a characteristic that the access time is shorter than that of the main memory 13.
さらに、 記憶容量の面から見れば、 メインメモリ 1 3の記憶容量は、 キヤッシ ュメモリ 12の記憶容量よりも大きい。 Furthermore, from the viewpoint of storage capacity, the storage capacity of the main memory 13 is Memory 12 is larger than the storage capacity.
ここで、 一般に CPUと、 キャッシュメモリ (メインメモリ) との間のデータ 転送はラィン単位で行われ、 メインメモリ上のデータをキャッシュメモリ内のラ インに対応づける方式は、 いくつかある。  Here, data transfer between the CPU and the cache memory (main memory) is generally performed in line units, and there are several methods for associating data in the main memory with lines in the cache memory.
代表的な方式としては、 メインメモリとキャッシュメモリとを複数のセット ( ラインの集合:これをウェイという) に分割し、 メインメモリ上のあるデータは、 各ウェイの中の決められたラインにしか置けないというセットァソシァティブ方 式がある。  As a typical method, the main memory and the cache memory are divided into a plurality of sets (a set of lines: this is called a way), and certain data in the main memory is stored only in a predetermined line in each way. There is a set associative method that cannot be placed.
セットァソシァティブ方式にぉレ、て、 キャッシュメモリを 1つのウェイとして 扱う場合には、'ダイレクト ·マッピング方式 (または、 1ウェイセットァソシァ ティブ方式) と呼ばれ、 ウェイが nある場合には、 nウェイセットァソシァティ ブ方式と呼ばれている。  When the cache memory is treated as one way in the set associative method, it is called 'direct mapping method (or 1-way set associative method)' and when there are n ways Is called the n-way set-associative method.
第 10図は、 キャッシュメモリ 12 (タグ R AM 12 aおよびデータ R AM 1 Fig. 10 shows the cache memory 12 (tag RAM 12a and data RAM 1
2 b) における 4ウェイセットァソシァティブ方式を説明する図である。 同図に おいては、 タグ RAMI 2 aおよびデータ RAMI 2 bは、 4ウェイ (WAY 0FIG. 3 is a diagram illustrating a 4-way set associative method in 2b). In the figure, the tag RAMI 2a and the data RAMI 2b have four ways (WAY 0
〜WAY3) に分割されて管理されている。 タグ RAMI 2 aのウェイと、 デー タ RAMI 2 bのウェイとは、 一対一で対応している。 ~ WAY3). The way of the tag RAMI 2a and the way of the data RAMI 2b correspond one-to-one.
また、 同図において、 インデックス < 13 : 4 >は、 タグ RAMI 2 aおよび データ RAMI 2 bのライン (横方向) を一意に特定するためのものであり、 メ インメモリ 13 (第 9図参照) のアドレスく 63 : 0>における 10ビット分 ( 4〜13ビット目) から構成されている。  In the same figure, the index <13: 4> is for uniquely specifying the line (horizontal direction) of the tag RAMI 2a and the data RAMI 2b, and the main memory 13 (see FIG. 9). It consists of 10 bits (4th to 13th bits) in address 63: 0>.
タグ RAMI 2 aにおいて、 インデックスとウェイにより特定される各ェント リには、 メインメモリ 13に記憶されているアドレスく 63 : 0>におけるく 6 In the tag RAMI 2a, each entry specified by the index and the way includes the address stored in the main memory 13 at 63: 0>.
3 : 14>がタグとして記憶されている。 また、 各エントリには、 当該タグが有 効であるか否かを表す有効ビット Vが記憶されている。 この有効ビット Vが 1で ある場合、 当該タグが有効とされる。 一方、 有効ビット Vが 0である場合、 当該 タグが無効とされる。 一方、 データ RAMI 2 bにおいて、 インデックスとウェイにより特定される 各エントリには、 メインメモリ 13に記憶されているデータく 63 : 0>が記憶 されている。 3: 14> is stored as a tag. In each entry, a valid bit V indicating whether the tag is valid or not is stored. If the valid bit V is 1, the tag is valid. On the other hand, if the valid bit V is 0, the tag is invalid. On the other hand, in the data RAMI 2 b, each entry specified by the index and the way stores data 63: 0> stored in the main memory 13.
第 8図に戻り、 キャッシュアクセス制御部 1 1は、 キャッシュメモリ 12への アクセスを制御する。  Returning to FIG. 8, the cache access control unit 11 controls access to the cache memory 12.
第 1 1図は、 第 8図に示したキャッシュアクセス制御部 11およびキャッシュ メモリ 12の構成を示す図である。 同図において、 ラッチ回路 20は、 CPU1 0 (第 8図参照) からのアドレスく 63 : 0 >に含まれるアドレスバイトオフセ ット部く 3 : 0>をラッチする回路である。  FIG. 11 is a diagram showing the configuration of the cache access control unit 11 and the cache memory 12 shown in FIG. In the figure, a latch circuit 20 is a circuit for latching an address byte offset part 3: 0> included in an address 63: 0> from the CPU 10 (see FIG. 8).
ラッチ回路 21は、 アドレスく 63 : 0 >に含まれるアドレスタグ部く 63 : 14〉をラッチする回路である。 タグ RAMI 2 aおよびデータ RAMI 2 bに は、 アドレスく 63 : 0〉に含まれるアドレスインデックス部く 13 : 4>が検 索キーとして入力される。  The latch circuit 21 is a circuit that latches the address tag portion 63:14> included in the address portion 63: 0>. In the tag RAMI 2a and the data RAMI 2b, the address index part 13: 4> included in the address 63: 0> is input as a search key.
タグ RAMI 2 aおよびデータ RAMI 2 bにおいては、 第 12図に示したよ うに、 複数のインデックスのうち、 アドレスインデックス部く 13 : 4 >と一致 するインデックスが検索され、 該ィンデックスに対応するラインが一意に特定さ れる。  As shown in FIG. 12, in the tag RAMI 2a and the data RAMI 2b, an index that matches the address index part 13: 4> is searched among a plurality of indexes, and the line corresponding to the index is uniquely identified. Is specified.
タグ RAMI 2 aからは、 第 10図に示したように、 上記ラインに対応する W AY0〜 3の各エントリに記憶されている各タグく 63 : 14〉および各有効ビ ット Vが出力される。 第 11図に戻り、 ラッチ回路 22〜 25は、 上記各タグく 63 : 14 >をラッチする回路であり、 タグ RAMI 2 aの WAY0〜3 (第 1 0図参照) に対応している。 ラッチ回路 26 ~ 29は、 上記各有効ビットをラッ チする回路であり、 タグ RAM 12 aの WAY 0〜 3 (第 10図参照) に対応し ている。  As shown in FIG. 10, the tag RAMI 2a outputs the tags 63:14> and the effective bits V stored in the respective entries of WAY0 to WAY3 corresponding to the above line. You. Returning to FIG. 11, the latch circuits 22 to 25 are circuits for latching the respective tags 63:14>, and correspond to WAY0 to WAY3 of the tag RAMI 2a (see FIG. 10). The latch circuits 26 to 29 are circuits for latching the above-mentioned effective bits, and correspond to WAY 0 to 3 (see FIG. 10) of the tag RAM 12a.
一方、 データ RAMI 2 bからは、 第 10図に示したように、 上記ラインに対 応する WAY 0〜 3の各エントリに記憶されている各データく 63 : 0>が出力 される。 第 1 1図に戻り、 ラッチ回路 30〜33は、 上記各データ < 63 : 0 > をラッチする回路であり、 データ RAMI 2 bの WAY 0〜 3 (第 10図参照) に対応している。 On the other hand, as shown in FIG. 10, the data RAMI 2b outputs the data 63: 0> stored in the respective entries of WAY 0 to 3 corresponding to the above line. Referring back to FIG. 11, the latch circuits 30 to 33 store the above data <63: 0>. This circuit corresponds to WAY 0-3 of data RAMI 2b (see Fig. 10).
比較器 40〜43、 アンド回路 50〜53は、 WAY 0〜 3に対応している。 比較器 40は、 ラッチ回路 21にラッチされたアドレスタグ部く 63 : 14>と、 ラッチ回路 22にラッチされたタグく 63 : 14> (WAY 0に対応) とを比較 し、 一致した場合、 WAY 0— HI T (第 12図参照: ウェイ 0がヒット) を出 力する。  The comparators 40 to 43 and AND circuits 50 to 53 correspond to WAYs 0 to 3, respectively. The comparator 40 compares the address tag section 63:14> latched by the latch circuit 21 with the tag section 63:14> (corresponding to WAY 0) latched by the latch circuit 22. WAY 0—HI T (See Figure 12: Way 0 hits).
アンド回路 50は、 比較器 40の出力と、 ラッチ回路 26にラッチされた有効 ビット Vとのアンドをとる回路である。 また、 アンド回路 50は、 アンド条件が 成立した場合、 WAY 0— H I Tをオア回路 60へ出力するとともに、 WAY0 — H I Tを選択信号 S EL 70 (WAY 0に対応) として、 セレクタ 70へ出力 する。  The AND circuit 50 is a circuit for ANDing the output of the comparator 40 and the valid bit V latched by the latch circuit 26. When the AND condition is satisfied, the AND circuit 50 outputs WAY 0 — H IT to the OR circuit 60 and outputs WAY 0 — H IT to the selector 70 as a selection signal SEL 70 (corresponding to WAY 0).
比較器 41は、 ラッチ回路 21にラッチされたアドレスタグ部く 63 : 14 > と、 ラッチ回路 23にラッチされたタグく 63 : 14 > (WAY 1に対応) とを 比較し、 一致した場合、 WAY 1— HI T (第 12図参照: ウェイ 1がヒット) を出力する。  The comparator 41 compares the address tag portion 63:14> latched by the latch circuit 21 with the tag tag 63:14> (corresponding to WAY 1) latched by the latch circuit 23, and when they match, WAY 1—HI T (See Fig. 12: Way 1 hits).
アンド回路 51は、 比較器 41の出力と、 ラッチ回路 27にラッチされた有効 ビット Vとのアンドをとる回路である。 また、 アンド回路 51は、 アンド条件が 成立した場合、 WAY 1— HI Tをオア回路 60へ出力するとともに、 WAY1 — H I Tを選択信号 S EL 70 (WAY 1に対応) として、 セレクタ 70へ出力 する。  The AND circuit 51 is a circuit that ANDs the output of the comparator 41 and the valid bit V latched by the latch circuit 27. When the AND condition is satisfied, the AND circuit 51 outputs WAY 1 — HIT to the OR circuit 60 and outputs WAY 1 — HIT to the selector 70 as the selection signal SEL 70 (corresponding to WAY 1). .
比較器 42は、 ラッチ回路 21にラッチされたアドレスタグ部く 63 : 14> と、 ラッチ回路 24にラッチされたタグ < 63 : 14> (WAY 2に対応) とを 比較し、 一致した場合、 WAY2_H I T (第 12図参照: ゥヱイ 2がヒット) を出力する。  The comparator 42 compares the address tag portion 63:14> latched by the latch circuit 21 with the tag <63:14> (corresponding to WAY 2) latched by the latch circuit 24, and when they match, WAY2_HIT (see Fig. 12: Pay 2 hit) is output.
アンド回路 52は、 比較器 42の出力と、 ラッチ回路 28にラッチされた有効 ビット Vとのアンドをとる回路である。 また、 アンド回路 52は、 アンド条件が 成立した場合、 WAY 2— H I Tをオア回路 60へ出力するとともに、 WAY 2 — H I Tを選択信号 SEL 70 (WAY 2に対応) として、 セレクタ 70へ出力 する。 The AND circuit 52 is a circuit that ANDs the output of the comparator 42 and the valid bit V latched by the latch circuit 28. The AND circuit 52 has the AND condition When the condition is satisfied, WAY 2 — HIT is output to the OR circuit 60, and WAY 2 — HIT is output to the selector 70 as the selection signal SEL 70 (corresponding to WAY 2).
比較器 43は、 ラッチ回路 21にラッチされたアドレスタグ部く 63 : 14> と、 ラッチ回路 25にラッチされたタグく 63 : 14 > (WAY 3に対応) とを 比較し、 一致した場合、 WAY 3_H I T (第 12図参照:ウェイ 3がヒット) を出力する。  The comparator 43 compares the address tag section 63:14> latched by the latch circuit 21 with the tag section 63:14> (corresponding to WAY 3) latched by the latch circuit 25, and when they match, Outputs WAY 3_H IT (see Fig. 12: way 3 hits).
アンド回路 53は、 比較器 43の出力と、 ラッチ回路 29にラッチされた有効 ビット Vとのアンドをとる回路である。 また、 アンド回路 53は、 アンド条件が 成立した場合、 WAY 3— H I Τをオア回路 60へ出力するとともに、 WAY 3 — H I Tを選択信号 S EL 70 (WAY 3に対応) として、 セレクタ 70へ出力 する。  The AND circuit 53 is a circuit that ANDs the output of the comparator 43 and the valid bit V latched by the latch circuit 29. When the AND condition is satisfied, the AND circuit 53 outputs WAY 3—HI へ to the OR circuit 60, and outputs WAY 3—HIT as the selection signal SEL 70 (corresponding to WAY 3) to the selector 70. I do.
オア回路 60は、 アンド回路 50~ 53の各出力 (WAYO— H I T〜WAY 3— H I T) のオアをとる。 ラッチ回路 34は、 オア回路 60の出力をラッチし た後、 CACHE— HI T (キャッシュヒット) を出力する。  The OR circuit 60 ORs the outputs of the AND circuits 50 to 53 (WAYO—HIT to WAY3—HIT). After latching the output of the OR circuit 60, the latch circuit 34 outputs CACHE-HIT (cache hit).
セレクタ 70は、 ラッチ回路 30〜 33にラッチされたデータく 63 : 0>の うち、 選択信号 SEL70 (WAY0〜3のうちいずれかの WAY) に対応する ラッチ回路にラッチされたデータ < 63 : 0〉を選択し、 これを出力する。 ラッ チ回路 35は、 セレクタ 70により選択されたデータ < 63 : 0>をラッチした 後、 キヤッシュヒットの結果として、 出力する。  The selector 70 outputs the data <63: 0> latched in the latch circuit corresponding to the selection signal SEL70 (one of WAY0 to 3) among the data 63: 0> latched by the latch circuits 30 to 33. Select > and output this. After latching the data <63: 0> selected by the selector 70, the latch circuit 35 outputs the result as a cache hit result.
上記構成にお!/、て、 第 13図に示した時刻 t 0では、 C P U 10 (第 8図参照 ) は、 キャッシュメモリ 12 (キャッシュミスの場合、 メインメモリ 13) から、 必要なデータく 63 : 0>を読み出すべく、 該データく 63 : 0>に対応するァ ドレスく 63 : 0〉をキャッシュァクセス制御部 1 1へ出力する。  At the time t0 shown in FIG. 13, the CPU 10 (see FIG. 8) transfers the necessary data from the cache memory 12 (the main memory 13 in the case of a cache miss). : 0> is output to the cache access control unit 11 to read out the address 63: 0> corresponding to the data 63: 0>.
これにより、 時刻 t lでは、 タグ RAMI 2 aの処理とデータ RAMI 2 bの 処理とが並列的に実行される。 すなわち、 タグ: RAMI 2 aでは、 アドレス < 6 3 : 0 >に含まれるアドレスインデックス部く 13 : 4〉を検索キーとして、 第 10図に示したように、 複数のインデックスから、 ァドレスィンデックス部く 1 3 : 4 >と一致するィンデックスが検索され、 該ィンデックスに対応するライン がー意に特定される。 Thereby, at time tl, the processing of the tag RAMI 2a and the processing of the data RAMI 2b are executed in parallel. That is, in the tag: RAMI 2a, the address index part 13: 4> included in the address <63: 0> is used as a search key, As shown in FIG. 10, an index matching the indexless index part 13: 4> is searched from a plurality of indexes, and a line corresponding to the index is specified at will.
これにより、 時刻 t 2 (第 13図参照) で、 タグ RAMI 2 aからは、 上記ラ インに対応する WAY 0〜WAY 3の各エントリに記憶されているタグく 63 : 14 >がラッチ回路 22〜25にラッチされる。  As a result, at time t 2 (see FIG. 13), the tag RAM 63 a from the tag RAMI 2 a stored in the respective entries of WAY 0 to WAY 3 corresponding to the above-mentioned line is latch circuit 22. Latched to ~ 25.
さらに、 時刻 t 2で、 タグ RAMI 2 aからは、 上記ラインに対応する WAY 0〜WAY 3の各エントリに記憶されている有効ビット Vがラッチ回路 26〜2 9にラッチされる。 '  Further, at time t2, the valid bits V stored in the respective entries of WAY0 to WAY3 corresponding to the above line are latched by the latch circuits 26 to 29 from the tag RAMI2a. '
一方、 データ RAMI 2 bでも、 アドレスく 63 : 0>に含まれるアドレスィ ンデックス部く 13 : 4 >を検索キーとして、 第 10図に示したように、 複数の インデックスから、 ァドレスインデックス部く 13 : 4 >と一致するインデック スが検索され、 該インデックスに対応するラインが一意に特定される。  On the other hand, in the data RAMI 2b, as shown in FIG. 10, the address index portion included in the address 63: 0> is used as a search key, and as shown in FIG. : 4 An index matching> is searched, and the line corresponding to the index is uniquely specified.
これにより、 B寺刻 t 2 (第 13図参照) で、 データ RAMI 2 bからは、 上記 ラインに対応する WAY 0〜WAY 3の各ェントリに記憶されているデータく 6 3 : 0 >がラッチ回路 30〜 33にラッチされる。  As a result, the data stored in each of the WAY 0 to WAY 3 entries corresponding to the above lines is latched from the data RAMI 2 b at the B temple time t 2 (see FIG. 13). Latched in circuits 30-33.
また、 時刻 t 2では、 ラッチ回路 20にァドレスバイ トオフセット部く 3 : 0 >がラッチされるとともに、 ラッチ回路 21にアドレスタグ部く 63 : 14>が ラッチさ る。  At time t2, the address byte offset portion 3: 0> is latched in the latch circuit 20, and the address tag portion 63:14> is latched in the latch circuit 21.
そして、 時刻 t 2〜時刻 t 3では、 比較処理およびヒットウエイ選択処理が実 行される。 すなわち、 比較処理において、 比較器 40〜43では、 ラッチ回路 2 1にラッチされたアドレスタグ部く 63 : 14 >と、 ラッチ回路 22〜25にそ れぞれラツチされたタグぐ 63 : 14> (WAY 0〜3に対応) とを比較する。 この場合、 アドレスタグ部く 63 : 14 >と WAY 0に対応するタグく 63 : 14 >とが一致しているとすると、 比較器 40は、 WAYO— H I Tをアンド回 路 50へ出力する。 なお、 他の比較器 41〜43の比較結果は、 いずれも不一致 である。 アンド回路 50では、 比較器 40の出力 (WAY 0— HI T) と、 ラッチ回路 26との出力 (有効ビット V:有効であるとする) とのアンドをとり、 WAY0 — H I Tをオア回路 60へ出力する。 Then, from time t2 to time t3, comparison processing and hitway selection processing are performed. That is, in the comparison process, in the comparators 40 to 43, the address tags 63:14> latched by the latch circuit 21 and the tags respectively latched by the latch circuits 22 to 25:63:14> (Corresponding to WAY 0 to 3). In this case, assuming that the address tag 63:14> matches the tag 63:14> corresponding to WAY 0, the comparator 40 outputs WAYO-HIT to the AND circuit 50. The comparison results of the other comparators 41 to 43 are all inconsistent. The AND circuit 50 performs an AND operation on the output of the comparator 40 (WAY 0—HI T) and the output of the latch circuit 26 (valid bit V: supposed to be valid), and sends WAY 0 — HIT to the OR circuit 60 Output.
また、 ヒットウェイ選択処理では、 アンド回路 50からの WAYO— H I Tが 選択信号 SEL70 (WAYOに対応) として、 セレクタ 70に入力される。 こ れにより、 セレクタ 70は、 ラッチ回路 30 (WAYOに対応) にラッチされた データく 63 : 0〉を選択し、 出力する。  In the hitway selection process, WAYO-HIT from the AND circuit 50 is input to the selector 70 as a selection signal SEL70 (corresponding to WAYO). As a result, the selector 70 selects and outputs the data 63: 0> latched by the latch circuit 30 (corresponding to WAYO).
そして、 時刻 t 3では、 ラッチ回路 34にオア回路 60からの WAYO— H I Tがラッチされた後、 CACHE— HI T (キャッシュヒット) が CPU 10へ 出力される。 また、 時刻 t 3では、 セレクタ 70により選択されたデータく 63 : 0> (WAYOに対応) がラッチされた後、 CPU10へ出力される。  Then, at time t3, after the WAYO-HIT from the OR circuit 60 is latched by the latch circuit 34, a CACHE-HIT (cache hit) is output to the CPU 10. At time t 3, the data selected by the selector 70 (63: 0> (corresponding to WAYO)) is latched and then output to the CPU 10.
特許文献 1 特開 2001— 075864号公報  Patent Document 1 JP 2001-075864 A
ところで、 前述したように従来のキャッシュメモリ装置およびキャッシュメモ リ制御方法においては、 CPU 10からアドレスく 63 : 0>が出力されてから ヒットウェイを選択し、 キャッシュメモリ 12からデータく 63 : 0>が出力さ れるまでに、 4サイクル (第 13図の時刻 t 0〜時刻 t 3) もかかり、 高速化の ニーズに十分に応えることができないという問題があつた。  By the way, as described above, in the conventional cache memory device and cache memory control method, a hitway is selected after an address 63: 0> is output from the CPU 10, and a data address 63: 0> is output from the cache memory 12. It takes four cycles (time t0 to time t3 in Fig. 13) to output, and there was a problem that it was not possible to sufficiently meet the needs for high speed.
本発明は、 上記に鑑みてなされたもので、 高速化を図ることができるキヤッシ ュメモリ装置およびキヤッシュメモリ制御方法を提供することを目的としてレ、る。 発明の開示  The present invention has been made in view of the above, and has as its object to provide a cache memory device and a cache memory control method that can achieve high speed. Disclosure of the invention
上記目的を達成するために、 本発明は、 複数のウェイを有するセットァソシァ ティブ方式が採られたキャッシュメモリと、 過去におけるメモリアクセスで複数 のウェイの中から選択されたウェイおょぴァドレスに対応するヒットウェイ履歴 データを格納するヒットウェイ履歴データ格納手段と、 メモリアクセス時のアド レスをキーとして、 前記ヒットウェイ履歴データからウェイを検索し、 該ウェイ を予測ウェイとする予測手段と、 前記予測ウェイに対応するデータを前記キヤッ シュメモリ力、ら読み出す読出手段と、 を備えたことを特徴とする。 In order to achieve the above object, the present invention relates to a cache memory adopting a set associative method having a plurality of ways, and a way address selected from a plurality of ways in a memory access in the past. Hitway history data storage means for storing hitway history data; a search means for searching a way from the hitway history data using an address at the time of memory access as a key; Data corresponding to the And reading means for reading out the memory.
また、 本発明は、 複数のウェイを有するセットァソシァティブ方式が採られた キャッシュメモリへのァクセス制御を行うキャッシュメモリ制御方法であって、 過去におけるメモリアクセスで複数のウェイの中から選択されたウェイおよびァ ドレスに対応するヒットウエイ履歴データを格納するヒットウエイ履歴データ格 納ェ程と、 メモリアクセス時のアドレスをキーとして、 前記ヒットウェイ履歴デ ータからウェイを検索し、 該ウェイを予測ウェイとする予測工程と、 前記予測ゥ エイに対応するデータを前記キヤッシュメモリから読み出す読出工程と、 を含む ことを特 ί敷とする。  Further, the present invention is a cache memory control method for controlling access to a cache memory employing a set associative method having a plurality of ways, wherein the cache memory is selected from a plurality of ways by memory access in the past. A search is made from the hitway history data using the hitway history data storage amount for storing the hitway history data corresponding to the accessed way and address, and the address at the time of memory access as a key, and the way is searched for. In particular, the method includes: a prediction step of setting a prediction way; and a reading step of reading data corresponding to the prediction layer from the cache memory.
力かる発明によれば、 過去におけるメモリアクセスで複数のウェイの中から選 択されたウェイおょぴァドレスに対応するヒットウエイ履歴データを格納し、 メ モリアクセス時のァドレスをキーとして、 ウェイを検索し、 該ウェイを予測ゥェ ィとして予測した後、 予測ウェイに対応するデータをキャッシュメモリから読み 出すこととしたので、 従来に比して、 データの読み出しにかかるウェイの決定が 早くなり、 高速ィ匕を図ることができる。 図面の簡単な説明  According to the powerful invention, hitway history data corresponding to a way address selected from a plurality of ways in a memory access in the past is stored, and the way is set using the address at the time of memory access as a key. After searching and predicting the way as the prediction way, the data corresponding to the prediction way is read from the cache memory, so that the way to determine the data reading is determined earlier than in the past, High speed riding can be achieved. Brief Description of Drawings
第 1図は、 本発明にかかる実施の形態 1の構成を示すブロック図であり、 第 2 図は、 第 1図に示したキャッシュアクセス制御部 8 0およびキャッシュメモリ 1 2の構成を示す図であり、 第 3図は、 第 2図に示したヒットウェイ履歴データ格 納部 9 0の構成を示す図であり、 第 4図は、 実施の形態 1の動作を説明する図で あり、 第 5図は、 本発明にかかる実施の形態 2の構成を示すブロック図であり、 第 6図は、 第 5図に示したキャッシュアクセス制御部 1 4 0およびキャッシュメ モリ 1 2の構成を示す図であり、 第 7図は、 第 6図に示したヒットウェイ履歴デ ータ格納部 1 5 0の構成を示す図であり、 第 8図は、 従来のキャッシュメモリ装 置の構成を示すブロック図であり、 第 9図は、 第 8図に示したメインメモリ 1 3 を示す図であり、 第 1 0図は、 第 8図に示したタグ R AM I 2 aおよびデータ R AM I 2 bを示す図であり、 第 1 1図は、 第 8図に示したキャッシュアクセス制 御部 1 1およびキャッシュメモリ 1 2の構成を示す図であり、 第 1 2図は、 従来 のキャッシュメモリ装置の動作を説明する図であり、 第 1 3図は、 従来のキヤッ シュメモリ装置の動作を説明する図である。 発明を実施するための最良の形態 FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention. FIG. 2 is a diagram showing the configuration of the cache access control unit 80 and the cache memory 12 shown in FIG. FIG. 3 is a diagram showing the configuration of the hitway history data storage unit 90 shown in FIG. 2, and FIG. 4 is a diagram for explaining the operation of the first embodiment. FIG. 6 is a block diagram showing a configuration of a second embodiment according to the present invention. FIG. 6 is a diagram showing a configuration of the cache access control unit 140 and the cache memory 12 shown in FIG. FIG. 7 is a diagram showing the configuration of the hitway history data storage section 150 shown in FIG. 6, and FIG. 8 is a block diagram showing the configuration of a conventional cache memory device. FIG. 9 is a diagram showing the main memory 13 shown in FIG. 8, and FIG. Tag shown in FIG. 8 R AM I 2 a, and data R FIG. 11 is a diagram showing AM I 2b, FIG. 11 is a diagram showing the configuration of the cache access control unit 11 and the cache memory 12 shown in FIG. 8, and FIG. FIG. 13 is a diagram for explaining the operation of the cache memory device. FIG. 13 is a diagram for explaining the operation of the conventional cache memory device. BEST MODE FOR CARRYING OUT THE INVENTION
以下、 図面を参照して本発明にかかる実施の形態 1および 2について詳細に説 明する。  Hereinafter, Embodiments 1 and 2 according to the present invention will be described in detail with reference to the drawings.
(実施の形態 1 )  (Embodiment 1)
第 1図は、 本発明にかかる実施の形態 1の構成を示すブロック図である。 この 図において、 第 8図の各部に対応する部分には同一の符号を付け、 その説明を省 略する。 第 1図においては、 第 8図のキャッシュアクセス制御部 1 1に代えて、 キャッシュアクセス制御部 8 0が設けられている。  FIG. 1 is a block diagram showing a configuration of a first embodiment according to the present invention. In this figure, parts corresponding to the respective parts in FIG. 8 are denoted by the same reference numerals, and description thereof will be omitted. In FIG. 1, a cache access control unit 80 is provided instead of the cache access control unit 11 in FIG.
キヤッシュアクセス制御部 8 0は、 キヤッシュアクセス制御部 1 1の機能に加 えて、 ウェイを予測する機能を備えている。  The cache access control unit 80 has a function of predicting a way in addition to the function of the cache access control unit 11.
第 2図は、 第 1図に示したキャッシュアクセス制御部 8 0およびキャッシュメ モリ 1 2の構成を示す図である。 この図において、 第 1 1図に対応する部分には 同一の符号を付け、 その説明を省略する。  FIG. 2 is a diagram showing a configuration of the cache access control unit 80 and the cache memory 12 shown in FIG. In this figure, parts corresponding to those in FIG. 11 are denoted by the same reference numerals, and description thereof will be omitted.
第 2図においては、 ヒットウェイ履歴データ格納部 9 0、 セレクタ 1 0 0、 ラ ツチ回路 1 1 0〜1 1 2および比較器 1 2 0が新たに設けられている。  In FIG. 2, a hitway history data storage unit 90, a selector 100, a latch circuit 110 to 112, and a comparator 120 are newly provided.
ヒットウェイ履歴データ格納部 9 0は、 最新の過去 4回分のヒットウェイ、 す なわち、 ヒット選択処理で選択されたヒットウヱイ (選択信号 S E L 7 0 (WA Y 0〜3— H I T) ) の履歴データを格納する。  The hitway history data storage section 90 stores history data of the latest four hitways, that is, the hitway selected by the hit selection processing (selection signal SEL70 (WAY0 to 3—HIT)). Is stored.
第 3図は、 第 2図に示したヒットウェイ履歴データ格納部 9 0の構成を示す図 である。 同図に示したヒットウェイ履歴データ格納部 9 0において、 F I F O ( Fast In Fast Out) レジスタ 9 1は、 最新の過去 4回分のヒットウェイ (WAY 0 H I T〜WAY 3 H I Tのうちいずれか) およびヒットウェイ選択時のァ ドレスインデックス部く 13 : 4 >からなる履歴データを格納する。 FIG. 3 is a diagram showing a configuration of the hitway history data storage unit 90 shown in FIG. In the hitway history data storage section 90 shown in the figure, the FIFO (Fast In Fast Out) register 91 stores the latest four hitways (WAY 0 HIT to WAY 3 HIT) and hits. Key when selecting way Stores history data consisting of the dress index part 13: 4>.
F I FOレジスタ 91において、 ウェイレジスタ部 91WOおよぴァドレスレ ジスタ部 91 AOには、 過去 4回分のうち最も新しいヒットウエイおよびァドレ スインデックス部く 13 : 4 >が格納される。  In the FIFO register 91, the way register section 91WO and the address register section 91AO store the latest hitway and address index section 13: 4> of the past four times.
ウェイレジスタ部 91W1およびアドレスレジスタ部 91A1には、 過去 4回 分のうち 2番目に新しいヒットウェイおよびアドレスインデックス部く 13 : 4 >が格納される。  The way register section 91W1 and the address register section 91A1 store the second newest hitway and address index section 13: 4> of the past four times.
ウェイレジスタ部 91W2およぴァドレスレジスタ部 91 A2には、 過去 4回 分のうち 3番目に新しいヒットウェイおょぴアドレスインデックス部く 13 : 4 >が格納される。 ウェイレジスタ部 91W3およびアドレスレジスタ部 91 A3 には、 過去 4回分のうち最も古いヒットウエイおよびアドレスインデックス部 < 13 : 4 >が格納される。  The way register section 91W2 and address register section 91A2 store the third newest hitway address index section 13: 4> of the past four times. The way register section 91W3 and the address register section 91A3 store the oldest hitway and address index section <13: 4> of the past four times.
F I FOレジスタ 91では、 新たなヒットウエイおよびァドレスインデックス 部 < 13 : 4 >が格納されると、 各履歴データが同図右方向へシフトし、 最も古 い履歴データが追い出される。  In the FIFO register 91, when a new hit way and address index section <13: 4> are stored, each piece of history data is shifted rightward in the figure, and the oldest history data is expelled.
比較器 93〜96は、 ァドレスレジスタ部 91 A0〜91 A3に対応して設け られており、 アドレスインデックス部く 13 : 4 >と、 アドレスレジスタ部 91 A0〜91 A3に格納されたアドレスインデックス部く 13 : 4 >とを比較する。 また、 比較器 93〜96は、 一致した場合に、 当該アドレスレジスタ部 (対応す るウェイレジスタ部) を選択するための選択信号 SEL 97をセレクタ 97へ出 力する。  The comparators 93 to 96 are provided corresponding to the address register sections 91 A0 to 91 A3, and have an address index section 13: 4> and an address index section stored in the address register sections 91 A0 to 91 A3. 13: 4> and compare. In addition, the comparators 93 to 96 output a selection signal SEL 97 for selecting the address register section (corresponding way register section) to the selector 97 when they match.
セレクタ 97は、 ゥヱイレジスタ部 91W0〜91 W3に格納されたヒットウ エイのうち選択信号 SEL 97に対応するウェイレジスタ部に格納されたヒット ウェイを選択し、 これを予測ヒットウェイ (P_WAY0_H I T〜P— WAY 3— H I Tのうちいずれか) として、 ラッチ回路 1 10 (第 2図参照) へ出力す る。 ラッチ回路 1 10は、 予測ヒットウェイをラッチする。  The selector 97 selects the hit way stored in the way register corresponding to the selection signal SEL 97 from among the hit ways stored in the pay registers 91W0 to 91W3, and predicts the hit way (P_WAY0_HIT to P—WAY). 3—HIT) and output to latch circuit 110 (see Fig. 2). The latch circuit 110 latches the predicted hitway.
また、 セレクタ 97は、 予測ヒットウェイ (P WAYO HIT〜P WA Y3— H I Tのうちいずれか) を第 2図に示した選択信号 SEL 100として、 セレクタ 100へ出力する。 In addition, the selector 97 selects the prediction hitway (P WAYO HIT to P WA Y3—HIT) is output to the selector 100 as the selection signal SEL 100 shown in FIG.
セレクタ 100は、 データ RAMI 2 bから出力される WAY 0〜 3に対応す るデータぐ 63 : 0 >から、 選択信号 S EL 100 (予測ヒットウエイ) に対-応 するウェイのデータく 63 : 0>を選択し、 ラッチ回路 111へ出力する。  Selector 100 outputs the data corresponding to WAY 0 to 3 output from data RAMI 2b 63: 0> to the data of the way corresponding to selection signal SEL 100 (predicted hit way). Select> and output to the latch circuit 111.
ラッチ回路 111は、 上記ウェイのデータく 63 : 0>を、 予測ヒットウエイ に基づく予測データく 63 : 0>として、 ラッチする。  The latch circuit 111 latches the data of the way 63: 0> as the prediction data 63: 0> based on the prediction hitway.
比較器 120は、 ラッチ回路 1 10にラッチされた予測ヒットウェイと、 選択 信号 SEL70 (WAYO〜3— HI T) とを比較し、 一致する場合、 P_WA Y— HI T (予測ウェイヒット) をオンにしてラッチ回路 112へ出力する。 ラ ツチ回路 112は、 P— WAY_HI T (予測ウェイヒット) をラッチする。 こ の P— WAY一 H I T (予測ウェイヒット) がオンであるということは、 ヒット ウェイ履歴データ格納部 90で予測された予測ヒットウェイと、 実際のヒットウ エイとがー致し、 予測が当たつたことを意味している。  The comparator 120 compares the prediction hitway latched by the latch circuit 110 with the selection signal SEL70 (WAYO to 3—HI T), and turns on P_WA Y—HI T (prediction way hit) if they match. And outputs it to the latch circuit 112. The latch circuit 112 latches P—WAY_HIT (predicted way hit). The fact that this P—WAY-HIT (prediction way hit) is on means that the prediction hitway predicted by the hitway history data storage unit 90 and the actual hitway match, and the prediction was successful. Means that.
P— WAY— H I T (予測ウェイヒット) をラツチしたラツチ回路 112は、 P— DATA— V (予測データ有効ビット) を CPU 10 (第 1図参照) へ出力 する。 P— DATA— V (予測データ有効ビット) は、 ラッチ回路 1 11から出 力される予測データ <63 : 0〉を有効とする一方、 ラッチ回路 35から出力さ れるデータく 63 : 0 >を無効にするためのビットである。  The latch circuit 112 that latches P—WAY—HIT (predicted way hit) outputs P—DATA—V (predicted data valid bit) to the CPU 10 (see FIG. 1). P—DATA—V (predicted data valid bit) enables the predicted data <63: 0> output from the latch circuit 111, while invalidates the data output from the latch circuit 35 (63: 0). Is a bit for
一方、 ラッチ回路 1 10にラッチされた予測ウェイと、 選択信号 SEL 70 ( WAY0〜3— HI T) とが不一致である場合、 比較器 120は、 P— WAY— HI T (予測ウェイヒット) をオフにしてラッチ回路 1 12へ出力する。 この P _WAY_H I T (予測ウェイヒット) がオフであるということは、 ヒットゥェ ィ履歴データ格納部 90で予測された予測ヒットウェイと、 実際のヒットゥヱイ とが一致せず、 予測が外れたことを意味している。  On the other hand, when the prediction way latched by the latch circuit 110 and the selection signal SEL 70 (WAY0 to 3—HI T) do not match, the comparator 120 outputs P—WAY—HI T (prediction way hit). Turn off and output to latch circuit 112. The fact that this P_WAY_HIT (predicted way hit) is off means that the predicted hit way predicted by the hittweet history data storage unit 90 does not match the actual hittwey and the prediction was missed. ing.
P_DATA_V (予測データ有効ビット) がオフの場合には、 ラッチ回路 1 11から出力される予測データ < 63 : 0>が無効される一方、 ラッチ回路 35 力 ら出力されるデータく 63 : 0>が有効とされる。 When P_DATA_V (predicted data valid bit) is off, the predicted data <63: 0> output from the latch circuit 111 is invalidated, while the latch circuit 35 is disabled. 63: 0> is valid.
上記構成において、 第 4図に示した時刻 t 0では、 CPU10 (第 1図参照) は、 キャッシュメモリ 12 (キャッシュミスの場合、 メインメモリ 13) から、 必要なデータく 63 : 0〉を読み出すべく、 該データ < 63 : 0〉に対応するァ ドレスく 63 : 0 >をキャッシュアクセス制御部 140へ出力する。  In the above configuration, at time t0 shown in FIG. 4, the CPU 10 (see FIG. 1) reads out the necessary data (63: 0) from the cache memory 12 (in the case of a cache miss, the main memory 13). Then, the address <63: 0> corresponding to the data <63: 0> is output to the cache access control unit 140.
これにより、 時刻 t lでは、 タグ RAMI 2 aの処理とデータ RAMI 2 bの 処理とが並列的に実行される。 すなわち、 タグ RAMI 2 aでは、 アドレスく 6 3 : 0>に含まれるアドレスインデックス部く 13 : 4 >を検索キーとして、 第 10図に示したように、 複数のインデックスから、 アドレスインデックス部く 1 3 : 4 >と一致するインデックスが検索され、 該インデックスに対応するライン がー意に特定される。 Thereby, at time tl, the processing of the tag RAMI 2a and the processing of the data RAMI 2b are executed in parallel. That is, in the tag RAMI 2a, the address index portion 13: 4> included in the address 63: 0> is used as a search key, and as shown in FIG. An index that matches 3: 4 > is searched, and the line corresponding to the index is uniquely specified.
これにより、 時刻 t 2 (第 4図参照) で、 タグ RAMI 2 aからは、 上記ライ ンに対応する WAY 0〜WAY 3の各エントリに記憶されているタグく 63 : 1 4〉がラッチ回路 22〜25にラッチされる。  As a result, at time t2 (see FIG. 4), the tag RAMI2a outputs the tag data 63:14> stored in each of the WAY0 to WAY3 entries corresponding to the above line to the latch circuit. Latched at 22-25.
さらに、 時刻 t 2で、 タグ RAMI 2 aからは、 上記ラインに対応する WAY 0〜WAY 3の各エントリに記憶されている有効ビット Vがラッチ回路 26〜2 9にラッチさ る。  Further, at time t2, from the tag RAMI2a, the valid bits V stored in the respective entries of WAY0 to WAY3 corresponding to the above line are latched by the latch circuits 26 to 29.
一方、 データ RAMI 2 bでも、 アドレスく 63 : 0 >に含まれるアドレスィ ンデックス部く 13 : 4〉を検索キーとして、 第 10図に示したように、 複数の インデックスから、 アドレスインデックス部く 13 : 4 >と一致するインデック スが検索され、 該ィンデックスに対応するラィンが一意に特定される。  On the other hand, in the data RAMI 2b, as shown in FIG. 10, the address index part 13: 4> included in the address index 63: 0> is used as a search key, and as shown in FIG. : 4 An index matching <> is searched, and a line corresponding to the index is uniquely specified.
これにより、 時刻 t 2 (第 4図参照) で、 データ RAMI 2 bからは、 上記ラ ィンに対応する WAY 0〜WAY 3の各ェントリに記憶されているデータく 63 As a result, at time t 2 (see FIG. 4), the data RAMI 2 b outputs the data stored in each of the WAY 0 to WAY 3 entries corresponding to the above line.
: 0>がラッチ回路 30〜33にラッチされる。 : 0> is latched by the latch circuits 30 to 33.
また、 時亥 'J t 2では、 ラッチ回路 20にァドレスバイトオフセット部く 3 : 0 In addition, in Toki'Jt2, the address byte offset portion is added to the latch circuit 20 at 3: 0.
>がラッチされるとともに、 ラツチ回路 21にァドレスタグ部く 63 : 14 >が ラッチさ る。 さらに、 時刻 t 1では、 上述したタグ RAMI 2 aおよびデータ RAMI 2 b の処理と並列的にウェイ予測処理が実行される。 具体的には、 CPU11からの 了ドレス < 63 : 0 >に含まれるアドレスインデックス部く 13 : 4>が、 第 3 図に示したヒットウエイ履歴データ格納部 90の比較器 93〜96に入力される。 これにより、 比較器 93〜96は、 入力されたアドレスインデックス部く 13 : 4>と、 ァドレスレジスタ部 91 A0〜91 A3に格納されたァドレスインデ ックス部く 13 : 4 >とを比較する。 Is latched, and the address tag section 63:14> is latched in the latch circuit 21. Further, at time t1, way prediction processing is executed in parallel with the processing of the tag RAMI 2a and the data RAMI 2b described above. Specifically, the address index part 13: 4> included in the address <63: 0> from the CPU 11 is input to the comparators 93 to 96 of the hitway history data storage unit 90 shown in FIG. You. As a result, the comparators 93 to 96 compare the input address index portion 13: 4> with the address index portion 13: 4> stored in the address register portions 91 A0 to 91 A3.
ここで、 入力されたアドレスインデックス部く 13 : 4>と、 アドレスレジス タ部 91 AOに格納されたアドレスインデックス部く 13 : 4 >とが一致してい る場合、 比較器 93は、 ァドレスレジスタ部 91 AOに対応するウェイレジスタ 部 91W0を選択するための選択信号 SEL 97をセレクタ 97へ出力する。 セレクタ 97は、 ウェイレジスタ部 91W0〜91W3に格納されたヒットウ エイのうち選択信号 SEL 97に対応するウェイレジスタ部 91WOに格納され たヒットウェイ (WAY 0— HI T) を選択し、 これを予測ヒットウェイ (P一 WAYO— HI T) として、 第 2図に示したラッチ回路 110へ出力する。  Here, if the input address index portion 13: 4> matches the address index portion 13: 4> stored in the address register portion 91 AO, the comparator 93 sets the address register portion. A select signal SEL 97 for selecting the way register section 91W0 corresponding to 91 AO is output to the selector 97. The selector 97 selects a hit way (WAY 0—HI T) stored in the way register section 91WO corresponding to the selection signal SEL 97 among the hit ways stored in the way register sections 91W0 to 91W3, and predicts the hit. It outputs to the latch circuit 110 shown in FIG. 2 as a way (P-WAYO-HI T).
これにより、 ラッチ回路 110は、 時刻 t 2 (図 4参照) で、 予測ヒットゥェ ィ (P— WAY 0— HI T) をラッチする。  Thus, the latch circuit 110 latches the predicted hit time (P—WAY 0—HI T) at time t 2 (see FIG. 4).
また、 セレクタ 97は、 予測ヒットウェイ (P— WAY 0— HI T) を選択信 号 SEL100として、 セレクタ 100へ出力する。  The selector 97 outputs the predicted hitway (P—WAY 0—HIT) to the selector 100 as a selection signal SEL100.
セレクタ 100は、 データ RAMI 2 bから出力される WAY0〜3に対応す るデータく 63 : 0 >から、 選択信号 SEL 100 (予測ヒットウェイ (P一 W AYO— H I T) ) に対応する WAY 0のデータく 63 : 0>を選択し、 ラッチ 回路 111へ出力する。  The selector 100 outputs the data corresponding to WAY0 to 3 output from the data RAMI 2b (63: 0), and selects the WAY0 corresponding to the selection signal SEL100 (predicted hitway (P-WAYO-HIT)). Select data 63: 0> and output it to the latch circuit 111.
これにより、 ラッチ回路 111は、 時刻 t 2 (第 4図参照) で、 上記 WAY 0 のデータく 63 : 0 >を、 予測ウェイに基づく予測データ < 63 : 0〉として、 ラッチした後、 この予測データ < 63 : 0>を CPU10へ出力する。  As a result, at time t 2 (see FIG. 4), the latch circuit 111 latches the data of the WAY 0, 63: 0>, as prediction data <63: 0> based on the prediction way, and then latches this prediction. Outputs data <63: 0> to CPU10.
これにより、 CPU10では、 従来に比べて 1サイクノレ分 (第 13図の場合、 時刻 t 3で処理を実行。 これに対して、 第 4図の場合、 時刻 t 2で処理を実行。 ) 早く予測データく 63 : 0 >に基づく処理を実行する。 As a result, the CPU 10 has one cycle more than before (in the case of FIG. 13, Execute processing at time t3. In contrast, in the case of Fig. 4, processing is performed at time t2. ) Perform processing based on the predicted data 63: 0> quickly.
また、 時刻 t 2〜時刻 t 3では、 比較処理、 ヒットウエイ選択処理、 予測検証 処理が実行される。 すなわち、 比較処理において、 比較器 40〜43では、 ラッ チ回路 21にラッチされたアドレスタグ部く 63 : 14>と、 ラッチ回路 22〜 25にそれぞれラツチされたタグ < 63 : 14〉 (WAY 0〜 3に対応) とを比 較する。  From time t2 to time t3, comparison processing, hitway selection processing, and prediction verification processing are performed. That is, in the comparison processing, in the comparators 40 to 43, the address tag section 63:14> latched by the latch circuit 21 and the tag <63:14> (WAY 0) latched by the latch circuits 22 to 25 respectively. (Corresponds to ~ 3).
この場合、 アドレスタグ部く 63 : 14 >と WAY 0に対応するタグく 63 : 14 >とが一致しているとすると、 比較器 40は、 WAYO— H I Tをアンド回 路 50へ出力する。 なお、 他の比較器 41〜43の比較結果は、 いずれも不一致 である。  In this case, if it is assumed that the address tag 63:14> matches the tag 63:14> corresponding to WAY 0, the comparator 40 outputs WAYO—HIT to the AND circuit 50. The comparison results of the other comparators 41 to 43 are all inconsistent.
アンド回路 50では、 比較器 40の出力 (WAY0_HI T) と、 ラッチ回路 In the AND circuit 50, the output (WAY0_HI T) of the comparator 40 and the latch circuit
26との出力 (有効ビット V:有効であるとする) とのアンドをとり、 WAY0AND with output (valid bit V: valid) with 26, WAY0
— H I Tをオア回路 60へ出力する。 — Output HIT to OR circuit 60.
また、 ヒットウェイ選択処理では、 アンド回路 50からの WAYO— H I Tが 選択信号 SEL70 (WAY 0に対応) として、 セレクタ 70に入力される。 こ れにより、 セレクタ 70は、 ラッチ回路 30 (WAYOに対応) にラッチされた データく 63 : 0>を選択し、 出力する。  In the hitway selection process, WAYO-HIT from the AND circuit 50 is input to the selector 70 as a selection signal SEL70 (corresponding to WAY 0). As a result, the selector 70 selects and outputs the data 63: 0> latched by the latch circuit 30 (corresponding to WAYO).
また、 予測検証処理において、 比較器 120は、 ラッチ回路 110にラッチさ れた予測ヒットウェイと、 選択信号 SEL 70 (WAY 0〜 3— HI T) とを比 較し、 一致する場合、 P_WAY_H I T (予測ウェイヒット) をラツチ回路 1 In the prediction verification process, the comparator 120 compares the prediction hitway latched by the latch circuit 110 with the selection signal SEL 70 (WAY 0 to 3—HI T), and when they match, P_WAY_HIT Latch circuit (prediction way hit) 1
12へ出力する。 Output to 12.
そして、 時刻 t 3では、 ラッチ回路 34にオア回路 60からの WAYO— H I Tがラッチされた後、 CACHE— HI T (キャッシュヒット) が CPU 10へ 出力される。  Then, at time t3, after the WAYO-HIT from the OR circuit 60 is latched by the latch circuit 34, a CACHE-HIT (cache hit) is output to the CPU 10.
また、 時刻 t 3では、 セレクタ 70により選択されたデータ < 63 : 0> (W AYOに対応) がラッチされた後、 CPU10へ出力される。 さらに、 時亥 lj t 3 では、 ラツチ回路 1 12に、 P— WAY— H I T (予測ウェイヒット) がラッチ される。 At time t3, the data <63: 0> (corresponding to WAYO) selected by the selector 70 is latched and then output to the CPU 10. Furthermore, Tokii lj t 3 In the latch circuit 112, P—WAY—HIT (predicted way hit) is latched.
これにより、 予測検証結果に基づく処理が実行される。 すなわち、 P— WAY —HI T (予測ウェイヒット) がオンの場合、 ラッチ回路 112から、 P— DA TA— V (予測データ有効ビット) がオンとして、 CPU 10 (第 1図参照) へ 出力される。  Thereby, processing based on the prediction verification result is executed. That is, when P—WAY—HI T (predicted way hit) is on, the latch circuit 112 outputs P—DATA—V (predicted data valid bit) to the CPU 10 (see FIG. 1). You.
これにより、 CPU 10は、 ラッチ回路 11 1から出力された予測データ < 6 3 : 0>を有効とする一方、 ラッチ回路 35から出力されたデータく 63 : 0> を無効にする。  Accordingly, the CPU 10 validates the predicted data <63: 0> output from the latch circuit 111, and invalidates the data 63: 0> output from the latch circuit 35.
一方、 P一 WAY— HI T (予測ウェイヒット) がオフの場合、 P一 DATA —V (予測データ有効ビット) がオフにされて CPU10 (第 1図参照) へ出力 される。  On the other hand, if P-WAY-HI T (predicted way hit) is off, P-DATA-V (predicted data valid bit) is turned off and output to CPU 10 (see Fig. 1).
これにより、 CPU 10は、 ラッチ回路 111から出力された予測データく 6 3 : 0〉を無効とする一方、 ラッチ回路 35から出力されるデータく 63 : 0〉 を有効にする。 この場合、 CPU 10は、 従来と同様にして、 データく 63 : 0 >を用いて、 処理を実行する。  As a result, the CPU 10 invalidates the prediction data 63: 0> output from the latch circuit 111, while validating the data 63: 0> output from the latch circuit 35. In this case, the CPU 10 executes the process using the data 63: 0> as in the conventional case.
以上説明したように、 実施の形態 1によれば、 過去におけるメモリアクセスで 複数のウェイの中から選択されたウェイおょぴァドレスに対応するヒットウエイ 履歴データをヒットウエイ履歴データ格納部 90に格納し、 メモリアクセス時の アドレスインデックス部く 13 : 4〉をキーとして、 ウェイを検索し、 該ウェイ を予測ウェイとして予測した後、 予測ゥヱイに対応するデータをデータ RAMI 2 bから読み出すこととしたので、 従来に比して、 データの読み出しにかかるゥ エイの決定が早くなり、 高速ィヒを図ることができる。  As described above, according to the first embodiment, hitway history data corresponding to a way address selected from a plurality of ways in the past memory access is stored in the hitway history data storage unit 90. Then, using the address index part 13: 4> at the time of memory access as a key, a way is searched, and after predicting the way as a predicted way, data corresponding to the predicted way is read from the data RAMI 2b. However, as compared with the related art, the determination of the wire involved in the data reading is quicker, and the speed can be increased.
(実施の形態 2)  (Embodiment 2)
第 5図は、 本発明にかかる実施の形態 2の構成を示すブロック図である。 この 図において、 第 1図の各部に対応する部分には同一の符号を付け、 その説明を省 略する。 第 5図においては、 第 1図に示したキャッシュアクセス制御部 80に代 えて、 キャッシュアクセス制御部 140が設けられている。 FIG. 5 is a block diagram showing a configuration of a second exemplary embodiment according to the present invention. In this figure, parts corresponding to the respective parts in FIG. 1 are denoted by the same reference numerals, and description thereof will be omitted. In FIG. 5, the cache access control unit 80 shown in FIG. In addition, a cache access control unit 140 is provided.
キャッシュァクセス制御部 140は、 キャッシュァクセス制御部 11 (第 8図 参照) の機能に加えて、 キヤッシュァクセス制御部 80 (第 1図参照) と同様に して、 ウェイを予測する機能を備えている。  The cache access control unit 140 has a function of predicting a way in the same way as the cache access control unit 80 (see FIG. 1), in addition to the function of the cache access control unit 11 (see FIG. 8). Have.
第 6図は、 第 5図に示したキャッシュアクセス制御部 140およびキャッシュ メモリ 12の構成を示すブロック図である。  FIG. 6 is a block diagram showing a configuration of the cache access control unit 140 and the cache memory 12 shown in FIG.
この図において、 第 2図に対応する部分に同一の符号を付け、 その説明を省略 する。  In this figure, parts corresponding to those in FIG. 2 are denoted by the same reference numerals, and description thereof is omitted.
第 6図においては、 第 2図に示したヒットウエイ履歴データ格納部 90に代え て、 ヒットウエイ履歴データ格納部 150が設けられている。  In FIG. 6, a hitway history data storage unit 150 is provided in place of the hitway history data storage unit 90 shown in FIG.
ヒットウェイ履歴データ格納部 150は、 第 7図に示したように、 タグ RAM 12 aおよびデータ RAMI 2 b (第 6図参照) と同様にして、 4ウェイの R A Ml 60〜163を備えている。  As shown in FIG. 7, the hitway history data storage section 150 includes 4-way RAMs 60 to 163 in the same manner as the tag RAM 12a and the data RAMI 2b (see FIG. 6). .
キャッシュメモリ 12およびキャッシュアクセス制御部 140においては、 C PU10よりアクセスの要求があると、 CPU 10からのアクセスアドレスく 6 3 : 0〉に対応するデータを CPU 10に返すとともに、 CPU 10からのァク セスアドレスく 17 : 4 >と、 そのアクセスでヒットした WAYの情報がヒット ウェイ履歴データ格納部 150に送られる。  In the cache memory 12 and the cache access control unit 140, when there is an access request from the CPU 10, the data corresponding to the access address (63: 0) from the CPU 10 is returned to the CPU 10 and the data from the CPU 10 is returned. The access address 17: 4> and the information of the WAY hit by the access are sent to the hit way history data storage unit 150.
第 7図に示したヒットウエイ履歴データ格納部 150では、 受け取ったァクセ スァドレス < 17 : 4 >のうちアクセスァドレスぐ 17 : 14 >をヒットウェイ 履歴書き込みデータく 17 : 14>、 アクセスァドレスく 13 : 4>をヒットウ エイ履歴書き込みインデックスく 13 : 4>とし、 ヒットした WAYの情報をヒ ットウエイ履歴格納部書き込みウェイく 3 : 0〉として、 RAMI 60〜163 にデータの書き込みが行われる。  In the hitway history data storage section 150 shown in FIG. 7, the access address 17:14> of the received access address <17: 4> is stored in the hitway history write data 17:14> and the access address 13: Data is written to RAMIs 60 to 163, with 4> being the hitway history write index 13: 4> and the hit WAY information being the hitway history storage section write way 3: 0>.
ヒットウエイ履歴データ格納部 150がヒットウエイ履歴書き込みデータく 1 7 : 14>、 ヒットウエイ履歴書き込みインデックスく 13 : 4>、 ヒットゥェ ィ履歴格納部書き込みウェイく 3 : 0>を受け取ると、 RAMI 60〜163の うち、 ヒットゥヱイ履歴格納部書き込みウェイく 3 : 0〉で示される RAMの中 の、 ヒットウェイ履歴書き込みインデックスく 13 : 4>に対応する位置に、 ヒ ットウェイ履歴書き込みデータ < 17 : 14 >の 4ビットのデータを書き込む。 また、 キャッシュアクセス制御部 140 (キャッシュメモリ 12) に CPU 1 0よりアクセスの要求があった場合、 ヒットウエイ履歴データ格納部 150には、 CPU 10からのアクセスァドレスく 63 : 0 >のうち、 アクセスァドレスく 1 7 : 4 >が入力される。 When the hitway history data storage unit 150 receives the hitway history write data # 17: 14>, the hitway history write index # 13: 4>, and the hitway history storage unit write way # 3: 0>, the RAMI 60 ~ 163 of Of these, four bits of hitway history write data <17:14> are located at the position corresponding to the hitway history write index 13: 4> in the RAM indicated by the hit history history storage unit write 3: 0>. Write the data of Also, when there is an access request from the CPU 10 to the cache access control unit 140 (cache memory 12), the hitway history data storage unit 150 stores the access address from the CPU 10 in the access address 63: 0>. Address 1 7: 4> is input.
入力されたアクセスァドレス < 17 : 4>のうちアクセスァドレス < 17 : 1 4>は、 ウェイ履歴比較データく 17 : 14 >として使用される。 また、 ァクセ スァドレス < 17 : 4 >のうちアクセスァドレス < 13 : 4 >は、 了ドレスィン デッタスく 13 : 4 >として使用される。  The access address <17:14> of the input access address <17: 4> is used as way history comparison data 17:14>. In addition, the access address <13: 4> of the access address <17: 4> is used as the default address 13: 4>.
了ドレスインデックスく 13 : 4〉が RAMI 60に入力されると、 当該イン デックスに対応した 4ビットのデータであるヒットウェイ履歴読み出しデータく 3 : 0>が出力される。  When the current index 13: 4> is input to the RAMI 60, the hitway history read data 3: 0>, which is 4-bit data corresponding to the index, is output.
同時に、 RAMI 61〜: AMI 63にもアドレスインデックスく 13 : 4 > が入力され、 それぞれからヒットウェイ履歴読み出しデータく 3 : 0〉が出力さ れる。  At the same time, address index 13: 4> is also input to RAMI 61 ~: AMI 63, and hitway history read data 3: 0> is output from each.
比較器 170〜173は、 RAMI 60〜163に対応して設けられており、 RAMI 60〜163からのヒットウエイ履歴読み出しデータく 3 : 0 >と、 C PU 10からのアドレスく 63 : 0>から得られるヒットウェイ履歴比較データ < 17 : 14>とを比較し、 一致した場合、 当該ウェイに対応する予測ヒットゥ エイ (P— WAYO— H I T〜P— WAY3— H I Tのうちいずれか、 または複 数) をセレクタ 180へ出力する。  The comparators 170 to 173 are provided corresponding to the RAMIs 60 to 163. The comparators 170 to 173 read the hitway history read data 3: 0> from the RAMIs 60 to 163 and the addresses 63: 0> from the CPU 10. The obtained hitway history comparison data <17:14> is compared, and if they match, the predicted hittuy corresponding to the way (one or more of P—WAYO—HIT to P—WAY3—HIT) Is output to the selector 180.
また、 セレクタ 180は、 比較器 170〜173からの予測ヒットウェイが一 つである場合、 当該予測ヒットウェイ (P— WAYO— H I T〜P— WAY3— H I Tのうちいずれ力 を第 6図に示したラッチ回路 1 10へ出力する。  In addition, when the number of predicted hitways from the comparators 170 to 173 is one, the selector 180 selects one of the predicted hitways (P—WAYO—HIT to P—WAY3—HIT in FIG. 6). Output to latch circuit 110.
また、 セレクタ 180は、 当該予測ヒットウェイ (P WAYO HI T〜P _WAY 3 _H I Tのうちいずれか) を第 6図に示した選択信号 S E L 1 0 0と してセレクタ 1 0 0へ出力する。 Also, the selector 180 selects the predicted hitway (P WAYO HI T ~ P _WAY 3 _HIT) is output to the selector 100 as the selection signal SEL 100 0 shown in FIG.
なお、 セレクタ 1 8 0は、 比較器 1 7 0〜1 7 3からの予測ヒットウェイが複 数 (マルチヒット) である場合、 複数の当該予測ヒットウェイ (P— WAY 0— H I T〜P— WAY 3— H I T) のうち、 最も若いウェイに対応する予測ヒット ウェイ (またはランダムに選択した一つのウェイに対応する予測ヒットウヱイ、 または最も新しい一つのウェイに対応する予測ヒットウェイ) を出力する。 なお、 マルチヒットの場合の予測ヒットウェイの選択方法については、 実施の形態 1 ( 第 3図の選択信号 S E L 9 7 ) にも適用可能である。  When the number of predicted hitways from the comparators 170 to 173 is plural (multi-hit), the selector 180 sets a plurality of predicted hitways (P—WAY 0—HIT to P—WAY). 3—HIT), the predicted hit way corresponding to the youngest way (or the predicted hit way corresponding to one randomly selected way or the predicted hit way corresponding to the newest one way) is output. The method of selecting a predicted hitway in the case of a multi-hit is also applicable to the first embodiment (selection signal SEL97 in FIG. 3).
以上説明したように、 実施の形態 2によれば、 実施の形態 1と同様の効果を奏 する。  As described above, according to the second embodiment, the same effects as in the first embodiment can be obtained.
また、 実施の形態 2においては、 ヒットウェイ履歴書き込みデータとして用い られているアクセスアドレスく 1 7 : 1 4 >の値を、 使用する環境や用途、 実行 するプログラムによって、 アクセスアドレスく 1 7 : 1 4 >以外の値に変更する ように構成してもよい。 この場合には、 ウェイ予測の精度を上げることができる。 例えば、 第 7図におけるアクセスァドレスく 1 7 : 1 4 >をアクセスアドレス < 2 1 : 4 >に変更した場合には、 履歴データ選択信号 (図示略) によって、 ヒ ットウェイ履歴書き込みデータく 1 7 : 1 4 >または履歴書き込みデータ < 2 1 : 1 8 >が選択され、 それによつて得られた 4ビットのデータがウェイ履歴比較 データとされる。  Also, in the second embodiment, the value of the access address 17:14> used as the write data of the hitway history is changed according to the environment and the application to be used and the program to be executed. It may be configured to change to a value other than 4>. In this case, the accuracy of way prediction can be improved. For example, when the access address 17:14> in FIG. 7 is changed to the access address <21: 4>, the history data selection signal (not shown) causes the history write data 17: 14> or history write data <21: 18> is selected, and the 4-bit data obtained by that is used as way history comparison data.
また、 ヒットゥエイ履歴データ格納部 1 5 0にヒットゥエイ履歴書き込みデー タを書き込む場合には、 履歴データ選択信号によって、 アクセスァドレス < 2 1 : 1 8 >またはアクセスァドレスく 1 7 : 1 4 >を選択し、 選択されたアクセス アドレスがヒットウェイ履歴書き込みデータとされる。 この場合、 選択されたヒ ットウェイ履歴書き込みデータは、 ヒットウエイ履歴書き込みデータとされる。 このように、 履歴データ選択信号を切り替えることにより、 ヒットウェイ履歴 データの値を任意に変更することができ、 システムの状況や、 環境、 プログラム に合つたウェイの予測が可能となる。 When writing hit history log data to hit history log storage section 150, access address <21:18> or access address 17:14> is selected by the history data selection signal. The selected access address is used as hitway history write data. In this case, the selected hitway history write data is hitway history write data. By switching the history data selection signal in this way, the value of hitway history data can be changed arbitrarily, and the system status, environment, program Can be predicted.
以上本発明にかかる実施の形態 1および 2について図面を参照して詳述してき たが、 具体的な構成例はこれら実施の形態 1および 2に限られるものではなく、 本発明の要旨を逸脱しない範囲の設計変更等があっても本発明に含まれる。 以上説明したように、 本発明によれば、 過去におけるメモリアクセスで複数の ウェイの中から選択されたウェイおよびァドレスに対応するヒットウエイ履歴デ ータを格納し、 メモリアクセス時のアドレスをキーとして、 ウェイを検索し、 該 ウェイを予測ウェイとして予測した後、 予測ウェイに対応するデータをキヤッシ ュメモリから読み出すこととしたので、 従来に比して、 データの読み出しにかか るウェイの決定が早くなり、 高速化を図ることができるという効果を奏する。 産業上の利用可能性  Although the first and second embodiments according to the present invention have been described in detail with reference to the drawings, specific configuration examples are not limited to the first and second embodiments and do not depart from the gist of the present invention. Even a change in the design of the range is included in the present invention. As described above, according to the present invention, hitway history data corresponding to a way and an address selected from a plurality of ways in a past memory access is stored, and the address at the time of the memory access is used as a key. Since the way is searched, the way is predicted as the predicted way, and the data corresponding to the predicted way is read from the cache memory, the way to read the data is determined earlier than in the past. This has the effect of increasing the speed. Industrial applicability
以上のように、 本発明にかかるキャッシュメモリ装置おょぴキャッシュメモリ 制御方法は、 キャッシュメモリのアクセス制御に対して有用である。  As described above, the cache memory device and cache memory control method according to the present invention is useful for cache memory access control.

Claims

請 求 の 範 囲 The scope of the claims
1 . 複数のゥヱイを有するセットァソシァティブ方式が採られたキヤッシュメ モリと、 1. A cache memory employing a set associative method having a plurality of bays,
過去におけるメモリアクセスで複数のウェイの中から選択されたウェイおよび ァドレスに対応するヒットウエイ履歴データを格納するヒットウェイ履歴データ 格納手段と、  Hitway history data storage means for storing hitway history data corresponding to a way and an address selected from a plurality of ways in a memory access in the past;
メモリアクセス時のァドレスをキーとして、 前記ヒットウエイ履歴データから ウェイを検索し、 該ウェイを予測ウェイとする予測手段と、  Prediction means for searching a way from the hitway history data using an address at the time of memory access as a key, and using the way as a prediction way;
前記予測ウェイに対応するデータを前記キヤッシュメモリから読み出す読出手 段と、  Reading means for reading data corresponding to the predicted way from the cache memory;
を備えたことを特徴とするキヤッシュメモリ装置。  A cache memory device comprising:
2 . 前記ヒットウェイ履歴データ格納手段は、 前記ヒットウェイ履歴データを ゥヱイ毎に分けて格納することを特徴とする請求の範囲第 1項に記載のキヤッシ ュメモリ装置。 2. The cache memory device according to claim 1, wherein said hitway history data storage means stores said hitway history data separately for each layer.
3 . 前記予測手段は、 前記ヒットウエイ履歴データ格納手段で複数のウェイが 検索されるというマルチヒットの場合、 番号が若いウェイを前記予測ウェイとす ることを特徴とする請求の範囲第 1項または第 2項に記載のキャッシュメモリ装 置。 3. The prediction means according to claim 1, wherein in the case of a multi-hit in which a plurality of ways are searched in the hitway history data storage means, a way with a smaller number is set as the prediction way. Or the cache memory device described in paragraph 2.
4 . 前記予測手段は、 前記ヒットウエイ履歴データ格納手段から複数のウェイ が検索されるというマルチヒットの場合、 ランダムに選択された一つのウェイを 前記予測ウェイとすることを特徴とする請求の範囲第 1項または第 2項に記載の キャッシュメモリ装置。 4. In the case of a multi-hit in which a plurality of ways are retrieved from the hitway history data storage means, the prediction means sets one randomly selected way as the prediction way. 3. The cache memory device according to paragraph 1 or 2.
5 . 前記予測手段は、 前記ヒットウエイ履歴データ格納手段から複数のウェイ が検索されるというマルチヒットの場合、 格納が最新のウェイを前記予測ウェイ とすることを特徴とする請求の範囲第 1項または第 2項に記載のキヤッシュメモ ジ装置。 5. The multi-hit in which a plurality of ways are retrieved from the hitway history data storage means, wherein the prediction means sets the way stored latest as the prediction way. Or the cache memory device according to paragraph 2.
6 . 前記予測ウェイの妥当性を検証し、 当該予測ウェイの予測が外れていた場 合、 当該予測ウェイに対応するデータを無効とする予測検証手段を備えたことを 特徴とする請求の範囲第 1項または第 2項に記載のキャッシュメモリ装置。 6. A prediction verification means for verifying the validity of the prediction way and invalidating data corresponding to the prediction way when the prediction of the prediction way is incorrect. Item 3. The cache memory device according to item 1 or 2.
7 . 前記ヒットウェイ履歴データは、 任意の値に設定され、 前記予測手段は、 前記ヒットウェイ履歴データ格納手段に格納されたヒットウエイ履歴データのう ち所望の値を選択することを特徴とする請求の範囲第 1項または第 2項に記載の キャッシュメモリ装置。 7. The hitway history data is set to an arbitrary value, and the prediction means selects a desired value from the hitway history data stored in the hitway history data storage means. 3. The cache memory device according to claim 1 or 2.
8 . 複数のウェイを有するセットァソシァティブ方式が採られたキャッシュメ モリへのアクセス制御を行うキャッシュメモリ制御方法であって、 8. A cache memory control method for controlling access to a cache memory employing a set associative method having a plurality of ways,
過去におけるメモリアクセスで複数のウェイの中から選択されたウェイおょぴ ァドレスに対応するヒットゥエイ履歴データを格納するヒットウエイ履歴データ 格納工程と、  A hitway history data storage step of storing hitway history data corresponding to a way address selected from a plurality of ways in a memory access in the past;
メモリアクセス時のアドレスをキーとして、 前記ヒットウェイ履歴データから ウェイを検索し、 該ウェイを予測ウェイとする予測工程と、  A prediction step of searching for a way from the hit way history data using an address at the time of memory access as a key, and setting the way as a prediction way;
前記予測ウェイに対応するデータを前記キヤッシュメモリから読み出す読出ェ 程と、  A reading step of reading data corresponding to the predicted way from the cache memory;
を含むことを特徴とするキャッシュメモリ制御方法。  A cache memory control method comprising:
9 . 前記ヒットウェイ履歴データ格納工程では、 前記ヒットウェイ履歴データ をゥ: ィ毎に分けて格納することを特徴とする請求の範囲第 8項に記載のキヤッ シュメモリ制御方法。 9. The cache according to claim 8, wherein in the hitway history data storing step, the hitway history data is stored separately for each key. Memory control method.
1 0 . 前記予測工程では、 前記ヒットウエイ履歴データ格納工程で複数のゥェ ィが検索されるというマルチヒットの場合、 番号が若いウェイを前記予測ウェイ とすることを特徴とする請求の範囲第 8項または第 9項に記載のキヤッシュメモ リ制御方法。 10. In the prediction step, in the case of a multi-hit in which a plurality of ways are searched in the hitway history data storage step, a way having a smaller number is set as the prediction way. A cache memory control method according to paragraph 8 or 9.
1 1 · 前記予測工程では、 前記ヒットウェイ履歴データ格納工程から複数のゥ エイが検索されるというマルチヒットの場合、 ランダムに選択された一つのゥェ ィを前記予測ゥヱイとすることを特徴とする請求の範囲第 8項または第 9項に記 載のキャッシュメモリ制御方法。 In the prediction step, in the case of a multi-hit in which a plurality of pairs are searched from the hitway history data storage step, one randomly selected phase is set as the prediction layer. The cache memory control method according to claim 8 or 9, wherein
1 2 . 前記予測工程では、 前記ヒットウエイ履歴データ格納工程から複数のゥ エイが検索されるというマルチヒットの場合、 格納が最新のウェイを前記予測ゥ エイとすることを特徴とする請求の範囲第 8項または第 9項に記載のキャッシュ メモリ制御方法。 12. In the prediction step, in the case of a multi-hit in which a plurality of layers are searched from the hitway history data storage step, a way whose storage is latest is set as the prediction layer. 10. The cache memory control method according to item 8 or 9.
1 3 . 前記予測ウェイの妥当性を検証し、 当該予測ウェイの予測が外れていた 場合、 当該予測ウェイに対応するデータを無効とする予測検証工程を含むことを 特徴とする請求の範囲第 8項または第 9項に記載のキヤッシュメモリ制御方法。 13. A prediction verification step of verifying the validity of the prediction way and, if the prediction of the prediction way is incorrect, including a prediction verification step of invalidating data corresponding to the prediction way. 10. The cache memory control method according to item 9 or.
PCT/JP2003/009237 2003-07-22 2003-07-22 Cache memory device and cache memory control method WO2005008501A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/009237 WO2005008501A1 (en) 2003-07-22 2003-07-22 Cache memory device and cache memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/009237 WO2005008501A1 (en) 2003-07-22 2003-07-22 Cache memory device and cache memory control method

Publications (1)

Publication Number Publication Date
WO2005008501A1 true WO2005008501A1 (en) 2005-01-27

Family

ID=34074127

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/009237 WO2005008501A1 (en) 2003-07-22 2003-07-22 Cache memory device and cache memory control method

Country Status (1)

Country Link
WO (1) WO2005008501A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59218690A (en) * 1983-05-27 1984-12-08 Hitachi Ltd Buffer memory
EP0581425A1 (en) * 1992-06-30 1994-02-02 Sun Microsystems, Inc. Rapid data retrieval from data storage structures using prior access predictive annotations
JPH10320275A (en) * 1997-05-14 1998-12-04 Toshiba Corp Cache memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59218690A (en) * 1983-05-27 1984-12-08 Hitachi Ltd Buffer memory
EP0581425A1 (en) * 1992-06-30 1994-02-02 Sun Microsystems, Inc. Rapid data retrieval from data storage structures using prior access predictive annotations
JPH10320275A (en) * 1997-05-14 1998-12-04 Toshiba Corp Cache memory

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Batson B. et al, "Reactive-Associative Caches", Proceedings of International Conference on Parallel Architectures and Compilation Techniques 2001, 08 September, 2001, pages 49 - 60 *
Nicolaescu D. et al. "Reducing Power Consumption for High-Associativity Data Caches in Embedded Processors, Proceedings of Conference and Exhibition on Design", Automation and Test in Europe 2003 (DATE'03), 03 MArch, 2003, pages 1064 - 1068 *

Similar Documents

Publication Publication Date Title
US4980823A (en) Sequential prefetching with deconfirmation
US7089370B2 (en) Apparatus and method for pre-fetching page data using segment table data
US5689679A (en) Memory system and method for selective multi-level caching using a cache level code
JP2557174B2 (en) Data set position predictor
US5465342A (en) Dynamically adaptive set associativity for cache memories
US5148538A (en) Translation look ahead based cache access
US7099999B2 (en) Apparatus and method for pre-fetching data to cached memory using persistent historical page table data
US6216206B1 (en) Trace victim cache
US4980816A (en) Translation look-aside buffer control system with multiple prioritized buffers
KR102421311B1 (en) Storage circuit responding to tag matching commands
US8499123B1 (en) Multi-stage pipeline for cache access
KR100335672B1 (en) Fast data retrieval from physical addressing data storage structures using memory page crossing prediction comments
JPH0619793A (en) History table of virtual address conversion estimation for cache access
JPH07295886A (en) Computer system with hierarchical memory and hierachical memory and hierarchical memory management method
US7039768B2 (en) Cache predictor for simultaneous multi-threaded processor system supporting multiple transactions
US6745291B1 (en) High speed LRU line replacement system for cache memories
US6898671B2 (en) Data processor for reducing set-associative cache energy via selective way prediction
US20080301372A1 (en) Memory access control apparatus and memory access control method
CN109074313B (en) Caching and method
JP2007156821A (en) Cache system and shared secondary cache
JP4009306B2 (en) Cache memory and control method thereof
JP2004151962A (en) Cache memory, processor, and cache control method
EP2866148B1 (en) Storage system having tag storage device with multiple tag entries associated with same data storage line for data recycling and related tag storage device
US5555379A (en) Cache controller index address generator
US5581730A (en) Condition detector and prioritizer with associativity determination logic

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP US

NENP Non-entry into the national phase

Ref country code: JP

WWW Wipo information: withdrawn in national office

Country of ref document: JP