WO2004046933A1 - Memory controller and cache replacement control method - Google Patents

Memory controller and cache replacement control method Download PDF

Info

Publication number
WO2004046933A1
WO2004046933A1 PCT/JP2002/012137 JP0212137W WO2004046933A1 WO 2004046933 A1 WO2004046933 A1 WO 2004046933A1 JP 0212137 W JP0212137 W JP 0212137W WO 2004046933 A1 WO2004046933 A1 WO 2004046933A1
Authority
WO
WIPO (PCT)
Prior art keywords
way
request
replacement
cache
hit
Prior art date
Application number
PCT/JP2002/012137
Other languages
French (fr)
Japanese (ja)
Inventor
Manabu Nakao
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 JP2004553121A priority Critical patent/JP3940148B2/en
Priority to PCT/JP2002/012137 priority patent/WO2004046933A1/en
Publication of WO2004046933A1 publication Critical patent/WO2004046933A1/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/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/123Replacement control using replacement algorithms with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list

Definitions

  • the present invention relates to a memory control device and a cache replacement control method, and more particularly, to a memory control device and a cache replacement control method capable of coping with a plurality of simultaneous accesses and improving a cache performance while reducing a mounting area. It is. Background art
  • FIG. 8 is a block diagram showing a configuration of a conventional cache memory device 20.
  • the cache memory device 20 shown in this figure is a device provided with a cache memory in order to fill a speed difference between a CPU (Central Processing Unit) 10 and a main storage device 30.
  • This cache memory includes a cache tag RAM (Random Access Memory) 22 and a cache data RAM 23 described later.
  • the CPU 10 issues a request for reading or writing data to the cache memory device 20 and reads / writes data from the cache memory or the main storage device 30.
  • the main storage device 30 has a characteristic that it has a large capacity and an access time is slower than that of the cache memory (the cache tag RAM 22 and the cache data RAM 23).
  • the main storage device 30 stores all data used by the CPU 10.
  • the cache memory (the cache tag RAM 22 and the cache data RAM 23) stores a part (frequently used data) of all the data stored in the main storage device 30.
  • the cache memory is, for example, an SRAM (Static Random Access Memory). If the access time is shorter than that of the main storage device 30, It has such characteristics.
  • the storage capacity of the cache memory is smaller than that of the main storage device 30.
  • a set associative method is adopted as a data storage method.
  • the cache memory (cache tag; AM22 and cache data RAM23) is divided into a plurality of ways (way 0 and way 1), and each way is Is a method in which data is stored in a determined line.
  • the address a is stored in the line N of the way 0, and the address b is stored in the line N of the way 1.
  • data A is stored in line N of way 0
  • data B is stored in line N of way 1.
  • the address “a” corresponds to the data A
  • the address “b” corresponds to the data B on a one-to-one basis.
  • the cache tag unit 21 receives a request (address) from the CPU 10 and includes a cache tag RAM 22 and a hit determination unit 24.
  • the cache tag RAM 22 stores an address (tag) corresponding to data stored in the cache data RAM 23 (see FIG. 9).
  • the hit determination unit 24 compares the address from the CPU 10 with the address of the cache tag RAM22, and if they match, determines the hit determination result as "cache hit”.
  • a “cache hit” means that data corresponding to the address exists in the cache data RAM 23.
  • the hit determination unit 24 determines the hit determination result as "cache miss". In the case of "cache miss", the data corresponding to the address is Flash data RAM23 does not exist.
  • a replace way As an algorithm for selecting a way to be replaced (hereinafter, referred to as a replace way) from a plurality of ways, a way in which the least used data is stored is stored. LRU (Last Recently Used) method is adopted.
  • the hit determination unit 24 notifies the hit determination result to the single port LRU • RAM 26 and the cache data RAM 23.
  • the replace unit 25 has a function of selecting a way to be replaced in the cache data RAM 23 (see FIG. 9) when the hit determination result is “cache miss”. It is composed of a replacement way selection unit 27.
  • the single-port LRU / RAM 26 has one input port, and when replacing data in the cache data RAM 23, stores the replacement way information indicating the replacement way selected by the LRU method described above. Specifically, as shown in FIG. 9, the single-port LRU 'RAM 26 stores replacement way information corresponding to the replacement way number (0) for each line. In the figure, the replacement way information indicating the way 0 as the replacement way is stored in the line N.
  • the data A stored in the way 0 (line N) is the least used data.
  • the LRU replacement way selecting unit 27 is provided with a plurality of memory units in the cache memory (the cache tag RAM 22 and the cache data RAM 23). After referring to the single-port LRU / RAM 26 from among the rays and selecting a replacement way by the LRU method, an LRU replacement request (including an address) is issued to the main storage device 30.
  • the main storage device 30 reads data from an address corresponding to the LRU replacement request, stores the data in a replacement way (line) of the cache data RAM 23, and executes a replacement process.
  • step SA1 the hit determination unit 24 determines whether or not there is a request from the CPU 10 (conventionally, a data read is explained as an example). In this case, the determination result is “No”, and the determination is made. repeat.
  • step S A2 the hit judging unit 24 accesses the cache tag RAM 22 and compares the address from the CPU 10 with the address of the cache tag RAM 22 to make a hit judgment.
  • step SA3 the hit determination unit 24 determines whether or not a cache hit has occurred. If the determination result in step SA3 is “Yes”, that is, if the hit determination result is “cache hit”, data is transferred from the cache data RAM 23 to the CPU 10 in step SA4.
  • step SA3 determines whether the result of the determination in step SA3 is “No”, that is, if the result of the hit determination is “cache miss”, in step SA5, the hit determination unit 24 replaces the replacement unit 25 (single-port LRU RAM26 ) And the cache data RAM 23 are notified of the hit determination result (“cache miss”).
  • step SA 6 the LRU replacement way selection unit 27 receives the hit determination result (“cache miss”), refers to the single-port LRU * RAM 26, and replaces the replacement data in the cache data RAM 23 based on the LRU method described above. Select
  • step SA7 the LRU replacement way selection unit 27 issues an LRU replacement request (including an address) corresponding to the replacement way selected in step S A6 to the main storage device 30.
  • step S A8 the main storage device 30 receives the LRU replacement request and reads data from the address.
  • step SA9 the main storage device 30 transfers the read data to the cache data RAM 23.
  • step SA10 a replacement process is performed in which data is stored (replaced) in the rib raceway (line) selected by the LRU replacement way selection unit 27.
  • step SA4 the data is transferred from the cache data RAM 23 to the CPU 10.
  • FIG. 11 is a block diagram showing a configuration of a conventional cache memory device 40 provided with the above-described multi-port LRU / RAM.
  • parts corresponding to the respective parts in FIG. 8 are denoted by the same reference numerals.
  • a cache memory device 40 is provided instead of the cache memory device 20 shown in FIG.
  • the cache memory device 40 instead of the cache tag unit 21 and the replacement unit 25 shown in FIG.
  • a cache tag section 41 and a replacement section 43 are provided.
  • the cache tag unit 41 can receive a plurality of requests (addresses) from the CPU 10, that is, a first request (address) and a second request (address). It consists of a hit decision unit 42.
  • the hit determination unit 42 performs a hit determination by comparing the address corresponding to the first request from the CPU 10 with the address of the cache tag RAM 22, and notifies the first hit determination result.
  • the hit determination unit 42 compares the address corresponding to the second request from the CPU 10 with the address of the cache tag RAM 22, performs a hit determination, and notifies the second hit determination result. .
  • the replace unit 43 selects a way to be replaced in the cache data RAM 23 (see FIG. 9) in parallel when both the first hit determination result and the second hit determination result are “cache miss”. It has a multi-port LRU / RAM 44, a first LRU replacement way selection unit 45, and a second LRU replacement way selection unit 46.
  • the multi-port LRU / RAM 44 has two input ports corresponding to the first hit judgment result (first request) and the second hit judgment result (second request), respectively.
  • the replacement information indicating the replacement way selected by the above-mentioned LRU method is stored.
  • the first LRU replacement way selection unit 45 is provided corresponding to the first hit determination result (cache miss), and selects one of a plurality of ways in the cache memory (cache tag RAM22 and cache data RAM23). After referring to the multiport LRU / RAM 44 and selecting the first replacement way by the LRU method, a first LRU replacement request (including an address) is issued to the main storage device 30.
  • the second LRU replacement way selection unit 46 is provided corresponding to the second hit determination result (cache miss), and selects a plurality of ways in the cache memory (cache tag RAM 22 and cache data RAM 23). After referring to the multiport LRU / RAM 44 and selecting the second replacement way by the LRU method, a second LRU replacement request (including an address) is issued to the main storage device 30.
  • the main storage device 30 reads out the first data and the second data from the addresses corresponding to the first LRU replacement request and the second LRU replacement request, and stores them in the first data of the cache data RAM 23. They are stored in the replacement way (line) and the second replacement way (line), respectively, and the replacement processing is executed in parallel.
  • a multi-port LRU / RAM 44 having two input ports is provided to support a plurality of simultaneous requests from the CPU 10. .
  • the present invention has been made in view of the above, and an object of the present invention is to provide a memory control device and a cache replacement control method capable of coping with a plurality of simultaneous accesses and improving a cache performance while reducing a mounting area. And Disclosure of the invention
  • the present invention relates to a memory control device provided between a higher-level device and a main storage device and configured to control a cache memory having a multi-way configuration.
  • Replacement way information holding means for holding way information;
  • first rib race way selection means for selecting a first way to be replaced based on the replacement way information of the replacement way information holding means.
  • a second replacement way selecting means for selecting a second way to be replaced without using the replacement way information, and a first request for accessing the cache memory issued simultaneously from the host device.
  • the first replacement bay selecting means may correspond to the first request and Arbitration means for selecting the one way and causing the second replacement way selection means to select the second way in response to the second request.
  • the present invention provides a cache replacement device provided between a higher-level device and a main storage device and applied to a cache memory device having a cache memory of a multi-layer configuration. A first replacement way selection step of selecting a first way to be replaced based on replacement way information stored in the replacement way information holding means and related to replacement of the cache memory.
  • the first way is selected according to the first request and
  • the second way to be replaced is selected without using the replacement way information in response to the second request, a single port replacement way information holding means can support multiple simultaneous accesses.
  • the cache performance can be improved while reducing the mounting area.
  • FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention.
  • FIG. 2 is a diagram for explaining the operation of the replacement unit 103 shown in FIG.
  • FIG. 4 is a flowchart for explaining the operation of the first embodiment.
  • FIG. 4 is a block diagram showing the configuration of the second embodiment according to the present invention.
  • FIG. FIG. 6 is a diagram for explaining the operation of the replacement unit 201
  • FIG. 6 is a diagram for explaining the operation of the hit state determination unit 202 shown in FIG. 4
  • FIG. 8 is a flowchart for explaining the operation of the second embodiment.
  • FIG. 8 shows a conventional cache memory device 20.
  • FIG. 8 shows a conventional cache memory device 20.
  • FIG. 9 is a block diagram showing the configuration of the cache tag RAM22, cache data RAM23 and single-port LRU / RAM26 shown in FIG. 8, and FIG. 10 is a block diagram showing the configuration of FIG. Is a flowchart for explaining the operation of the cache memory device 20 shown in FIG. 1, and FIG. 11 is a block diagram showing a configuration of a conventional cache memory device 40.
  • FIG. 1 is a block diagram showing a configuration of a first embodiment according to the present invention.
  • the same reference numerals are given to parts corresponding to the respective parts in FIG.
  • a cache memory device 100 is provided instead of the cache memory device 20 shown in FIG.
  • a cache tag unit 101 and a replacement unit 103 are provided instead of the cache tag unit 21 and the replacement unit 25 shown in FIG.
  • the cache tag unit 101 is capable of receiving a plurality of requests (addresses) from the CPU 10, that is, a first request (address) and a second request (address). It consists of 02.
  • the CPU 10 may issue the first request and the second request at the same time, or may issue the first request (or the second request) alone.
  • the hit determination unit 102 performs a hit determination by comparing an address corresponding to the first request from the CPU 10 with the address of the cache tag RAM 22, and notifies the first hit determination result. Also, the hit determination unit 102 compares the address corresponding to the second request from the CPU 10 with the address of the cache tag RAM 22, performs a hit determination, and notifies the second hit determination result. .
  • the replacement unit 103 determines a way to be replaced in the cache data RAM 23 (see FIG. 9) according to the first request from the CPU 10 and the presence or absence of the second request. It has a function to select by LRU method (LRU method, random method).
  • the LRU method is a method of selecting a way in which the least used data is stored from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23). is there.
  • the random method is a method of randomly selecting a way from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23).
  • the replacement unit 103 includes a single-port LRU / RAM 26 (see FIG. 9), an arbitration unit 104, a random replacement way selection unit 105, and an LRU replacement way selection unit 27.
  • the single-port LRU.RAM26 (see Fig. 9) has one input port, and when replacing data in the cache data RAM 23, the replacement way selected by the LRU method is used. Replacement information to be stored is stored.
  • the arbitration unit 104 arbitrates the processing of the first request and the processing of the second request according to the presence or absence of the first request and the second request from the CPU 10, as shown in FIG.
  • the arbitration unit 104 processes the first request by the LRU method
  • the first hit judgment result is passed to the single-port LRU ⁇ RAM26 in order to perform this.
  • the arbitration unit 104 converts the second request by the LRU method.
  • the second hit determination result is passed to the single-port LRU-RAM 26 for processing.
  • the arbitration unit 104 should process the first request by the LRU method, pass the first hit determination result to the single-port LRURAM26, and process the second request by the random method. Hand over to random replacer selection unit 105.
  • the LRU replacement way selection unit 27 refers to the single-port LRU / RAM 26 from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23), selects a replacement layer by the LRU method, A replacement request (including an address) is issued to the main storage device 30.
  • the random replacement way selection unit 105 selects a replacement way from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23) in a random manner, and then stores a replacement request (including an address) in a main memory. Take out to device 30.
  • the main storage device 30 reads out the first data and the second data from the addresses corresponding to the two replacement requests, stores them in each of the replacement ways (lines) of the cache data RAM 23, and performs the replacement process. Execute
  • step SB1 the hit determination unit 102 determines whether or not there is a request from the CPU 10 (in the first embodiment, a case of reading data is described as an example), and in this case, the determination result is “ The judgment is repeated as "No.” Then, when there is a first request and a second request from the CPU 10 simultaneously, the hit determination unit 102 sets the determination result of step SB1 to "Yes". In step SB 2, the hit determination unit 102 accesses the cache tag RAM 22, compares each address from the CPU 10 with the address of the cache tag RAM 22, and performs the first request and the second request Hit judgment is performed for each of the above.
  • step SB3 the hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB 3 is “Yes”, that is, if the hit determination results are each “cache hit”, in step SB 4, the first data and the second data Data is transferred.
  • first hit determination result (cache hit) and the second hit determination result (cache hit) are notified from the hit determination unit 102 to the cache data RAM 23, they are stored in the corresponding address of the cache data RAM 23.
  • the first data and the second data are read, and the first data and the second data are transferred to the CPU 10.
  • step SB 5 the hit determination unit 102 sends the first hit determination result to the arbitration unit 104 of the replacement unit 103. (“Cache miss”) and the second hit determination result (“cache miss”).
  • step SB6 the arbitration unit 104 determines whether or not there is a power having a plurality of simultaneous cache misses based on the notified first hit determination result and the second hit determination result. Let the result be "Yes".
  • Step SB7 to Step SB12 and Step SB13 to Step SB18 are executed in parallel.
  • step SB7 the arbitration unit 104 notifies the single-port LRU 'RAM 26 of the first hit determination result ("cache miss").
  • step SB8 the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select the replacement way in.
  • step SB9 the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB8.
  • step SB10 the main storage device 30 reads the first data from the address in response to the replacement request.
  • step SB11 the main storage device 30 transfers the read first data to the cache data RAM 23.
  • step SB12 a rib race process is executed in which the first data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
  • step SB13 the arbitration unit 104 notifies the random replacement way selection unit 105 of the second hit determination result (“cache miss”).
  • step SB14 upon receiving the second hit determination result (“cache miss”), the random replacement way selection unit 105 selects a replacement way in the cache data RAM 23 based on the random method described above.
  • step SB15 the random replacement way selection unit 105 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB14.
  • step SB16 the main storage device 30 receives the replacement request and reads the second data from the address.
  • step SB17 the main storage device 30 transfers the read second data to the cache data RAM23.
  • step SB18 a replacement process is executed in which data is stored (replaced) in the replacement way (line) selected by the random replacement way selection unit 105.
  • step SB4 the first data and the second data are transferred from the cache data RAM 23 to the CPU 10.
  • step SB2 the hit determination unit 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and performs a hit determination on the first request.
  • step SB3 the hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB3 is "Yes”, that is, if the hit determination result is "cache hit”, data is transferred from the cache data RAM 23 to the CPU 10 in step SB4.
  • the first hit determination result (cache hit) is notified from the hit determination unit 102 to the cache data RAM 23, the first data stored in the address of the cache data RAM 23 is read, and the first data is read. Is transferred to the CPU 10.
  • step SB 5 the hit determination unit 102 sends the first hit determination result to the arbitration unit 104 of the replacement unit 103. (“Cache miss”).
  • step SB6 the arbitration unit 104 determines whether or not there is simultaneous multiple cache misses based on the notified first hit determination result. In this case, the determination result is “NoJ”.
  • step SB7 the arbitration unit 104 notifies the single port LRU • RAM 26 of the first hit determination result (“cache miss”).
  • step SB8 the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU ⁇ RAM 26, and based on the LRU method described above, Select a replacement way.
  • step SB9 the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB8.
  • step SB10 the main storage device 30 reads the first data from the address in response to the replacement request.
  • step SB11 the main storage device 30 transfers the read first data to the cache data RAM23.
  • step SB12 a rib race process is executed in which the first data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
  • step SB4 the first data is transferred from the cache data RAM 23 to the CPU 10.
  • step SB2 the hit half IJ setting unit 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and performs a hit determination on the second request.
  • step S B3 hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB3 is "Yes”, that is, if the hit determination result is "cache hit”, data is transferred from the cache data RAM 23 to the CPU 10 in step SB4.
  • the hit determination unit 1.02 notifies the cache data RAM 23 of the second hit determination result (cache hit)
  • the second data stored in the cache data RAM 23 at the address is read, and the second data is read. Is transferred to the CPU 10.
  • step SB 5 the hit determination unit 102 The second hit determination result (“cache miss”) is notified to the arbitration unit 104 of 103.
  • step SB6 the arbitration unit 104 determines whether there is a plurality of simultaneous cache misses based on the notified second hit determination result, and in this case, sets the determination result to “No”.
  • step SB7 the arbitrating unit 104 notifies the single-port LRU 'RAM 26 of the second hit determination result ("cache miss").
  • step SB8 the LRU replacement way selection unit 27 receives the second hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select the replacement way in.
  • cache miss refers to the single-port LRU RAM 26, and based on the LRU method described above, Select the replacement way in.
  • step SB9 the LRU replacement way selection unit 27 issues a replacement request corresponding to the replacement way selected in step SB8 to the main storage device 30.
  • the main storage device 30 receives the replacement request and reads the second data from the address.
  • the main storage device 30 transfers the read second data to the cache data RAM23.
  • step SB12 a replacement process is executed in which the second data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
  • step SB4 the second data is transferred from the cache data RAM 23 to the CPU 10.
  • the random replacement way selection unit 105 may be configured to select a replacement way by a random method.
  • the first request is handled.
  • the LRU replacement way selection section 27 selects a way, and in response to the second request, replaces the way to be replaced with a random replacement way without using the replacement way information of the Singno Report LRU RAM 26. Since the selection unit 105 makes the selection, the single port single port LRU / RAM 26 can cope with multiple simultaneous accesses, and the cache performance can be improved while reducing the mounting area.
  • the CPU 10 issues the first request and the second request at the same time, and caches both the first hit determination result and the second hit determination result.
  • a miss an example was described in which the replacement process was executed by the LRU or random method.
  • the replacement process is configured to change based on the hit status (frequent cache hits or cache misses). May be.
  • this configuration example will be described as a second embodiment.
  • FIG. 4 is a block diagram showing a configuration of a second exemplary embodiment of the present invention.
  • parts corresponding to the respective parts in FIG. 1 are denoted by the same reference numerals.
  • a cache memory device 200 is provided in place of the cache memory device 100 shown in FIG.
  • a replacement unit 201 is provided in place of the replacement unit 103 shown in FIG.
  • the replacement unit 201 stores the cache data RAM 23 according to the first request from the CPU 10, the presence or absence of the second request, and the hit state described later. (See Fig. 9) It has a function to select the way to be replaced by a predetermined method (LRU method, random method).
  • a hitch is used in place of the arbitration section 104 shown in FIG.
  • a state determination unit 202 and an arbitration unit 203 are provided.
  • the hit state determination unit 202 receives the hit determination results (the first hit determination result and the second hit determination result) in the hit determination unit 102 and the cache miss by the state transition shown in FIG. Determine if you have a tendency to tend or a cache hit.
  • the hit state determination unit 202 if the hit determination results (the first hit determination result and the second hit determination result) of the hit determination unit 102 are cache hits, the hit state is one. Transition to the right.
  • the hit judgment result (the first hit judgment result and the second hit judgment result) of the hit judging unit 102 is a cache miss, the hit state is shifted left by one.
  • the hit state determination unit 202 shifts the hit state to the right and changes “0 1” to “1”. 0 ”. Subsequently, when the hit determination result is a cache hit, the hit state determination unit 202 shifts the hit state to the right, and changes the state from “10” to “11”.
  • the hit state determination unit 202 shifts the hit state to the left, and changes the state from “1 1” to “10”. Subsequently, when the hit determination result is a cache miss, the hit state determination unit 202 shifts the hit state to the left, and sets the hit state to “10” or “01”.
  • the hit state determination unit 202 determines that the hit determination result is in the ⁇ ! Direction of the cache hit, and sets the hit state as “cache hit”.
  • the arbitration unit 203 is notified.
  • the hit determination result is determined to be a cache miss, and the hit state is notified to the arbitration unit 203 as “cache miss”.
  • the arbitration unit 203 receives the first request from the CPU 10, Arbitration of the processing of the first request and the processing of the second request is performed in accordance with the presence / absence of the second request and the hit state determined by the hit state determination unit 202.
  • the arbitration unit 203 passes the first hit determination result to the single-port LRU * RAM 26 so that the first request is processed by the LRU method.
  • the arbitration unit 203 passes the second hit determination result to the single-port LRU / RAM 26 in order to process the second request using the LRU method.
  • the arbitration unit 203 passes the first hit determination result to the single-port LRU.RAM 26 and processes the second request in order to process the first request by the LRU method. Is passed to the random replacement way selection unit 105 in order to process in a random manner.
  • the way most used is selected as the replacement way, so that the cache hit rate is higher than the random method in which the replacement way is randomly selected.
  • the replacement process is executed at a higher speed by a random method than in the case of an improvement in the cache hit rate.
  • the priority is to bring the data from the main storage device 30 as soon as possible.
  • the arbitration unit 203 sets the arbitration unit 203 to process the first request using the LRU method.
  • the hit state determination unit 202 re-inputs the second request corresponding to the second hit determination result to the cache tag unit 101. Note that the second request is not processed in a random manner.
  • a replacement procedure is executed by the LRU method.
  • the hit state is a cache hit
  • priority is given to improving the cache hit ratio by the LRU method rather than performing the replacement process at a high speed.
  • step SC1 the hit determination unit 102 determines whether or not there is a request from the CPU 10 (in the second embodiment, a case of reading data is described as an example). In this case, the hit determination unit 102 And repeat the same judgment.
  • step SC2 the hit determination unit 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and makes a hit determination for the first request.
  • step SC3 the hit determination unit 102 determines whether or not a cache hit has been made. In this case, the result of the determination is “Yes”.
  • step SC4 the first data is transferred from the cache data RAM 23 to the CPU 10.
  • step SC5 the hit state determination unit 202 updates the hit state based on the first hit determination result (in this case, “cache hit”) corresponding to the first request. For example, when the hit state shown in FIG. 6 is “01”, the hit state determination unit 202 receives the cache hit and changes the hit state from “01” to “10”. As a result, the hit state is set to "cache hit”.
  • the hit determination unit 102 sets the determination result of step S C1 to “Yes”.
  • the hit determination unit 102 accesses the cache tag RAM 22, compares each address from the CPU 10 with the address of the cache tag RAM 22, and performs the first request and the second request. A hit judgment is made for each of.
  • step S C3 the hit determination unit 102 determines whether or not a cache hit has occurred, and in this case, the determination result is “No”.
  • step SC6 the hit determination section 102 notifies the arbitration section 203 of the replacement section 201 of the first hit determination result (“cache miss”) and the second hit determination result (“cache miss”).
  • step SC7 the arbitration unit 203 determines whether there are multiple cache misses at the same time based on the notified first hit determination result and the second hit determination result. Let the result be "Yes".
  • steps SC8 to SC13 and steps SC14 to SC21 are executed in parallel.
  • step SC8 the arbitration unit 203 notifies the single hit report LRU RAM 26 of the first hit determination result (“cache miss”).
  • step SC9 the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select a replacement way.
  • step SC10 the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SC9.
  • step SC11 the main storage device 30 receives the replacement request and reads the first data from the address.
  • step SC12 the main storage device 30 transfers the read first data to the cache data RAM 23.
  • step SC13 a rib race process is executed in which the first data is stored (replaced) in the rib raceway (line) selected by the LRU replacement way selection unit 27.
  • step SC4 the first data is transferred from the cache data RAM 23 to the CPU 10.
  • step SC5 the hit state determination unit 202 determines, based on the first hit determination result and the second hit determination result corresponding to the first request and the second request (for example, both “cache miss”), Update hit status.
  • the hit state shown in FIG. 6 is “10”
  • the hit state determination unit 202 receives the above two cache misses, and changes the hit state from “10” to “01” to “00”. Transition to. As a result, the hit state is “cache miss”.
  • step SC14 the arbitration unit 203 determines whether or not the hit state determined by the hit state determination unit 202 is a cache hit. In this case, the hit state is determined to be a cache hit “10”. Therefore, the judgment result is “Yesj”.
  • step SC21 the arbitration unit 203 re-inputs the second request corresponding to the second hit determination result to the cache tag unit 101.
  • the hit determination unit 102 sets the determination result of step SC1 to “Yes”.
  • step SC2 the hit determination unit 102 sets the cache tag RAM2 2 is accessed, an address from the CPU 10 and the like (in this case, the re-input second request) is compared with the address of the cache tag RAM 22, and hit judgment is performed for the second request.
  • the second hit determination result corresponding to the second request is a cache miss.
  • step SC3 the hit determination unit 102 determines whether or not a cache hit has been made. In this case, the determination result is “No”. In step SC6, the hit determination unit 102 notifies the arbitration unit 203 of the replacement unit 201 of the second hit determination result (“cache miss”).
  • step S C7 the arbitration unit 203 determines whether there are multiple simultaneous cache misses based on the notified second hit determination result, and in this case, sets the determination result to “No”.
  • step SC8 the arbitration unit 203 notifies the single-port LRU / RAM 26 of the second hit determination result (“cache miss”).
  • step SC9 the LRU replacement way selection unit 27 receives the second hit determination result (“cache miss”), refers to the single-port LRU ⁇ RAM 26, and executes the cache data Select the replacement way in RAM23.
  • cache miss the second hit determination result
  • step SC10 the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SC9.
  • step SC11 the main storage device 30 receives the replacement request and reads the second data from the address.
  • step SC12 the main storage device 30 transfers the read second data to the cache data RAM23.
  • step SC13 a rib race process is executed in which the second data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
  • step SC4 the second data is transferred from the cache data RAM 23 to the CPU 10. Data is transferred.
  • step SC5 the hit state determination unit 202 updates the hit state based on the second hit determination result (“cache miss”) corresponding to the second request in the same manner as described above. I do. If the result of the determination in step SC14 is S "No”, the steps SC15 to SC18 are performed in the same manner as in steps SB13 to SB18 (see Fig. 3). 20 is executed.
  • the LRU replacement way selection unit 27 selects the first way, re-inputs the second request to the cache tag unit 101, and the hit determination unit 102 In the case of a replacement, the LRU replacement way selection unit 27 is made to select a way in response to the second request, so priority is given to improving the cache hit rate rather than performing the replacement processing at high speed. Can be done.
  • the first way is selected according to the first request.
  • the second way to be replaced is selected without using the replacement way information in response to the second request. This has the effect of improving the cache performance while reducing the mounting area.
  • the hit judgment is a cache miss and the hit state is a cache hit
  • the first way is selected in response to the first request, and the second request is made. Re-enter, if the hit judgment is a cache miss, let the first way be selected corresponding to the second request Therefore, there is an effect that it is possible to give priority to improving the cache hit rate rather than performing the replacement processing at high speed.
  • the memory control device and the cache replacement control method according to the present invention are useful for replacing a cache memory.

Abstract

A memory controller comprising a single-port LRU RAM (26) holding replacement way information on replacement of a cache memory (a cache tag RAM (22) and a cache data RAM (23)), an LRU replacement way selecting section (27) for selecting a way to be replaced by an LRU algorithm depending on the replacement way information on the single-port LRU RAM (26), a random replacement way selecting section (105) for selecting a way to be replaced randomly without using the replacement way information, a hit decision section (102) for carrying out hit decision about first and second requests simultaneously made for an access to a cache memory by a CPU (10), and an arbiter section (104) for, if the hit decisions about the first and second requests are both cache misses, allowing the LRU replacement way selecting section (27) to select a way in response to the first request and allowing the random replacement way selecting section (105) to select a way in response to the second request.

Description

明 細 書 メモリ制御装置およびキヤッシュリプレース制御方法 技術分野  Description Memory control device and cache replacement control method
本発明は、 メモリ制御装置およびキヤッシュリプレース制御方法に関するもの であり、 特に、 複数同時アクセスに対応でき、 実装面積を削減しつつキャッシュ 性能を向上させることができるメモリ制御装置およびキャッシュリプレース制御 方法に関するものである。 背景技術  The present invention relates to a memory control device and a cache replacement control method, and more particularly, to a memory control device and a cache replacement control method capable of coping with a plurality of simultaneous accesses and improving a cache performance while reducing a mounting area. It is. Background art
第 8図は、 従来のキャッシュメモリ装置 20の構成を示すブロック図である。 この図に示したキャッシュメモリ装置 20は、 CPU (Central Processing Unit) 10と主記憶装置 30との間の速度差を埋めるために、 キャッシュメモリを備え た装置である。このキャッシュメモリは、後述するキャッシュタグ RAM (Random Access Memory) 22およびキャッシュデータ RAM 23から構成されている。  FIG. 8 is a block diagram showing a configuration of a conventional cache memory device 20. The cache memory device 20 shown in this figure is a device provided with a cache memory in order to fill a speed difference between a CPU (Central Processing Unit) 10 and a main storage device 30. This cache memory includes a cache tag RAM (Random Access Memory) 22 and a cache data RAM 23 described later.
CPU 10は、 キャッシュメモリ装置 20に対して、 データのリードまたはラ ィ トに関するリクエストを出し、 キャッシュメモリまたは主記憶装置 30からデ ータのリード/ライトを行う。  The CPU 10 issues a request for reading or writing data to the cache memory device 20 and reads / writes data from the cache memory or the main storage device 30.
主記憶装置 30は、 大容量であってかつアクセス時間がキャッシュメモリ (キ ャッシュタグ RAM22およびキャッシュデータ RAM23) に比して遅いとい う特性を備えている。 この主記憶装置 30には、 CPU 10で用いられるデータ の全てが記憶されている。  The main storage device 30 has a characteristic that it has a large capacity and an access time is slower than that of the cache memory (the cache tag RAM 22 and the cache data RAM 23). The main storage device 30 stores all data used by the CPU 10.
キャッシュメモリ (キャッシュタグ RAM 22およびキャッシュデータ RAM 23) は、 主記憶装置 30に記憶されている全データのうち、 一部 (頻繁に使用 されるデータ) を記憶している。 キャッシュメモリは、例えば、 SRAM (Static Random Access Memory) であり、 アクセス時間が主記憶装置 30に比して短いと いう特性を備えている。 The cache memory (the cache tag RAM 22 and the cache data RAM 23) stores a part (frequently used data) of all the data stored in the main storage device 30. The cache memory is, for example, an SRAM (Static Random Access Memory). If the access time is shorter than that of the main storage device 30, It has such characteristics.
さらに、 記憶容量の面から見れば、 主記憶装置 30よりもキャッシュメモリの 記憶容量が小さい。  Further, from the viewpoint of storage capacity, the storage capacity of the cache memory is smaller than that of the main storage device 30.
ここで、 キャッシュメモリ装置 20においては、 データ格納方式として、 セッ トァソシァティブ方式が採用されている。 このセットァソシァティブ方式は、 第 9図に示したようにキャッシュメモリ (キャッシュタグ; AM 22およびキヤッ シュデータ RAM23) を複数のウェイ (ウェイ 0およびウェイ 1) に分割して おき、 各ウェイにおける決められたラインにデータが格納される方式である。 同図に示したキャッシュタグ RAM22においては、 例えば、 ウェイ 0のライ ン Nにア ドレス aが格納されており、 ウェイ 1のライン Nにアドレス bが格納さ れている。  Here, in the cache memory device 20, a set associative method is adopted as a data storage method. In this set-associative method, as shown in Fig. 9, the cache memory (cache tag; AM22 and cache data RAM23) is divided into a plurality of ways (way 0 and way 1), and each way is Is a method in which data is stored in a determined line. In the cache tag RAM 22 shown in the figure, for example, the address a is stored in the line N of the way 0, and the address b is stored in the line N of the way 1.
また、 キャッシュデータ RAM23においては、 例えば、 ウェイ 0のライン N にデータ Aが格納されており、ウェイ 1のライン Nにデータ Bが格納されている。 キャッシュタグ RAM22およびキャッシュデータ RAM23においては、 ァド レス aとデータ Aとが、 アドレス bとデータ Bとがそれぞれ一対一で対応してい る。  In the cache data RAM 23, for example, data A is stored in line N of way 0, and data B is stored in line N of way 1. In the cache tag RAM 22 and the cache data RAM 23, the address “a” corresponds to the data A, and the address “b” corresponds to the data B on a one-to-one basis.
第 8図に戻り、 キャッシュタグ部 21は、 CPU 10からのリクエスト (アド レス) を受付け、 キャッシュタグ RAM 22およびヒッ ト判定部 24から構成さ れている。 キャッシュタグ RAM22は、 キャッシュデータ RAM23 (第 9図 参照) に格納されているデータに対応するアドレス (タグ) を格納している。 ヒット判定部 24は、 CPU10からのアドレスと、 キャッシュタグ RAM2 2のアドレスとを比較し、 両者が一致した場合、 ヒット判定結果を 「キャッシュ ヒット」 とする。 「キャッシュヒット」 の には、 当該アドレスに対応するデ ータがキャッシュデータ RAM 23に存在することを意味している。  Returning to FIG. 8, the cache tag unit 21 receives a request (address) from the CPU 10 and includes a cache tag RAM 22 and a hit determination unit 24. The cache tag RAM 22 stores an address (tag) corresponding to data stored in the cache data RAM 23 (see FIG. 9). The hit determination unit 24 compares the address from the CPU 10 with the address of the cache tag RAM22, and if they match, determines the hit determination result as "cache hit". A “cache hit” means that data corresponding to the address exists in the cache data RAM 23.
—方、 CPU 10からのアドレスと、 キャッシュタグ RAM 22のアドレスと が不一致である場合、 ヒット判定部 24は、 ヒット判定結果を 「キヤッシュミス」 とする。 「キャッシュミス」 の場合には、 当該アドレスに対応するデータがキヤ ッシュデータ RAM23に存在しないことを意味している。 On the other hand, if the address from the CPU 10 does not match the address of the cache tag RAM 22, the hit determination unit 24 determines the hit determination result as "cache miss". In the case of "cache miss", the data corresponding to the address is Flash data RAM23 does not exist.
「キャッシュミス J の場合には、 主記憶装置 30から当該アドレスに対応する データが読み出され、キャッシュデータ R AM 23で当該データがリプレース(書 き換え) された後、 CPU10へ渡される。 ここで、 リプレースする場合には、 キャッシュデータ RAM 23においてあるウェイのデータを追い出す必要がある。 そして、 上記ウェイに主記憶装置 30からのデータが格納される。  "In the case of a cache miss J, the data corresponding to the address is read from the main storage device 30, the data is replaced (rewritten) by the cache data RAM 23, and then passed to the CPU 10. In order to replace the data, it is necessary to flush data of a certain way in the cache data RAM 23. Then, data from the main storage device 30 is stored in the way.
ここで、 従来のキャッシュメモリ装置 20において、 複数のウェイの中から、 リプレース対象のウェイ (以下、 リプレースウェイと称する) を選択するァルゴ リズムとしては、 最も使用されていなかったデータが格納されたウェイを選択す るという LRU (Last Recently Used) 方式が採用されている。  Here, in the conventional cache memory device 20, as an algorithm for selecting a way to be replaced (hereinafter, referred to as a replace way) from a plurality of ways, a way in which the least used data is stored is stored. LRU (Last Recently Used) method is adopted.
また、 ヒット判定部 24は、 ヒット判定結果をシングルポート L RU · R AM 26およびキャッシュデータ RAM 23へ通知する。  The hit determination unit 24 notifies the hit determination result to the single port LRU • RAM 26 and the cache data RAM 23.
リプレース部 25は、 ヒット判定結果が 「キャッシュミス」 である場合に、 キ ャッシュデータ RAM 23 (第 9図参照) でリプレースすべきウェイを選択する 機能を備えており、 シングルポート LRU · RAM 26および LRUリプレース ウェイ選択部 27から構成されている。  The replace unit 25 has a function of selecting a way to be replaced in the cache data RAM 23 (see FIG. 9) when the hit determination result is “cache miss”. It is composed of a replacement way selection unit 27.
シングルポート LRU · RAM26は、 一つの入力ポートを備えており、 キヤ ッシュデータ RAM 23でデータをリプレースする場合に、 前述した LRU方式 により選択されたリプレースウェイを表すリプレースウェイ情報を格納している。 具体的には、第 9図に示したように、シングルポート LRU 'RAM 26には、 ライン毎にリプレースウェイの番号 (0) に対応するリプレースウェイ情報が格 納されている。 同図では、 ライン Nには、 リプレースウェイとしてのウェイ 0を 表すリプレースウェイ情報が格納されている。  The single-port LRU / RAM 26 has one input port, and when replacing data in the cache data RAM 23, stores the replacement way information indicating the replacement way selected by the LRU method described above. Specifically, as shown in FIG. 9, the single-port LRU 'RAM 26 stores replacement way information corresponding to the replacement way number (0) for each line. In the figure, the replacement way information indicating the way 0 as the replacement way is stored in the line N.
つまり、 キャッシュデータ RAM 23においては、 ウェイ 0 (ライン N) に格 納されているデータ Aが、 最も使用されていなかったデータである。  That is, in the cache data RAM 23, the data A stored in the way 0 (line N) is the least used data.
第 8図に戻り、 LRUリプレースウェイ選択部 27は、 キャッシュメモリ (キ ャッシュタグ RAM22およびキャッシュデータ RAM23) における複数のゥ エイの中から、 シングルポート LRU · RAM26を参照して、 LRU方式によ りリプレースウェイを選択した後、 LRUリプレース要求 (アドレスを含む) を 主記憶装置 30へ出す。 Returning to FIG. 8, the LRU replacement way selecting unit 27 is provided with a plurality of memory units in the cache memory (the cache tag RAM 22 and the cache data RAM 23). After referring to the single-port LRU / RAM 26 from among the rays and selecting a replacement way by the LRU method, an LRU replacement request (including an address) is issued to the main storage device 30.
主記憶装置 30は、 上記 LRUリプレース要求に対応するァドレスからデータ を読み出し、 これをキャッシュデータ RAM23のリプレースウェイ (ライン) に格納し、 リプレース処理を実行する。  The main storage device 30 reads data from an address corresponding to the LRU replacement request, stores the data in a replacement way (line) of the cache data RAM 23, and executes a replacement process.
つぎに、 従来のキャッシュメモリ装置 20の動作について、 第 10図に示した フローチャートを参照しつつ説明する。 ステップ SA1では、 ヒット判定部 24 は、 CPU10よりリクエスト (従来では、 データのリードの場合を例にとって 説明) がある力否かを判断し、 この場合、 判断結果を 「No」 として、 同判断を 繰り返す。  Next, the operation of the conventional cache memory device 20 will be described with reference to the flowchart shown in FIG. In step SA1, the hit determination unit 24 determines whether or not there is a request from the CPU 10 (conventionally, a data read is explained as an example). In this case, the determination result is “No”, and the determination is made. repeat.
そして、 CPU 10からリクエストがあると、 ヒット判定部 24は、 ステップ SA1の判断結果を 「Ye s」 とする。 ステップ S A 2では、 ヒット判定部 24 は、 キャッシュタグ RAM22にアクセスし、 CPU10からのアドレスと、 キ ャッシュタグ RAM 22のアドレスとを比較し、 ヒット判定を行う。  Then, when there is a request from the CPU 10, the hit determination unit 24 sets the determination result of step SA1 to “Yes”. In step S A2, the hit judging unit 24 accesses the cache tag RAM 22 and compares the address from the CPU 10 with the address of the cache tag RAM 22 to make a hit judgment.
ステップ SA3では、 ヒット判定部 24は、 キャッシュヒットした力否かを判 断する。 ステップ SA3の判断結果が 「Ye s」 である場合、 すなわち、 ヒット 判定結果が 「キャッシュヒット」 である場合、 ステップ SA4では、 キャッシュ データ RAM23から CPU 10へデータが転送される。  In step SA3, the hit determination unit 24 determines whether or not a cache hit has occurred. If the determination result in step SA3 is “Yes”, that is, if the hit determination result is “cache hit”, data is transferred from the cache data RAM 23 to the CPU 10 in step SA4.
すなわち、 ヒット判定部 24からヒット判定結果 (キャッシュヒット) がキヤ ッシュデータ RAM 23へ通知されると、 キャッシュデータ RAM 23の当該ァ ドレスに格納されているデータがリードされ、 このデータが CPU 10へ転送さ れる。  That is, when the hit determination result (cache hit) is notified from the hit determination unit 24 to the cache data RAM 23, the data stored in the corresponding address of the cache data RAM 23 is read, and this data is transferred to the CPU 10. Is done.
一方、 ステップ SA3の判断結果が 「No」 である場合、 すなわち、 ヒット判 定結果が 「キャッシュミス」 である場合、 ステップ SA5では、 ヒット判定部 2 4は、 リプレース部 25 (シングルポート LRU · RAM26) およびキヤッシ ュデータ RAM23へヒット判定結果 ( 「キャッシュミス」 ) を通知する。 ステップ S A 6では、 LRUリプレースウェイ選択部 27は、 ヒット判定結果 (「キャッシュミス」) を受けて、 シングルポート LRU* RAM 26を参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23におけるリプレー スウェイを選択する。 On the other hand, if the result of the determination in step SA3 is “No”, that is, if the result of the hit determination is “cache miss”, in step SA5, the hit determination unit 24 replaces the replacement unit 25 (single-port LRU RAM26 ) And the cache data RAM 23 are notified of the hit determination result (“cache miss”). In step SA 6, the LRU replacement way selection unit 27 receives the hit determination result (“cache miss”), refers to the single-port LRU * RAM 26, and replaces the replacement data in the cache data RAM 23 based on the LRU method described above. Select
ステップ SA7では、 LRUリプレースウェイ選択部 27は、 主記憶装置 30 へ、 ステップ S A 6で選択されたリプレースウェイに対応する L RUリプレース 要求 (アドレスを含む) を出す。  In step SA7, the LRU replacement way selection unit 27 issues an LRU replacement request (including an address) corresponding to the replacement way selected in step S A6 to the main storage device 30.
ステップ S A 8では、 主記憶装置 30は、 LRUリプレース要求を受けて、 当 該アドレスからデータを読み出す。 ステップ SA9では、 主記憶装置 30は、 読 み出したデータをキャッシュデータ RAM 23へ転送する。  In step S A8, the main storage device 30 receives the LRU replacement request and reads data from the address. In step SA9, the main storage device 30 transfers the read data to the cache data RAM 23.
ステップ SA10では、 LRUリプレースウェイ選択部 27で選択されたリブ レースウェイ (ライン) にデータが格納 (リプレース) されるというリプレース 処理が実行される。 ステップ SA4では、 キャッシュデータ RAM23から CP U 10へ当該データが転送される。  In step SA10, a replacement process is performed in which data is stored (replaced) in the rib raceway (line) selected by the LRU replacement way selection unit 27. In step SA4, the data is transferred from the cache data RAM 23 to the CPU 10.
ここで、 近年では、 マイクロプロセッサで複数の処理を同時に実行するスーパ スカラ方式が採用されているものが多く見受けられる。 このスーパスカラ方式に おいては、 複数の処理に応じて複数のリクエストを処理可能なキャッシュメモリ 装置が必要とされる。  Here, in recent years, there are many cases in which a superscalar system in which a microprocessor executes a plurality of processes simultaneously is adopted. In the superscalar method, a cache memory device capable of processing a plurality of requests according to a plurality of processes is required.
従来では、 上記ニーズを受けて、 例えば、 第 8図に示したシングノレポート LR U . RAM 26に代えて、 複数の入力ポートを有するマルチポート L RU · R A Mを設けて、 同時に複数のリプレースを行えるように構成している。  Conventionally, in response to the above needs, for example, instead of the single report LRU.RAM 26 shown in FIG. It is configured to be able to do it.
第 1 1図は、 上記マルチポート LRU · RAMを備えた従来のキャッシュメモ リ装置 40の構成を示すブロック図である。 この図において、 第 8図の各部に対 応する部分には同一の符号を付ける。  FIG. 11 is a block diagram showing a configuration of a conventional cache memory device 40 provided with the above-described multi-port LRU / RAM. In this figure, parts corresponding to the respective parts in FIG. 8 are denoted by the same reference numerals.
第 1 1図においては、 第 8図に示したキャッシュメモリ装置 20に代えて、 キ ャッシュメモリ装置 40が設けられている。 キャッシュメモリ装置 40において は、 第 8図に示したキャッシュタグ部 21およびリプレース部 25に代えて、 キ ャッシュタグ部 41およびリプレース部 43が設けられている。 In FIG. 11, a cache memory device 40 is provided instead of the cache memory device 20 shown in FIG. In the cache memory device 40, instead of the cache tag unit 21 and the replacement unit 25 shown in FIG. A cache tag section 41 and a replacement section 43 are provided.
キャッシュタグ部 41は、 CPU 10からの複数のリクエスト (アドレス) 、 すなわち、 第 1のリクエスト (アドレス) およぴ第 2のリクエスト (アドレス) を受け付け可能とされており、 キャッシュタグ RAM22およぴヒット判定部 4 2から構成されている。  The cache tag unit 41 can receive a plurality of requests (addresses) from the CPU 10, that is, a first request (address) and a second request (address). It consists of a hit decision unit 42.
ヒット判定部 42は、 CPU 10からの第 1のリクエストに対応するァドレス と、 キャッシュタグ RAM 22のアドレスとを比較してヒッ ト判定を行い、 第 1 のヒット判定結果を通知する。  The hit determination unit 42 performs a hit determination by comparing the address corresponding to the first request from the CPU 10 with the address of the cache tag RAM 22, and notifies the first hit determination result.
また、 ヒット判定部 42は、 CPU 10からの第 2のリクエストに対応するァ ドレスと、キャッシュタグ RAM 22のァドレスとを比較してヒット判定を行レ、、 第 2のヒット判定結果を通知する。  Further, the hit determination unit 42 compares the address corresponding to the second request from the CPU 10 with the address of the cache tag RAM 22, performs a hit determination, and notifies the second hit determination result. .
リプレース部 43は、 第 1のヒット判定結果および第 2のヒット判定結果が共 に 「キャッシュミス」 である場合に、 キャッシュデータ RAM23 (第 9図参照) でリプレースすべきウェイを並列的に選択する機能を備えており、 マルチポート LRU · RAM44、 第 1の L RUリプレースウェイ選択部 45および第 2の L RUリプレースウェイ選択部 46から構成されている。  The replace unit 43 selects a way to be replaced in the cache data RAM 23 (see FIG. 9) in parallel when both the first hit determination result and the second hit determination result are “cache miss”. It has a multi-port LRU / RAM 44, a first LRU replacement way selection unit 45, and a second LRU replacement way selection unit 46.
マルチポート LRU · RAM44は、 第 1のヒット判定結果 (第 1のリクエス ト) および第 2のヒット判定結果 (第 2のリクエスト) に対応する二つの入力ポ ートを備えており、 キャッシュデータ RAM23でデータをリプレースする場合 に、 前述した LRU方式により選択されたリプレースウェイを表すリプレースゥ エイ情報を格納している。  The multi-port LRU / RAM 44 has two input ports corresponding to the first hit judgment result (first request) and the second hit judgment result (second request), respectively. When the data is to be replaced by the replacement method, the replacement information indicating the replacement way selected by the above-mentioned LRU method is stored.
第 1の LRUリプレースウェイ選択部 45は、 第 1のヒット判定結果 (キヤッ シュミス) に対応して設けられており、 キャッシュメモリ (キャッシュタグ R A M22およびキャッシュデータ RAM23) における複数のウェイの中から、 マ ルチポート LRU · RAM44を参照して、 L RU方式により第 1のリプレース ウェイを選択した後、 第 1の LRUリプレース要求 (アドレスを含む) を主記憶 装置 30へ出す。 第 2の LRUリプレースウェイ選択部 46は、 第 2のヒット判定結果 (キヤッ シュミス) に対応して設けられており、 キャッシュメモリ (キャッシュタグ R A M22およびキャッシュデータ RAM23) における複数のウェイの中から、 マ ルチポート LRU · RAM44を参照して、 L RU方式により第 2のリプレース ウェイを選択した後、 第 2の LRUリプレース要求 (アドレスを含む) を主記憶 装置 30へ出す。 The first LRU replacement way selection unit 45 is provided corresponding to the first hit determination result (cache miss), and selects one of a plurality of ways in the cache memory (cache tag RAM22 and cache data RAM23). After referring to the multiport LRU / RAM 44 and selecting the first replacement way by the LRU method, a first LRU replacement request (including an address) is issued to the main storage device 30. The second LRU replacement way selection unit 46 is provided corresponding to the second hit determination result (cache miss), and selects a plurality of ways in the cache memory (cache tag RAM 22 and cache data RAM 23). After referring to the multiport LRU / RAM 44 and selecting the second replacement way by the LRU method, a second LRU replacement request (including an address) is issued to the main storage device 30.
主記憶装置 30は、 上記第 1の LRUリプレース要求および第 2の LRUリプ レース要求に対応する各ァドレスから第 1のデータおよび第 2のデータを読み出 し、 これらをキャッシュデータ RAM23の第 1のリプレースウェイ (ライン) および第 2のリプレースウェイ (ライン) にそれぞれ格納し、 並列的にリプレー ス処理を実行する。  The main storage device 30 reads out the first data and the second data from the addresses corresponding to the first LRU replacement request and the second LRU replacement request, and stores them in the first data of the cache data RAM 23. They are stored in the replacement way (line) and the second replacement way (line), respectively, and the replacement processing is executed in parallel.
ところで、 前述したように従来のキャッシュメモリ装置 40 (第 1 1図参照) においては、 二つの入力ポートを有するマルチポート LRU · RAM44を設け て、 CPU10からの複数の同時リクエス卜に対応させている。  By the way, as described above, in the conventional cache memory device 40 (see FIG. 11), a multi-port LRU / RAM 44 having two input ports is provided to support a plurality of simultaneous requests from the CPU 10. .
しかしながら、 マルチポート LRU · RAM44を採用した場合には、 シング ルポート LRU · RAM 26 (第 8図参照) に比べて、 実装面積が増加し、 小型 化の要請に応えることができないという問題があった。  However, when the multi-port LRU / RAM44 is adopted, there is a problem that the mounting area is increased compared to the single-port LRU / RAM26 (see FIG. 8), and the demand for miniaturization cannot be met. .
そこで、 第 8図に示したキャッシュメモリ装置 20においては、 CPU10よ り複数の同時リクエストがあった場合に、 一方のリクエストを先に処理した後、 他方のリクエストを処理し直すという順番待ちの構成を採ることが考えられる。 かかる構成では、 複数の同時リクエストに対応して LRUリプレースウェイが順 番に選択されるため、 キャッシュメモリのヒット率が低下しないという利点を備 えている。  Therefore, in the cache memory device 20 shown in FIG. 8, when there are a plurality of simultaneous requests from the CPU 10, one of the requests is processed first, and then the other request is processed again. Can be considered. This configuration has the advantage that the LRU replacement way is selected in order in response to a plurality of simultaneous requests, so that the cache memory hit rate does not decrease.
し力 しながら、 パイプライン処理を行う構成では、 他方のリクエストを処理し 直す場合に、 パイプラインの最初のステージまで処理が戻ってしまうため、 当該 他方のリクエス卜が処理されるまでに相当の時間がかかるという欠点を備えてい る。 このような処理時間の遅れは、 科学技術演算やトランザクション処理等のよう に大規模データを极う場合にキャッシュ性能の低下をもたらすことになる。 また、 大規模データを扱う場合には、 キャッシュメモリにデータが格納されて も利用されることなくすぐにリプレースされる場合が多く、 キャッシュヒット率 の向上よりも、 むしろキャッシュミス時に主記憶装置からデータをできるだけ早 く持ってくることが求められている。 However, in a configuration in which pipeline processing is performed, when the other request is processed again, the processing returns to the first stage of the pipeline, so that a considerable amount of time is required before the other request is processed. It has the disadvantage that it takes time. Such a delay in processing time causes a decrease in cache performance when large-scale data is used, such as in scientific and technological operations and transaction processing. Also, when handling large-scale data, in many cases, data is stored in the cache memory and immediately replaced without being used. There is a need to bring the data as soon as possible.
本発明は、 上記に鑑みてなされたもので、 複数同時アクセスに対応でき、 実装 面積を削減しつつキヤッシュ性能を向上させることができるメモリ制御装置およ びキヤッシュリプレース制御方法を提供することを目的としている。 発明の開示  The present invention has been made in view of the above, and an object of the present invention is to provide a memory control device and a cache replacement control method capable of coping with a plurality of simultaneous accesses and improving a cache performance while reducing a mounting area. And Disclosure of the invention
上記目的を達成するために、 本発明は、 上位装置と主記憶装置との間に設けら れ、 複数ウェイ構成のキヤッシュメモリに対する制御を行うメモリ制御装置にお いて、 前記キャッシュメモリのリプレースに関するリプレースウェイ情報を保持 するリプレースウェイ情報保持手段と、 前記リプレースウェイ情報保持手段の前 記リプレースウェイ情報に基づレ、て、 リプレース対象の第 1のウェイを選択する 第 1のリブレースウェイ選択手段と、 前記リプレースウェイ情報を使用せずにリ プレース対象の第 2のウェイを選択する第 2のリプレースウェイ選択手段と、 前 記上位装置から同時に発行され前記キャッシュメモリへのアクセスにかかる第 1 のリクエストおよび第 2のリクエストのそれぞれについてヒッ ト判定を行うヒッ ト判定手段と、 前記第 1のリクエストおよび前記第 2のリクエストに対応する前 記ヒット判定が共にキャッシュミスである場合、 前記第 1のリクエス卜に対応さ せて前記第 1のリプレースゥヱイ選択手段に前記第 1のウェイを選択させるとと もに、 前記第 2のリクエストに対応させて前記第 2のリプレースウェイ選択手段 に前記第 2のウェイを選択させる調停手段と、 を備えたことを特徴とする。 また、 本発明は、 上位装置と主記憶装置との間に設けられ、 複数ゥヱイ構成の キャッシュメモリを有するキャッシュメモリ装置に適用されるキャッシュリプレ ース制御方法にぉレ、て、 リプレースウェイ情報保持手段に保持され前記キヤッシ ュメモリのリプレースに関するリプレースウェイ情報に基づいて、 リプレース対 象の第 1のウェイを選択する第 1のリプレースウェイ選択工程と、 前記リプレー スゥヱイ情報を使用せずにリプレース対象の第 2のウェイを選択する第 2のリブ レースウェイ選択工程と、 前記上位装置から同時に発行され前記キャッシュメモ リへのアクセスにかかる第 1のリクエストおよび第 2のリクエストのそれぞれに ついてヒット判定を行うヒット判定工程と、 前記第 1のリクエストおよび前記第 2のリクエストに対応する前記ヒット判定が共にキャッシュミスである場合、 前 記第 1のリクエストに対応させて前記第 1のリプレースゥエイ選択工程で前記第 1のウェイを選択させるとともに、 前記第 2のリクエストに対応させて前記第 2 のリプレースウェイ選択工程で前記第 2のウェイを選択させる調停工程と、 を含 むことを特徴とする。 In order to achieve the above object, the present invention relates to a memory control device provided between a higher-level device and a main storage device and configured to control a cache memory having a multi-way configuration. Replacement way information holding means for holding way information; first rib race way selection means for selecting a first way to be replaced based on the replacement way information of the replacement way information holding means. A second replacement way selecting means for selecting a second way to be replaced without using the replacement way information, and a first request for accessing the cache memory issued simultaneously from the host device. Determination means for performing a hit determination for each of the second request and the second request If the hit determinations corresponding to the first request and the second request are both cache misses, the first replacement bay selecting means may correspond to the first request and Arbitration means for selecting the one way and causing the second replacement way selection means to select the second way in response to the second request. Also, the present invention provides a cache replacement device provided between a higher-level device and a main storage device and applied to a cache memory device having a cache memory of a multi-layer configuration. A first replacement way selection step of selecting a first way to be replaced based on replacement way information stored in the replacement way information holding means and related to replacement of the cache memory. A second rib raceway selecting step of selecting a second way to be replaced without using the replacement pay information, and a first request for accessing the cache memory issued simultaneously from the higher-level device. A hit determination step of performing a hit determination for each of the first request and the second request; and if the hit determinations corresponding to the first request and the second request are both cache misses, the first request Correspondingly, the first way is selected in the first replacement Together thereby, and a mediation step of selecting the second way in the said to correspond to second request the second replace-way selection process, characterized in containing Mukoto.
力かる発明によれば、 第 1のリクエストおよぴ第 2のリクエストに対応するヒ ット判定が共にキャッシュミスである場合、 第 1のリクエス卜に対応させて第 1 のウェイを選択させるとともに、 第 2のリクエストに対応させてリプレースゥェ ィ情報を使用せずにリプレース対象の第 2のウェイを選択させることとしたので、 シングルポートのリプレースウェイ情報保持手段で、 複数同時アクセスに対応で き、 実装面積を削減しつつキャッシュ性能を向上させることができる。 図面の簡単な説明  According to the powerful invention, when the hit judgments corresponding to the first request and the second request are both cache misses, the first way is selected according to the first request and However, since the second way to be replaced is selected without using the replacement way information in response to the second request, a single port replacement way information holding means can support multiple simultaneous accesses. The cache performance can be improved while reducing the mounting area. BRIEF DESCRIPTION OF THE FIGURES
第 1図は、 本発明にかかる実施の形態 1の構成を示すブロック図であり、 第 2 図は、第 1図に示したリプレース部 1 0 3の動作を説明する図であり、第 3図は、 同実施の形態 1の動作を説明するフローチャートであり、 第 4図は、 本発明にか 力る実施の形態 2の構成を示すブロック図であり、 第 5図は、 第 4図に示したリ プレース部 2 0 1の動作を説明する図であり、 第 6図は、 第 4図に示したヒット 状態判定部 2 0 2の動作を説明する図であり、 第 7図は、 同実施の形態 2の動作 を説明するフローチャートであり、 第 8図は、 従来のキャッシュメモリ装置 2 0 の構成を示すブロック図であり、 第 9図は、 第 8図に示したキャッシュタグ RA M22、 キャッシュデータ RAM23およびシングルポート LRU · RAM26 の構成を示す図であり、 第 10図は、 第 8図に示したキャッシュメモリ装置 20 の動作を説明するフローチャートであり、 第 1 1図は、 従来のキャッシュメモリ 装置 40の構成を示すブロック図である。 発明を実施するための最良の形態 FIG. 1 is a block diagram showing the configuration of the first embodiment according to the present invention. FIG. 2 is a diagram for explaining the operation of the replacement unit 103 shown in FIG. FIG. 4 is a flowchart for explaining the operation of the first embodiment. FIG. 4 is a block diagram showing the configuration of the second embodiment according to the present invention. FIG. FIG. 6 is a diagram for explaining the operation of the replacement unit 201, FIG. 6 is a diagram for explaining the operation of the hit state determination unit 202 shown in FIG. 4, and FIG. FIG. 8 is a flowchart for explaining the operation of the second embodiment. FIG. 8 shows a conventional cache memory device 20. FIG. 9 is a block diagram showing the configuration of the cache tag RAM22, cache data RAM23 and single-port LRU / RAM26 shown in FIG. 8, and FIG. 10 is a block diagram showing the configuration of FIG. Is a flowchart for explaining the operation of the cache memory device 20 shown in FIG. 1, and FIG. 11 is a block diagram showing a configuration of a conventional cache memory device 40. 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図に示したキャッシュメモリ装置 20に代えて、 キャッシュメモリ 装置 100が設けられている。  FIG. 1 is a block diagram showing a configuration of a first embodiment according to the present invention. In this figure, the same reference numerals are given to parts corresponding to the respective parts in FIG. In FIG. 1, a cache memory device 100 is provided instead of the cache memory device 20 shown in FIG.
また、 キャッシュメモリ装置 100においては、 第 8図に示したキャッシュタ グ部 21およびリプレース部 25に代えて、 キャッシュタグ部 101およびリプ レース部 103が設けられている。  In the cache memory device 100, a cache tag unit 101 and a replacement unit 103 are provided instead of the cache tag unit 21 and the replacement unit 25 shown in FIG.
キャッシュタグ部 101は、 CPU 10からの複数のリクエスト(ァドレス)、 すなわち、 第 1のリクエスト (アドレス) および第 2のリクエスト (アドレス) を受け付け可能とされており、 キャッシュタグ RAM22およびヒット判定部 1 02から構成されている。  The cache tag unit 101 is capable of receiving a plurality of requests (addresses) from the CPU 10, that is, a first request (address) and a second request (address). It consists of 02.
また、 CPU 10からは、 第 1のリクエストおよび第 2のリクエストが同時に 出される場合と、 第 1のリクエスト (または第 2のリクエスト) が単独で出され る場合とがある。  Further, the CPU 10 may issue the first request and the second request at the same time, or may issue the first request (or the second request) alone.
ヒット判定部 102は、 CPU 10からの第 1のリクエストに対応するァドレ スと、 キャッシュタグ RAM 22のアドレスとを比較してヒット判定を行い、 第 1のヒット判定結果を通知する。 また、 ヒット判定部 102は、 CPU 10からの第 2のリクエストに対応する ァドレスと、 キャッシュタグ RAM22のァドレスとを比較してヒット判定を行 レ、、 第 2のヒット判定結果を通知する。 . The hit determination unit 102 performs a hit determination by comparing an address corresponding to the first request from the CPU 10 with the address of the cache tag RAM 22, and notifies the first hit determination result. Also, the hit determination unit 102 compares the address corresponding to the second request from the CPU 10 with the address of the cache tag RAM 22, performs a hit determination, and notifies the second hit determination result. .
リプレース部 103は、 第 2図に示したように、 CPU 10からの第 1のリク ェスト、 第 2のリクエストの有無に応じて、 キャッシュデータ RAM23 (第 9 図参照) でリプレースすべきウェイを所定の方式 (LRU方式、 ランダム方式) で選択する機能を備えている。  As shown in FIG. 2, the replacement unit 103 determines a way to be replaced in the cache data RAM 23 (see FIG. 9) according to the first request from the CPU 10 and the presence or absence of the second request. It has a function to select by LRU method (LRU method, random method).
ここで、 LRU方式は、 前述したように、 キャッシュメモリ (キャッシュタグ RAM22およぴキャッシュデータ RAM23)における複数のウェイの中から、 最も使用されていなかつたデータが格納されたウェイを選択する方式である。 一方、 ランダム方式は、 キャッシュメモリ (キャッシュタグ RAM 22および キャッシュデータ RAM23) における複数のウェイの中から、 ランダムにゥェ ィを選択する方式である。  Here, as described above, the LRU method is a method of selecting a way in which the least used data is stored from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23). is there. On the other hand, the random method is a method of randomly selecting a way from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23).
リプレース部 103は、 シングルポート LRU · RAM 26 (第 9図参照) 、 調停部 104、 ランダムリプレースウェイ選択部 105および LRUリプレース ウェイ選択部 27から構成されている。  The replacement unit 103 includes a single-port LRU / RAM 26 (see FIG. 9), an arbitration unit 104, a random replacement way selection unit 105, and an LRU replacement way selection unit 27.
シングルポート LRU . RAM26 (第 9図参照) は、 前述したように、 一つ の入力ポートを備えており、 キャッシュデータ RAM 23でデータをリプレース する場合に、 L RU方式により選択されたリプレースウェイを表すリプレースゥ ヱイ情報を格納している。  As described above, the single-port LRU.RAM26 (see Fig. 9) has one input port, and when replacing data in the cache data RAM 23, the replacement way selected by the LRU method is used. Replacement information to be stored is stored.
調停部 104は、第 2図に示したように、 CPU 10からの第 1のリクエスト、 第 2のリクエストの有無に応じて、 第 1のリクエストの処理、 第 2のリクエスト 処理の調停を図る。  The arbitration unit 104 arbitrates the processing of the first request and the processing of the second request according to the presence or absence of the first request and the second request from the CPU 10, as shown in FIG.
すなわち、 第 2図に示したように、 第 1のリクエストおよび第 2のリクエスト が共に無い (=0) 場合には、 いずれの処理もさせない。 第 1のリクエストのみ が有る場合 (=1) 、 すなわち、 第 1のヒット判定結果のみがヒット判定部 10 2より入力された場合、 調停部 104は、 第 1のリクエストを L RU方式で処理 すべく、 第 1のヒット判定結果をシングルポート LRU · RAM26へ渡す。 また、 第 2のリクエストのみが有る場合 (=1) 、 すなわち、 第 2のヒット判 定結果のみがヒット判定部 1 02より入力された場合、 調停部 104は、 第 2の リクエストを LRU方式で処理すべく、 第 2のヒット判定結果をシングルポート LRU - R AM 26へ渡す。 That is, as shown in FIG. 2, if neither the first request nor the second request is present (= 0), no processing is performed. When there is only the first request (= 1), that is, when only the first hit determination result is input from the hit determination unit 102, the arbitration unit 104 processes the first request by the LRU method The first hit judgment result is passed to the single-port LRU · RAM26 in order to perform this. Also, when there is only the second request (= 1), that is, when only the second hit determination result is input from the hit determination unit 102, the arbitration unit 104 converts the second request by the LRU method. The second hit determination result is passed to the single-port LRU-RAM 26 for processing.
また、 第 1のリクエストおよび第 2のリクエストの双方が同時に有る場合 (= 1) 、 すなわち、 第 1のヒッ ト判定結果および第 2のヒット判定結果の双方が同 時にヒット判定部 102より入力された場合、 調停部 104は、 第 1のリクエス トを L R U方式で処理すベく、 第 1のヒット判定結果をシングルポート L R U · RAM26へ渡すとともに、 第 2のリクエストをランダム方式で処理すべく、 ラ ンダムリプレースゥヱイ選択部 105へ渡す。  Also, when both the first request and the second request are present at the same time (= 1), that is, both the first hit determination result and the second hit determination result are input from the hit determination unit 102 at the same time. In this case, the arbitration unit 104 should process the first request by the LRU method, pass the first hit determination result to the single-port LRURAM26, and process the second request by the random method. Hand over to random replacer selection unit 105.
LRUリプレースウェイ選択部 27は、 キャッシュメモリ (キャッシュタグ R AM 22およびキャッシュデータ RAM23) における複数のウェイの中から、 シングルポート LRU · RAM26を参照して、 LRU方式によりリプレースゥ エイを選択した後、リプレース要求(アドレスを含む)を主記憶装置 30へ出す。 ランダムリプレースウェイ選択部 105は、 キャッシュメモリ (キャッシュタ グ RAM22およびキャッシュデータ RAM23) における複数のウェイの中か ら、 ランダム方式によりリプレースウェイを選択した後、 リプレース要求 (アド レスを含む) を主記憶装置 30へ出す。  The LRU replacement way selection unit 27 refers to the single-port LRU / RAM 26 from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23), selects a replacement layer by the LRU method, A replacement request (including an address) is issued to the main storage device 30. The random replacement way selection unit 105 selects a replacement way from a plurality of ways in the cache memory (the cache tag RAM 22 and the cache data RAM 23) in a random manner, and then stores a replacement request (including an address) in a main memory. Take out to device 30.
主記憶装置 30は、 上記両リプレース要求に対応する各ァドレスから第 1のデ ータ、 第 2のデータを読み出し、 これらをキャッシュデータ RAM 23の各リプ レースウェイ (ライン) に格納し、 リプレース処理を実行する。  The main storage device 30 reads out the first data and the second data from the addresses corresponding to the two replacement requests, stores them in each of the replacement ways (lines) of the cache data RAM 23, and performs the replacement process. Execute
つぎに、 上述した実施の形態 1の動作について、 第 3図に示したフローチヤ一 トを参照しつつ説明する。  Next, the operation of the first embodiment will be described with reference to the flowchart shown in FIG.
ステップ SB 1では、 ヒッ ト判定部 102は、 CPU 10よりリクエスト (実 施の形態 1では、 データのリードの場合を例にとって説明) がある力否かを判断 し、 この場合、 判断結果を 「No」 として、 同判断を繰り返す。 そして、 CPU 10力 ら第 1のリクエストおよび第 2のリクエストが同時にあ ると、 ヒット判定部 102は、 ステップ SB 1の判断結果を 「Ye s」 とする。 ステップ SB 2では、 ヒット判定部 102は、 キャッシュタグ RAM22にァク セスし、 C PU 10からの各アドレスと、 キャッシュタグ RAM22のアドレス とを比較し、 第 1のリクエストおよぴ第 2のリクエストのそれぞれについてヒッ ト判定を行う。 In step SB1, the hit determination unit 102 determines whether or not there is a request from the CPU 10 (in the first embodiment, a case of reading data is described as an example), and in this case, the determination result is “ The judgment is repeated as "No." Then, when there is a first request and a second request from the CPU 10 simultaneously, the hit determination unit 102 sets the determination result of step SB1 to "Yes". In step SB 2, the hit determination unit 102 accesses the cache tag RAM 22, compares each address from the CPU 10 with the address of the cache tag RAM 22, and performs the first request and the second request Hit judgment is performed for each of the above.
ステップ SB 3では、 ヒット判定部 102は、 キャッシュヒットした力否かを 判断する。 ステップ SB 3の判断結果が 「Ye s」 である場合、 すなわち、 ヒッ ト判定結果がそれぞれ 「キヤッシュヒット」 である場合、 ステップ S B 4では、 キヤッシュデータ RAM23から CPU 10へ第 1のデータおよび第 2のデータ が転送される。  In step SB3, the hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB 3 is “Yes”, that is, if the hit determination results are each “cache hit”, in step SB 4, the first data and the second data Data is transferred.
すなわち、 ヒット判定部 102から第 1のヒット判定結果(キャッシュヒット) およぴ第 2のヒット判定結果 (キャッシュヒット) がキャッシュデータ RAM2 3へ通知されると、 キャッシュデータ RAM23の当該ァドレスに格納されてレ、 る第 1のデータおよび第 2のデータがリードされ、 これらの第 1のデータおよび 第 2のデータが CPU 10へ転送される。  That is, when the first hit determination result (cache hit) and the second hit determination result (cache hit) are notified from the hit determination unit 102 to the cache data RAM 23, they are stored in the corresponding address of the cache data RAM 23. The first data and the second data are read, and the first data and the second data are transferred to the CPU 10.
一方、 ステップ SB 3の判断結果が 「No」 である場合、 すなわち、 「キヤッ シュミス」 の場合、 ステップ SB 5では、 ヒット判定部 102は、 リプレース部 103の調停部 104へ第 1のヒット判定結果 ( 「キャッシュミス」 ) およぴ第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  On the other hand, if the determination result of step SB 3 is “No”, that is, “cache miss”, in step SB 5, the hit determination unit 102 sends the first hit determination result to the arbitration unit 104 of the replacement unit 103. (“Cache miss”) and the second hit determination result (“cache miss”).
ステップ S B 6では、 調停部 104は、 通知された第 1のヒット判定結果およ ぴ第 2のヒット判定結果に基づいて、 同時複数のキャッシュミスがある力否かを 判断し、 この場合、 判断結果を 「Ye s」 とする。  In step SB6, the arbitration unit 104 determines whether or not there is a power having a plurality of simultaneous cache misses based on the notified first hit determination result and the second hit determination result. Let the result be "Yes".
以後、 ステップ SB 7〜ステップ SB 12と、 ステップ SB 13〜ステップ S B 18とが並列的に実行される。  Thereafter, Step SB7 to Step SB12 and Step SB13 to Step SB18 are executed in parallel.
すなわち、 ステップ SB 7では、 調停部 104は、 シングルポート LRU ' R AM 26へ第 1のヒット判定結果 ( 「キャッシュミス」 ) を通知する。 ステップ SB 8では、 LRUリプレースウェイ選択部 27は、 第 1のヒット判 定結果 ( 「キャッシュミス」 ) を受けて、 シングルポート LRU · RAM26を 参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23における リプレースウェイを選択する。 That is, in step SB7, the arbitration unit 104 notifies the single-port LRU 'RAM 26 of the first hit determination result ("cache miss"). In step SB8, the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select the replacement way in.
ステップ SB 9では、 LRUリプレースウェイ選択部 27は、 主記憶装置 30 へ、 ステップ SB 8で選択されたリプレースウェイに対応するリプレース要求を 出す。  In step SB9, the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB8.
ステップ SB 10では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 1のデータを読み出す。ステップ SB 11では、主記憶装置 30は、 読み出した第 1のデータをキャッシュデータ RAM 23へ転送する。  In step SB10, the main storage device 30 reads the first data from the address in response to the replacement request. In step SB11, the main storage device 30 transfers the read first data to the cache data RAM 23.
ステップ SB 12では、 LRUリプレースウェイ選択部 27で選択されたリプ レースウェイ (ライン) に第 1のデータが格納 (リプレース) されるというリブ レース処理が実行される。  In step SB12, a rib race process is executed in which the first data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
一方、 ステップ SB 13では、 調停部 104は、 ランダムリプレースウェイ選 択部 105へ第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  On the other hand, in step SB13, the arbitration unit 104 notifies the random replacement way selection unit 105 of the second hit determination result (“cache miss”).
ステップ SB 14では、 ランダムリプレースウェイ選択部 105は、 第 2のヒ ット判定結果 ( 「キャッシュミス」 ) を受けて、 前述したランダム方式に基づい て、 キャッシュデータ RAM23におけるリプレースウェイを選択する。  In step SB14, upon receiving the second hit determination result (“cache miss”), the random replacement way selection unit 105 selects a replacement way in the cache data RAM 23 based on the random method described above.
ステップ SB 15では、 ランダムリプレースウェイ選択部 105は、 主記憶装 置 30へ、 ステップ SB 14で選択されたリプレースウェイに対応するリプレー ス要求を出す。  In step SB15, the random replacement way selection unit 105 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB14.
ステップ SB 16では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 2のデータを読み出す。ステップ SB 17では、主記憶装置 30は、 読み出した第 2のデータをキヤッシュデータ R AM 23へ転送する。  In step SB16, the main storage device 30 receives the replacement request and reads the second data from the address. In step SB17, the main storage device 30 transfers the read second data to the cache data RAM23.
ステップ SB 18では、 ランダムリプレースウェイ選択部 105で選択された リプレースウェイ (ライン) にデータが格納 (リプレース) されるというリプレ —ス処理が実行される。 ステップ SB 4では、 キャッシュデータ RAM 23力 ら CPU 10へ第 1のデ ータおよび第 2のデータが転送される。 In step SB18, a replacement process is executed in which data is stored (replaced) in the replacement way (line) selected by the random replacement way selection unit 105. In step SB4, the first data and the second data are transferred from the cache data RAM 23 to the CPU 10.
また、 CPU 10より第 1のリクエストのみがあると、ヒット判定部 102は、 ステップ SB 1の判断結果を 「Ye s」 とする。 ステップ SB 2では、 ヒット判 定咅 102は、 キャッシュタグ RAM22にアクセスし、 CPU10からのアド レスと、 キャッシュタグ RAM22のアドレスとを比較し、 第 1のリクエストに ついてヒット判定を行う。  If there is only the first request from the CPU 10, the hit determination unit 102 sets the determination result of step SB1 to “Yes”. In step SB2, the hit determination # 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and performs a hit determination on the first request.
ステップ SB 3では、 ヒット判定部 102は、 キャッシュヒットした力否かを 判断する。 ステップ SB 3の判断結果が 「Ye s」 である場合、 すなわち、 ヒッ ト判定結果が 「キャッシュヒット」 である場合、 ステップ SB4では、 キヤッシ ュデータ RAM23から CPU 10へデータが転送される。  In step SB3, the hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB3 is "Yes", that is, if the hit determination result is "cache hit", data is transferred from the cache data RAM 23 to the CPU 10 in step SB4.
すなわち、 ヒット判定部 102から第 1のヒット判定結果(キャッシュヒット) がキャッシュデータ RAM23へ通知されると、 キャッシュデータ RAM23の 当該ァドレスに格納されている第 1のデータがリードされ、 第 1のデータが CP U 10へ転送される。  That is, when the first hit determination result (cache hit) is notified from the hit determination unit 102 to the cache data RAM 23, the first data stored in the address of the cache data RAM 23 is read, and the first data is read. Is transferred to the CPU 10.
一方、 ステップ SB 3の判断結果が 「No」 である場合、 すなわち、 「キヤッ シュミス」 の場合、 ステップ SB 5では、 ヒット判定部 102は、 リプレース部 103の調停部 104へ第 1のヒット判定結果 ( 「キヤッシュミス」 ) を通知す る。  On the other hand, if the determination result of step SB 3 is “No”, that is, “cache miss”, in step SB 5, the hit determination unit 102 sends the first hit determination result to the arbitration unit 104 of the replacement unit 103. (“Cache miss”).
ステップ S B 6では、 調停部 104は、 通知された第 1のヒット判定結果に基 づいて、 同時複数のキャッシュミスがある力否かを判断し、 この場合、 判断結果 を 「NoJ とする。  In step SB6, the arbitration unit 104 determines whether or not there is simultaneous multiple cache misses based on the notified first hit determination result. In this case, the determination result is “NoJ”.
すなわち、 ステップ S B 7では、 調停部 104は、 シングルポート L RU · R AM 26へ第 1のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  That is, in step SB7, the arbitration unit 104 notifies the single port LRU • RAM 26 of the first hit determination result (“cache miss”).
ステップ SB8では、 LRUリプレースウェイ選択部 27は、 第 1のヒット判 定結果 ( 「キャッシュミス」 ) を受けて、 シングルポート LRU · RAM26を 参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23における リプレースウェイを選択する。 In step SB8, the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU · RAM 26, and based on the LRU method described above, Select a replacement way.
ステップ SB 9では、 LRUリプレースウェイ選択部 27は、 主記憶装置 30 へ、 ステップ SB 8で選択されたリプレースウェイに対応するリプレース要求を 出す。  In step SB9, the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SB8.
ステップ SB 10では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 1のデータを読み出す。ステップ SB 11では、主記憶装置 30は、 読み出した第 1のデータをキヤッシュデータ R AM 23へ転送する。  In step SB10, the main storage device 30 reads the first data from the address in response to the replacement request. In step SB11, the main storage device 30 transfers the read first data to the cache data RAM23.
ステップ SB 12では、 LRUリプレースウェイ選択部 27で選択されたリプ レースウェイ (ライン) に第 1のデータが格納 (リプレース) されるというリブ レース処理が実行される。  In step SB12, a rib race process is executed in which the first data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
ステップ SB 4では、 キヤッシュデータ RAM23から CPU 10へ第 1のデ ータが転送される。  In step SB4, the first data is transferred from the cache data RAM 23 to the CPU 10.
また、 CPU 10より第 2のリクエストのみがあると、ヒット判定部 102は、 ステップ SB 1の判断結果を 「Ye s」 とする。 ステップ SB 2では、 ヒット半 IJ 定部 102は、 キャッシュタグ RAM22にアクセスし、 CPU10からのアド レスと、 キャッシュタグ RAM22のアドレスとを比較し、 第 2のリクエストに ついてヒット判定を行う。  If there is only the second request from the CPU 10, the hit determination unit 102 sets the determination result in step SB1 to “Yes”. In step SB2, the hit half IJ setting unit 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and performs a hit determination on the second request.
ステップ S B 3では、 ヒット判定部 102は、 キヤッシュヒットしたか否かを 判断する。 ステップ SB 3の判断結果が 「Ye s」 である場合、 すなわち、 ヒッ ト判定結果が 「キャッシュヒット」 である場合、 ステップ SB4では、 キヤッシ ュデータ RAM23から CPU10へデータが転送される。  In step S B3, hit determination section 102 determines whether or not a cache hit has occurred. If the determination result of step SB3 is "Yes", that is, if the hit determination result is "cache hit", data is transferred from the cache data RAM 23 to the CPU 10 in step SB4.
すなわち、 ヒット判定部 1.02から第 2のヒット判定結果(キャッシュヒット) がキャッシュデータ RAM23へ通知されると、 キャッシュデータ RAM23の 当該ァドレスに格納されている第 2のデータがリードされ、 第 2のデータが CP U 10へ転送される。  That is, when the hit determination unit 1.02 notifies the cache data RAM 23 of the second hit determination result (cache hit), the second data stored in the cache data RAM 23 at the address is read, and the second data is read. Is transferred to the CPU 10.
一方、 ステップ SB 3の判断結果が 「No」 である場合、 すなわち、 「キヤッ シュミス」 の場合、 ステップ SB 5では、 ヒット判定部 102は、 リプレース部 103の調停部 104へ第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知す る。 On the other hand, if the determination result of step SB 3 is “No”, that is, “cache miss”, in step SB 5, the hit determination unit 102 The second hit determination result (“cache miss”) is notified to the arbitration unit 104 of 103.
ステップ S B 6では、 調停部 104は、 通知された第 2のヒット判定結果に基 づいて、 同時複数のキャッシュミスがあるか否かを判断し、 この場合、 判断結果 を 「No」 とする。  In step SB6, the arbitration unit 104 determines whether there is a plurality of simultaneous cache misses based on the notified second hit determination result, and in this case, sets the determination result to “No”.
すなわち、 ステップ SB 7では、 調停部 104は、 シングルポート LRU ' R AM26へ第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  That is, in step SB7, the arbitrating unit 104 notifies the single-port LRU 'RAM 26 of the second hit determination result ("cache miss").
ステップ SB 8では、 LRUリプレースウェイ選択部 27は、 第 2のヒット判 定結果 ( 「キャッシュミス」 ) を受けて、 シングルポート LRU · RAM26を 参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23における リプレースウェイを選択する。  In step SB8, the LRU replacement way selection unit 27 receives the second hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select the replacement way in.
ステップ SB 9では、 LRUリプレースウェイ選択部 27は、 主記'慮装置 30 へ、 ステップ S B 8で選択されたリプレースウェイに対応するリプレース要求を 出す。  In step SB9, the LRU replacement way selection unit 27 issues a replacement request corresponding to the replacement way selected in step SB8 to the main storage device 30.
ステップ SB 10では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 2のデータを読み出す。ステップ SB 1 1では、主記憶装置 30は、 読み出した第 2のデータをキヤッシュデータ R AM 23へ転送する。  At step SB10, the main storage device 30 receives the replacement request and reads the second data from the address. In step SB11, the main storage device 30 transfers the read second data to the cache data RAM23.
ステップ SB 12では、 LRUリプレースウェイ選択部 27で選択されたリプ レースウェイ (ライン) に第 2のデータが格納 (リプレース) されるというリプ レース処理が実行される。  In step SB12, a replacement process is executed in which the second data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
ステップ SB 4では、 キャッシュデータ RAM23から CPU 10へ第 2のデ ータが転送される。  In step SB4, the second data is transferred from the cache data RAM 23 to the CPU 10.
なお、 実施の形態 1においては、第 1のリクエスト (または第 2のリクエスト) が単独で発行された場合に、 LRUリプレースウェイ選択部 27で LRU方式で リプレースウェイを選択する構成について説明したが、 これに代えて、 ランダム リプレースウェイ選択部 105でランダム方式でリプレースウェイを選択する構 成としてもよい。 以上説明したように、 実施の形態 1によれば、 ヒット判定部 1 0 2で第 1のリ クエストおよび第 2のリクエストに対応するヒット判定が共にキャッシュミスで ある場合、 第 1のリクエストに対応させて L R Uリプレースウェイ選択部 2 7で ウェイを選択させるとともに、 第 2のリクエストに対応させてシングノレポート L R U · R AM 2 6のリプレースウェイ情報を使用せずにリプレース対象のウェイ をランダムリプレースウェイ選択部 1 0 5に選択させることとしたので、 シング ルポ一トのシングルポート L R U · R AM 2 6で、複数同時ァクセスに対応でき、 実装面積を削減しつつキャッシュ性能を向上させることができる。 Although the first embodiment has described the configuration in which the LRU replacement way selection unit 27 selects a replacement way by the LRU method when the first request (or the second request) is issued independently, Alternatively, the random replacement way selection unit 105 may be configured to select a replacement way by a random method. As described above, according to the first embodiment, when the hit judgments corresponding to the first request and the second request by the hit judgment unit 102 are both cache misses, the first request is handled. The LRU replacement way selection section 27 selects a way, and in response to the second request, replaces the way to be replaced with a random replacement way without using the replacement way information of the Singno Report LRU RAM 26. Since the selection unit 105 makes the selection, the single port single port LRU / RAM 26 can cope with multiple simultaneous accesses, and the cache performance can be improved while reducing the mounting area.
(実施の形態 2 )  (Embodiment 2)
さて、 前述した実施の形態 1では、 C P U 1 0により、 第 1のリクエストおよ び第 2のリクエストが同時に発行され、 第 1のヒット判定結果おょぴ第 2のヒッ ト判定結果が共にキャッシュミスである場合に、 L R U方式おょぴランダム方式 によりリプレース処理を実行する例について説明したが、 ヒット状態 (キヤッシ ュヒット多発またはキャッシュミス多発) に基づいて、 リプレース処理に変化を つけるように構成してもよい。 以下では、 この構成例を実施の形態 2として説明 する。  In the first embodiment, the CPU 10 issues the first request and the second request at the same time, and caches both the first hit determination result and the second hit determination result. In the case of a miss, an example was described in which the replacement process was executed by the LRU or random method. However, the replacement process is configured to change based on the hit status (frequent cache hits or cache misses). May be. Hereinafter, this configuration example will be described as a second embodiment.
第 4図は、 本発明にかかる実施の形態 2の構成を示すブロック図である。 この 図において、 第 1図の各部に対応する部分には同一の符号を付ける。 第 4図にお いては、 第 1図に示したキャッシュメモリ装置 1 0 0に代えて、 キャッシュメモ リ装置 2 0 0が設けられている。  FIG. 4 is a block diagram showing a configuration of a second exemplary embodiment of the present invention. In this figure, parts corresponding to the respective parts in FIG. 1 are denoted by the same reference numerals. In FIG. 4, a cache memory device 200 is provided in place of the cache memory device 100 shown in FIG.
また、 キャッシュメモリ装置 2 0 0においては、 第 1図に示したリプレース部 1 0 3に代えて、 リプレース部 2 0 1が設けられている。  In the cache memory device 200, a replacement unit 201 is provided in place of the replacement unit 103 shown in FIG.
リプレース部 2 0 1は、 第 5図に示したように、 C P U 1 0からの第 1のリク ェスト、 第 2のリクエストの有無、 後述するヒット状態に応じて、 キャッシュデ —タ R AM 2 3 (第 9図参照) でリプレースすべきウェイを所定の方式 (L R U 方式、 ランダム方式) で選択する機能を備えている。  As shown in FIG. 5, the replacement unit 201 stores the cache data RAM 23 according to the first request from the CPU 10, the presence or absence of the second request, and the hit state described later. (See Fig. 9) It has a function to select the way to be replaced by a predetermined method (LRU method, random method).
リプレース部 2 0 1においては、 第 1図に示した調停部 1 0 4に代えて、 ヒッ ト状態判定部 2 0 2および調停部 2 0 3が設けられている。 In the replacement section 201, a hitch is used in place of the arbitration section 104 shown in FIG. A state determination unit 202 and an arbitration unit 203 are provided.
ヒッ ト状態判定部 2 0 2は、 第 6図に示した状態遷移により、 ヒッ ト判定部 1 0 2におけるヒット判定結果 (第 1のヒット判定結果、 第 2のヒット判定結果) 、 キャッシュミスの傾向にある力 またはキャッシュヒットの傾向にあるかを 判定する。  The hit state determination unit 202 receives the hit determination results (the first hit determination result and the second hit determination result) in the hit determination unit 102 and the cache miss by the state transition shown in FIG. Determine if you have a tendency to tend or a cache hit.
具体的には、 ヒット状態判定部 2 0 2において、 ヒット判定部 1 0 2のヒット 判定結果 (第 1のヒット判定結果、 第 2のヒット判定結果) がキャッシュヒット である場合、 ヒット状態が一つ右へ遷移される。  Specifically, in the hit state determination unit 202, if the hit determination results (the first hit determination result and the second hit determination result) of the hit determination unit 102 are cache hits, the hit state is one. Transition to the right.
—方、 ヒッ ト判定部 1 0 2のヒッ ト判定結果 (第 1のヒット判定結果、 第 2の ヒット判定結果) がキヤッシュミスである場合、 ヒット状態が一つ左へ遷移され る。  On the other hand, if the hit judgment result (the first hit judgment result and the second hit judgment result) of the hit judging unit 102 is a cache miss, the hit state is shifted left by one.
例えば、 ヒット状態が 「0 1」 である場合に、 ヒット判定結果がキャッシュヒ ットである場合、 ヒット状態判定部 2 0 2は、 ヒット状態を右へ遷移させ、 「0 1」 から 「1 0」 とする。 続いて、 ヒッ ト判定結果がキャッシュヒットである場 合、 ヒット状態判定部 2 0 2は、 ヒット状態を右へ遷移させ、 「1 0」 から 「1 1」 とする。  For example, when the hit state is “0 1” and the hit determination result is a cache hit, the hit state determination unit 202 shifts the hit state to the right and changes “0 1” to “1”. 0 ”. Subsequently, when the hit determination result is a cache hit, the hit state determination unit 202 shifts the hit state to the right, and changes the state from “10” to “11”.
そして、 ヒット判定結果がキヤッシュミスになる場合、 ヒット状態判定部 2 0 2は、 ヒット状態を左へ遷移させ、 「1 1」 から 「1 0」 とする。 続いて、 ヒッ ト判定結果がキヤッシュミスである場合、 ヒット状態判定部 2 0 2は、 ヒット状 態を左へ遷移させ、 「1 0」 か 「0 1」 とする。  Then, when the hit determination result is a cache miss, the hit state determination unit 202 shifts the hit state to the left, and changes the state from “1 1” to “10”. Subsequently, when the hit determination result is a cache miss, the hit state determination unit 202 shifts the hit state to the left, and sets the hit state to “10” or “01”.
ヒット状態判定部 2 0 2は、 ヒット状態が「1 0」または「1 1」である場合、 ヒット判定結果が、 キヤッシュヒットの^!向にあるとして、 ヒット状態を 「キヤ ッシュヒッ ト」 として、 調停部 2 0 3へ通知する。  When the hit state is “1 0” or “1 1”, the hit state determination unit 202 determines that the hit determination result is in the ^! Direction of the cache hit, and sets the hit state as “cache hit”. The arbitration unit 203 is notified.
一方、 ヒット状態が 「0 0」 または 「0 1」 である場合、 ヒット判定結果が、 キャッシュミスの傾向にあるとして、 ヒット状態を 「キャッシュミス」 として、 調停部 2 0 3へ通知する。  On the other hand, if the hit state is “0 0” or “0 1”, the hit determination result is determined to be a cache miss, and the hit state is notified to the arbitration unit 203 as “cache miss”.
調停部 2 0 3は、第 5図に示したように、 C P U 1 0からの第 1のリクエスト、 第 2のリクエストの有無、 ヒット状態判定部 202で判定されたヒット状態に応 じて、 第 1のリクエストの処理、 第 2のリクエストの処理の調停を図る。 As shown in FIG. 5, the arbitration unit 203 receives the first request from the CPU 10, Arbitration of the processing of the first request and the processing of the second request is performed in accordance with the presence / absence of the second request and the hit state determined by the hit state determination unit 202.
すなわち、 第 5図に示したように、 ヒット状態が 「キャッシュミス」 (または 「キャッシュヒット」 ) において、 第 1のリクエストおよび第 2のリクエストが 共に無い (=0) 場合には、 いずれの処理もさせない。  In other words, as shown in FIG. 5, if the hit status is “cache miss” (or “cache hit”) and there is no first request and no second request (= 0), I will not let you.
また、 ヒット状態が 「キャッシュミス」 (または 「キャッシュヒッ'ト」 ) にお いて、 第 1のリクエストのみが有る場合 (=1) 、 すなわち、 第 1のヒット判定 結果のみがヒット判定部 102より入力された場合、 調停部 203は、 第 1のリ クエストを LRU方式で処理すべく、 第 1のヒット判定結果をシングルポート L RU * RAM 26へ渡す。  When the hit state is “cache miss” (or “cache hit”) and only the first request is present (= 1), that is, only the first hit determination result is If input, the arbitration unit 203 passes the first hit determination result to the single-port LRU * RAM 26 so that the first request is processed by the LRU method.
また、 ヒット状態が 「キャッシュミス」 (または 「キャッシュヒット」 ) にお いて、 第 2のリクエストのみが有る場合 (=1) 、 すなわち、 第 2のヒット判定 結果のみがヒット判定部 102より入力された場合、 調停部 203は、 第 2のリ クエストを LRU方式で処理すべく、 第 2のヒット判定結果をシングルポート L RU · RAM26へ渡す。  If the hit state is “cache miss” (or “cache hit”) and there is only the second request (= 1), that is, only the second hit determination result is input from the hit determination unit 102. In this case, the arbitration unit 203 passes the second hit determination result to the single-port LRU / RAM 26 in order to process the second request using the LRU method.
また、 ヒット状態が 「キャッシュミス」 において、 第 1のリクエストおよび第 2のリクエストの双方が同時に有る場合 (=1) 、 すなわち、 第 1のヒット判定 結果おょぴ第 2のヒット判定結果の双方が同時にヒット判定部 102より入力さ れた場合、 調停部 203は、 第 1のリクエストを LRU方式で処理すべく、 第 1 のヒット判定結果をシングルポート LRU . RAM26へ渡すとともに、 第 2の リクエストをランダム方式で処理すべく、 ランダムリプレースウェイ選択部 10 5へ渡す。  If the hit state is “cache miss” and both the first request and the second request are present at the same time (= 1), that is, both the first hit judgment result and the second hit judgment result Are input from the hit determination unit 102 at the same time, the arbitration unit 203 passes the first hit determination result to the single-port LRU.RAM 26 and processes the second request in order to process the first request by the LRU method. Is passed to the random replacement way selection unit 105 in order to process in a random manner.
ここで、 LRU方式によるリプレース処理は、 最も使用されたかったウェイを リプレースウェイとして選択しているため、 リプレースウェイがランダムに選択 されるランダム方式よりもキャッシュヒット率が高くなる。  Here, in the replacement processing by the LRU method, the way most used is selected as the replacement way, so that the cache hit rate is higher than the random method in which the replacement way is randomly selected.
従って、 ヒット状態がキャッシュミスの場合には、 キャッシュヒット率の向上 よりも、 ランダム方式によりリプレース処理を高速に実行し、 キャッシュミス時 に主記憶装置 30からデータをできるだけ早く持ってくることが優先される。 一方、 ヒット状態が 「キャッシュヒット」 において、 第 1のリクエストおよび 第 2のリクエス トの双方が同時に有る場合 (=1) 、 すなわち、 第 1のヒッ ト判 定結果および第 2のヒット判定結果の双方が同時にヒット判定部 102より入力 された場合、 調停部 203は、 第 1のリクエストを L RU方式で処理すべく、 第Therefore, when the hit state is a cache miss, the replacement process is executed at a higher speed by a random method than in the case of an improvement in the cache hit rate. The priority is to bring the data from the main storage device 30 as soon as possible. On the other hand, if the hit state is “cache hit” and both the first request and the second request are present at the same time (= 1), that is, the first hit judgment result and the second hit judgment result If both are input from the hit determination unit 102 at the same time, the arbitration unit 203 sets the arbitration unit 203 to process the first request using the LRU method.
1のヒット判定結果をシングルポート LRU · RAM26へ渡す。 Pass the hit judgment result of 1 to single port LRU · RAM26.
これに並行して、 ヒット状態判定部 202は、 第 2のヒット判定結果に対応す る第 2のリクエストをキャッシュタグ部 101に再投入する。 なお、 第 2のリク エストは、 ランダム方式で処理されない。  In parallel with this, the hit state determination unit 202 re-inputs the second request corresponding to the second hit determination result to the cache tag unit 101. Note that the second request is not processed in a random manner.
再投入された第 2のリクエストについては、 LRU方式によりリプレースゥェ ィ処理が実行される。  For the re-input second request, a replacement procedure is executed by the LRU method.
このように、 ヒット状態がキャッシュヒットの場合には、 リプレース処理を高 速に実行することよりも、 LRU方式によりキャッシュヒット率を向上させるこ とが優先される。  As described above, when the hit state is a cache hit, priority is given to improving the cache hit ratio by the LRU method rather than performing the replacement process at a high speed.
つぎに、 上述した実施の形態 2の動作について、 第 7図に示したフローチヤ一 トを参照しつつ説明する。  Next, the operation of the above-described second embodiment will be described with reference to the flowchart shown in FIG.
ステップ SC 1では、 ヒット判定部 102は、 CPU 10よりリクエスト (実 施の形態 2では、 データのリードの場合を例にとって説明) があるか否かを判断 し、 この場合、 判断結果を 「No」 として、 同判断を繰り返す。  In step SC1, the hit determination unit 102 determines whether or not there is a request from the CPU 10 (in the second embodiment, a case of reading data is described as an example). In this case, the hit determination unit 102 And repeat the same judgment.
そして、 CPU10より第 1のリクエストのみがあると、 ヒット判定部 102 は、 ステップ SC 1の判断結果を 「Ye s」 とする。 ステップ SC2では、 ヒッ ト判定部 102は、 キャッシュタグ RAM22にアクセスし、 CPU 10力 らの アドレスと、 キャッシュタグ RAM22のアドレスとを比較し、 第 1のリクエス トについてヒット判定を行う。  Then, when there is only the first request from the CPU 10, the hit determination unit 102 sets the determination result of step SC1 to “Yes”. In step SC2, the hit determination unit 102 accesses the cache tag RAM 22, compares the address from the CPU 10 with the address of the cache tag RAM 22, and makes a hit determination for the first request.
ステップ SC 3では、 ヒット判定部 102は、 キャッシュヒットした力否かを 判断し、 この場合、 判断結果を 「Ye s」 とする。 ステップ SC4では、 キヤッ シュデータ RAM23から CPU 10へ第 1のデータが転送される。 ステップ S C 5では、 ヒット状態判定部 202は、 第 1のリクエス トに対応す る第 1のヒット判定結果 (この場合、 「キヤッシュヒット」 ) に基づいて、 ヒッ ト状態を更新する。 例えば、 第 6図に示したヒット状態が 「01」 である場合、 ヒット状態判定部 202は、 上記キヤッシュヒットを受けて、 ヒット状態を 「 0 1」 から 「10」 に遷移させる。 これにより、 ヒッ ト状態は、 「キャッシュヒッ ト」 とされる。 In step SC3, the hit determination unit 102 determines whether or not a cache hit has been made. In this case, the result of the determination is “Yes”. In step SC4, the first data is transferred from the cache data RAM 23 to the CPU 10. In step SC5, the hit state determination unit 202 updates the hit state based on the first hit determination result (in this case, “cache hit”) corresponding to the first request. For example, when the hit state shown in FIG. 6 is “01”, the hit state determination unit 202 receives the cache hit and changes the hit state from “01” to “10”. As a result, the hit state is set to "cache hit".
また、 CPU10から第 1のリクエストおよび第 2のリクエストが同時にある と、 ヒット判定部 102は、ステップ S C 1の判断結果を 「Y e s」 とする。 ス テツプ SC 2では、 ヒッ ト判定部 102は、 キャッシュタグ RAM22にァクセ スし、 CPU 10からの各アドレスと、 キャッシュタグ RAM22のアドレスと を比較し、 第 1のリクエストおよぴ第 2のリクエストのそれぞれについてヒット 判定を行う。  Also, when there is a first request and a second request from the CPU 10 at the same time, the hit determination unit 102 sets the determination result of step S C1 to “Yes”. In step SC2, the hit determination unit 102 accesses the cache tag RAM 22, compares each address from the CPU 10 with the address of the cache tag RAM 22, and performs the first request and the second request. A hit judgment is made for each of.
ステップ S C 3では、 ヒット判定部 102は、 キャッシュヒットしたか否かを 判断し、 この場合、 判断結果を 「No」 とする。 ステップ SC 6では、 ヒット判 定部 102は、 リプレース部 201の調停部 203へ第 1のヒット判定結果(「キ ャッシュミス」 ) および第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知す る。  In step S C3, the hit determination unit 102 determines whether or not a cache hit has occurred, and in this case, the determination result is “No”. In step SC6, the hit determination section 102 notifies the arbitration section 203 of the replacement section 201 of the first hit determination result (“cache miss”) and the second hit determination result (“cache miss”).
ステップ S C 7では、 調停部 203は、 通知された第 1のヒット判定結果およ び第 2のヒット判定結果に基づいて、 同時複数のキャッシュミスがあるか否かを 判断し、 この場合、 判断結果を 「Ye s」 とする。  In step SC7, the arbitration unit 203 determines whether there are multiple cache misses at the same time based on the notified first hit determination result and the second hit determination result. Let the result be "Yes".
以後、 ステップ SC 8〜ステップ SC 13と、 ステップ S C 14〜ステップ S C21とが並列的に実行される。  Thereafter, steps SC8 to SC13 and steps SC14 to SC21 are executed in parallel.
すなわち、 ステップ SC 8では、 調停部 203は、 シングノレポート LRU · R AM 26へ第 1のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  That is, in step SC8, the arbitration unit 203 notifies the single hit report LRU RAM 26 of the first hit determination result (“cache miss”).
ステップ SC9では、 LRUリプレースウェイ選択部 27は、 第 1のヒット判 定結果 ( 「キャッシュミス」 ) を受けて、 シングルポート LRU · RAM26を 参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23における リプレースウェイを選択する。 In step SC9, the LRU replacement way selection unit 27 receives the first hit determination result (“cache miss”), refers to the single-port LRU RAM 26, and based on the LRU method described above, Select a replacement way.
ステップ SC 10では、 LRUリプレースウェイ選択部 27は、 主記憶装置 3 0へ、 ステップ SC 9で選択されたリプレースウェイに対応するリプレース要求 を出す。  In step SC10, the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SC9.
ステップ SC 1 1では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 1のデータを読み出す。ステップ SC 12では、主記憶装置 30は、 読み出した第 1のデータをキヤッシュデータ RAM 23へ転送する。  In step SC11, the main storage device 30 receives the replacement request and reads the first data from the address. In step SC12, the main storage device 30 transfers the read first data to the cache data RAM 23.
ステップ SC 13では、 LRUリプレースウェイ選択部 27で選択されたリブ レースウェイ (ライン) に第 1のデータが格納 (リプレース) されるというリブ レース処理が実行される。  In step SC13, a rib race process is executed in which the first data is stored (replaced) in the rib raceway (line) selected by the LRU replacement way selection unit 27.
ステップ SC4では、 キャッシュデータ RAM23から CPU10へ第 1のデ ータが転送される。  In step SC4, the first data is transferred from the cache data RAM 23 to the CPU 10.
ステップ SC 5では、 ヒット状態判定部 202は、 第 1のリクエストおよび第 2のリクエストに対応する第 1のヒット判定結果および第 2のヒット判定結果 (例えば、 共に 「キャッシュミス」 ) に基づいて、 ヒット状態を更新する。 この 場合、 第 6図に示したヒット状態が 「10」 であるため、 ヒット状態判定部 20 2は、 上記二つのキャッシュミスを受けて、 ヒット状態を 「10」 → 「01」 → 「00」 に遷移させる。 これにより、 ヒット状態は、 「キャッシュミス」 とされ る。  In step SC5, the hit state determination unit 202 determines, based on the first hit determination result and the second hit determination result corresponding to the first request and the second request (for example, both “cache miss”), Update hit status. In this case, since the hit state shown in FIG. 6 is “10”, the hit state determination unit 202 receives the above two cache misses, and changes the hit state from “10” to “01” to “00”. Transition to. As a result, the hit state is “cache miss”.
一方、 ステップ S C 14では、 調停部 203は、 ヒット状態判定部 202によ' り判定されたヒット状態がキャッシュヒットであるか否かを判断し、 この場合、 ヒット状態がキャッシュヒット 「10」 であるため、 判断結果を 「Ye sj とす る。  On the other hand, in step SC14, the arbitration unit 203 determines whether or not the hit state determined by the hit state determination unit 202 is a cache hit. In this case, the hit state is determined to be a cache hit “10”. Therefore, the judgment result is “Yesj”.
ステップ S C 21では、 調停部 203は、 第 2のヒット判定結果に対応する第 2のリクエストをキャッシュタグ部 101に再投入する。  In step SC21, the arbitration unit 203 re-inputs the second request corresponding to the second hit determination result to the cache tag unit 101.
これにより、 ヒット判定部 102は、 ステップ SC 1の判断結果を 「Ye s」 とする。 ステップ SC 2では、 ヒット判定部 102は、 キャッシュタグ RAM2 2にアクセスし、 CPU10力 らのアドレス (この場合、 再投入された第 2のリ クェスト) と、 キャッシュタグ RAM22のアドレスとを比較し、 第 2のリクェ ストについてヒット判定を行う。 この場合、 第 2のリクエストに対応する第 2の ヒット判定結果は、 キヤッシュミスであるとする。 Accordingly, the hit determination unit 102 sets the determination result of step SC1 to “Yes”. In step SC2, the hit determination unit 102 sets the cache tag RAM2 2 is accessed, an address from the CPU 10 and the like (in this case, the re-input second request) is compared with the address of the cache tag RAM 22, and hit judgment is performed for the second request. In this case, the second hit determination result corresponding to the second request is a cache miss.
ステップ SC 3では、 ヒット判定部 102は、 キャッシュヒットした力否かを 判断し、 この場合、 判断結果を 「No」 とする。 ステップ SC 6では、 ヒット判 定部 102は、 リプレース部 201の調停部 203へ第 2のヒット判定結果 (「キ ャッシュミス」 ) を通知する。  In step SC3, the hit determination unit 102 determines whether or not a cache hit has been made. In this case, the determination result is “No”. In step SC6, the hit determination unit 102 notifies the arbitration unit 203 of the replacement unit 201 of the second hit determination result (“cache miss”).
ステップ S C 7では、 調停部 203は、 通知された第 2のヒット判定結果に基 づいて、 同時複数のキャッシュミスがあるか否かを判断し、 この場合、 判断結果 を 「No」 とする。  In step S C7, the arbitration unit 203 determines whether there are multiple simultaneous cache misses based on the notified second hit determination result, and in this case, sets the determination result to “No”.
ステップ SC 8では、 調停部 203は、 シングルポート LRU · RAM26へ 第 2のヒット判定結果 ( 「キャッシュミス」 ) を通知する。  In step SC8, the arbitration unit 203 notifies the single-port LRU / RAM 26 of the second hit determination result (“cache miss”).
ステップ SC 9では、 LRUリプレースウェイ選択部 27は、'第 2のヒット判 定結果 ( 「キャッシュミス」 ) を受けて、 シングルポート LRU · RAM26を 参照し、 前述した LRU方式に基づいて、 キャッシュデータ RAM23における リプレースウェイを選択する。  In step SC9, the LRU replacement way selection unit 27 receives the second hit determination result (“cache miss”), refers to the single-port LRU · RAM 26, and executes the cache data Select the replacement way in RAM23.
ステップ SC 10では、 LRUリプレースウェイ選択部 27は、 主記憶装置 3 0へ、 ステップ SC9で選択されたリプレースウェイに対応するリプレース要求 を出す。  In step SC10, the LRU replacement way selection unit 27 issues a replacement request to the main storage device 30 corresponding to the replacement way selected in step SC9.
ステップ SC 1 1では、 主記憶装置 30は、 リプレース要求を受けて、 当該ァ ドレスから第 2のデータを読み出す。ステップ SC 12では、主記憶装置 30は、 読み出した第 2のデータをキャッシュデータ R AM 23へ転送する。  In step SC11, the main storage device 30 receives the replacement request and reads the second data from the address. In step SC12, the main storage device 30 transfers the read second data to the cache data RAM23.
ステップ SC 13では、 LRUリプレースウェイ選択部 27で選択されたリプ レースウェイ (ライン) に第 2のデータが格納 (リプレース) されるというリブ レース処理が実行される。  In step SC13, a rib race process is executed in which the second data is stored (replaced) in the replacement way (line) selected by the LRU replacement way selection unit 27.
ステップ SC 4では、 キャッシュデータ RAM 23から CPU 10へ第 2のデ ータが転送される。 ステップ S C 5では、 ヒット状態判定部 2 0 2は、 前述と同 様にして、 第 2のリクエストに対応する第 2のヒッ ト判定結果 ( 「キャッシュミ ス」 ) に基づいて、 ヒット状態を更新する。 なお、 ステップ S C 1 4の判断結果 力 S 「N o」 である場合には、 前述したステップ S B 1 3〜ステップ S B 1 8 (第 3図参照) と同様にして、 ステップ S C 1 5〜ステップ S C 2 0が実行される。 以上説明したように、 実施の形態 2によれば、 ヒット判定部 1 0 2のヒット判 定が共にキャッシュミスでありかつヒット状態判定部 2 0 2のヒット状態がキヤ ッシュヒットである場合、 第 1のリクエストに対応させて L R Uリプレースゥェ ィ選択部 2 7に第 1のウェイを選択させるとともに、 第 2のリクエストをキヤッ シュタグ部 1 0 1に再投入し、 ヒット判定部 1 0 2のヒット判定がキヤッシュミ スである場合、 第 2のリクエストに対応させて L R Uリプレースウェイ選択部 2 7にウェイを選択させることとしたので、 リプレース処理を高速に実行すること よりも、 キャッシュヒット率を向上させることを優先させることができる。 In step SC4, the second data is transferred from the cache data RAM 23 to the CPU 10. Data is transferred. In step SC5, the hit state determination unit 202 updates the hit state based on the second hit determination result (“cache miss”) corresponding to the second request in the same manner as described above. I do. If the result of the determination in step SC14 is S "No", the steps SC15 to SC18 are performed in the same manner as in steps SB13 to SB18 (see Fig. 3). 20 is executed. As described above, according to the second embodiment, if the hit determinations of the hit determination units 102 are both cache misses and the hit status of the hit status determination unit 202 is a cache hit, the first In response to the request, the LRU replacement way selection unit 27 selects the first way, re-inputs the second request to the cache tag unit 101, and the hit determination unit 102 In the case of a replacement, the LRU replacement way selection unit 27 is made to select a way in response to the second request, so priority is given to improving the cache hit rate rather than performing the replacement processing at high speed. Can be done.
以上本発明にかかる実施の形態 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, the specific configuration example is not limited to the first and second embodiments, and departs from the gist of the present invention. Even if there is a design change within the range not to be included, it is included in the present invention.
以上説明したように、 本発明によれば、 第 1のリクエストおよび第 2のリクェ ストに対応するヒット判定が共にキャッシュミスである場合、 第 1のリクエスト に対応させて第 1のウェイを選択させるとともに、 第 2のリクエストに対応させ てリプレースウェイ情報を使用せずにリプレース対象の第 2のゥヱイを選択させ ることとしたので、 シングルポートのリプレースウェイ情報保持手段で、 複数同 時アクセスに対応でき、 実装面積を削減しつつキャッシュ性能を向上させること ができるという効果を奏する。  As described above, according to the present invention, when the hit determinations corresponding to the first request and the second request are both cache misses, the first way is selected according to the first request. At the same time, the second way to be replaced is selected without using the replacement way information in response to the second request. This has the effect of improving the cache performance while reducing the mounting area.
また、 本発明によれば、 ヒット判定が共にキャッシュミスでありかつヒット状 態がキャッシュヒットである場合、 第 1のリクエストに対応させて第 1のウェイ を選択させるとともに、 第 2のリクエス トを再投入し、 ヒット判定がキャッシュ ミスである場合、 第 2のリクエス卜に対応させて第 1のウェイを選択させること としたので、 リプレース処理を高速に実行することよりも、 キャッシュヒット率 を向上させることを優先させることができるという効果を奏する。 産業上の利用可能性 Further, according to the present invention, when both the hit judgment is a cache miss and the hit state is a cache hit, the first way is selected in response to the first request, and the second request is made. Re-enter, if the hit judgment is a cache miss, let the first way be selected corresponding to the second request Therefore, there is an effect that it is possible to give priority to improving the cache hit rate rather than performing the replacement processing at high speed. Industrial applicability
以上のように、 本発明にかかるメモリ制御装置およびキャッシュリプレース制 御方法は、 キャッシュメモリのリプレースに対して有用である。  As described above, the memory control device and the cache replacement control method according to the present invention are useful for replacing a cache memory.

Claims

請 求 の 範 囲 The scope of the claims
1 . 上位装置と主記憶装置との間に設けられ、 複数ウェイ構成のキャッシュメモ リに対する制御を行うメモリ制御装置において、 1. A memory control device that is provided between a host device and a main storage device and controls a cache memory having a multi-way configuration.
前記キャッシュメモリのリプレースに関するリプレースウェイ情報を保持する リプレースウェイ情報保持手段と、  Replacement way information holding means for holding replacement way information related to replacement of the cache memory;
前記リプレースウェイ情報保持手段の前記リプレースウェイ情報に基づいて、 リプレース対象の第 1のウェイを選択する第 1のリプレースウェイ選択手段と、 前記リプレースゥエイ情報を使用せずにリプレース対象の第 2のウェイを選択 する第 2のリプレースウェイ選択手段と、  First replacement way selection means for selecting a first way to be replaced based on the replacement way information of the replacement way information holding means; andsecond replacement target without using the replacement path information. A second replacement way selection means for selecting a way;
前記上位装置から同時に発行され前記キャッシュメモリへのアクセスにかかる 第 1のリクエストおよび第 2のリクエストのそれぞれについてヒット判定を行う ヒット判定手段と、  Hit determination means for performing hit determination for each of a first request and a second request issued simultaneously from the higher-level device and accessing the cache memory;
前記第 1のリクエストおよび前記第 2のリクエストに対応する前記ヒット判定 が共にキャッシュミスである場合、 前記第 1のリクエストに対応させて前記第 1 のリプレースウェイ選択手段に前記第 1のウェイを選択させるとともに、 前記第 2のリクエストに対応させて前記第 2のリプレースウェイ選択手段に前記第 2の ウェイを選択させる調停手段と、  If the hit determinations corresponding to the first request and the second request are both cache misses, the first way is selected by the first replacement way selecting means in accordance with the first request. Arbitration means for causing the second replacement way selection means to select the second way in response to the second request;
を備えたことを特徴とするメモリ制御装置。  A memory control device comprising:
2 . 前記ヒット判定手段の前記ヒット判定に基づいて、 ヒット状態がキヤッシュ ヒットまたはキャッシュミスのうちいずれかの傾向にあるかを判定するヒット状 態判定手段を備え、 2. There is provided hit state determining means for determining whether the hit state is a cache hit or a cache miss based on the hit determination of the hit determining means,
前記調停手段は、  The arbitration means,
前記第 1のリクエストおよび前記第 2のリクエストに対応する前記ヒット判定 が共にキヤッシュミスであり力つ前記ヒット状態が前記キヤッシュミスである場 合、 前記第 1のリクエストに対応させて前記第 1のリプレースウェイ選択手段に 前記第 1のウェイを選択させるとともに、 前記第 2のリクエストに対応させて前 記第 2のリプレースウェイ選択手段に前記第 2のウェイを選択させる第 1の調停 手段と、 If the hit determinations corresponding to the first request and the second request are both cache misses and the hit state is the cache miss, the first request is made in correspondence with the first request. Replacement way selection means First arbitration means for selecting the first way and causing the second replacement way selection means to select the second way in response to the second request;
前記ヒット判定が共にキヤッシュミスでありかつ前記ヒット状態が前記キヤッ シュヒットである場合、 前記第 1のリクエストに対応させて前記第 1のリプレー スウェイ選択手段に前記第 1のウェイを選択させるとともに、 前記第 2のリクェ ストを前記ヒット判定手段に再投入し、 該ヒット判定手段のヒット判定がキヤッ シュミスである場合、 前記第 2のリクエストに対応させて前記第 1のリプレース ウェイ選択手段に前記第 1のウェイを選択させる第 2の調停手段と、  When both the hit determination is a cache miss and the hit state is the cache hit, the first replace way selecting means is caused to select the first way in response to the first request, The second request is re-input to the hit determination means, and if the hit determination of the hit determination means is a cache miss, the first replacement way selection means is provided with the first request in response to the second request. Second arbitration means for selecting the way
を備えたことを特徴とする請求の範囲第 1項に記載のメモリ制御装置。  2. The memory control device according to claim 1, comprising:
3 . 前記第 1のリプレースウェイ選択手段は、 最も使われていないデータを追い 出す方式に基づいて、 前記第 1のウェイを選択し、 前記第 2のリプレースウェイ 選択手段は、 ランダムに前記第 2のウェイを選択することを特徴とする請求の範 囲第 1項または第 2項に記載のメモリ制御装置。 3. The first replacement way selection means selects the first way based on a method of purging least used data, and the second replacement way selection means randomly selects the second replacement way. 3. The memory control device according to claim 1, wherein a way is selected.
4 . 上位装置と主記憶装置との間に設けられ、 複数ウェイ構成のキャッシュメモ リを有するキャッシュメモリ装置に適用されるキャッシュリプレース制御方法に おいて、 4. In a cache replacement control method provided between a host device and a main storage device and applied to a cache memory device having a cache memory having a multi-way configuration,
リプレースウェイ情報保持手段に保持され前記キヤッシュメモリのリプレース に関するリプレースウェイ情報に基づいて、 リプレース対象の第 1のウェイを選 択する第 1のリプレースウェイ選択工程と、  A first replacement way selection step of selecting a first way to be replaced based on replacement way information related to replacement of the cache memory held in replacement way information holding means;
前記リプレースゥヱイ情報を使用せずにリプレース対象の第 2のウェイを選択 する第 2のリプレースウェイ選択工程と、  A second replacement way selection step of selecting a second way to be replaced without using the replacement bay information;
前記上位装置から同時に発行され前記キヤッシュメモリへのアクセスにかかる 第 1のリクエストおよび第 2のリクエストのそれぞれについてヒット判定を行う ヒット判定工程と、 前記第 1のリクエストおよび前記第 2のリクエストに対応する前記ヒット判定 が共にキヤッシュミスである場合、 前記第 1のリクエストに対応させて前記第 1 のリプレースウェイ選択工程で前記第 1のウェイを選択させるとともに、 前記第 2のリクエストに対応させて前記第 2のリプレースウェイ選択工程で前記第 2の ウェイを選択させる調停工程と、 A hit determination step of performing a hit determination on each of a first request and a second request issued simultaneously from the higher-level device and accessing the cache memory; If the hit determinations corresponding to the first request and the second request are both cache misses, the first way is selected in the first replacement way selection step in accordance with the first request. An arbitration step of selecting the second way in the second replacement way selection step in response to the second request;
を含むことを特徴とするキャッシュリプレース制御方法。  And a cache replacement control method.
5 . 前記ヒット判定工程の前記ヒット判定に基づいて、 ヒット状態がキヤッシュ ヒットまたはキャッシュミスのうちいずれかの傾向にあるかを判定するヒット状 態判定工程を含み、 5. A hit state determining step of determining whether the hit state is a cache hit or a cache miss based on the hit determination in the hit determining step,
前記調停工程は、  The arbitration step,
前記第 1のリクエストおよび前記第 2のリクエストに対応する前記ヒット判定 が共にキヤッシュミスでありかつ前記ヒット状態が前記キヤッシュミスである場 合、 前記第 1のリクエストに対応させて前記第 1のリプレースウェイ選択工程で 前記第 1のウェイを選択させるとともに、 前記第 2のリクエストに対応させて前 記第 2のリプレースウェイ選択工程で前記第 2のウェイを選択させる第 1の調停 工程と、  If the hit determinations corresponding to the first request and the second request are both cache misses and the hit state is the cache miss, the first replacement is performed in response to the first request. A first arbitration step of selecting the first way in the way selection step, and selecting the second way in the second replacement way selection step in response to the second request;
前記ヒット判定が共にキヤッシュミスでありかつ前記ヒット状態が前記キヤッ シュヒットである場合、 前記第 1のリクエストに対応させて前記第 1のリプレー スウェイ選択工程で前記第 1のウェイを選択させるとともに、 前記第 2のリクェ ストを前記ヒット判定工程で再投入し、 該ヒット判定工程のヒット判定がキヤッ シュミスである場合、 前記第 2のリクエストに対応させて前記第 1のリプレース ウェイ選択工程で前記第 1のウェイを選択させる第 2の調停工程と、  If both the hit determination is a cache miss and the hit state is the cache hit, the first way is selected in the first replacement way selection step in response to the first request, and The second request is re-entered in the hit determination step. If the hit determination in the hit determination step is a cache miss, the first request is performed in the first replacement way selection step in response to the second request. A second arbitration process to select the way
を含むことを特徴とする請求の範囲第 4項に記載のキャッシュリプレース制御 方法。  5. The cache replacement control method according to claim 4, comprising:
PCT/JP2002/012137 2002-11-20 2002-11-20 Memory controller and cache replacement control method WO2004046933A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004553121A JP3940148B2 (en) 2002-11-20 2002-11-20 Memory control device and cache replacement control method
PCT/JP2002/012137 WO2004046933A1 (en) 2002-11-20 2002-11-20 Memory controller and cache replacement control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2002/012137 WO2004046933A1 (en) 2002-11-20 2002-11-20 Memory controller and cache replacement control method

Publications (1)

Publication Number Publication Date
WO2004046933A1 true WO2004046933A1 (en) 2004-06-03

Family

ID=32321514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2002/012137 WO2004046933A1 (en) 2002-11-20 2002-11-20 Memory controller and cache replacement control method

Country Status (2)

Country Link
JP (1) JP3940148B2 (en)
WO (1) WO2004046933A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017507443A (en) * 2014-12-14 2017-03-16 ヴィア アライアンス セミコンダクター カンパニー リミテッド Set associative cache memory with heterogeneous replacement policy
JP2021524078A (en) * 2018-05-18 2021-09-09 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Select one of several cache removal algorithms used to remove tracks from the cache

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5489438A (en) * 1977-12-08 1979-07-16 Honeywell Inf Systems Device for selecting memory location of cache memory
JPH02307140A (en) * 1989-05-22 1990-12-20 Fujitsu Ltd Substitute control system for buffer storage
JPH0415736A (en) * 1990-04-30 1992-01-21 Nec Corp Cache memory device
JPH06161900A (en) * 1992-09-24 1994-06-10 Matsushita Electric Ind Co Ltd Cache memory device
JPH10326226A (en) * 1997-04-14 1998-12-08 Internatl Business Mach Corp <Ibm> Method and system for selecting alternative cache entry for substitution in response to contention between caching operation requests
JP2000330869A (en) * 1999-05-19 2000-11-30 Hitachi Ltd Cache memory device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5489438A (en) * 1977-12-08 1979-07-16 Honeywell Inf Systems Device for selecting memory location of cache memory
JPH02307140A (en) * 1989-05-22 1990-12-20 Fujitsu Ltd Substitute control system for buffer storage
JPH0415736A (en) * 1990-04-30 1992-01-21 Nec Corp Cache memory device
JPH06161900A (en) * 1992-09-24 1994-06-10 Matsushita Electric Ind Co Ltd Cache memory device
JPH10326226A (en) * 1997-04-14 1998-12-08 Internatl Business Mach Corp <Ibm> Method and system for selecting alternative cache entry for substitution in response to contention between caching operation requests
JP2000330869A (en) * 1999-05-19 2000-11-30 Hitachi Ltd Cache memory device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017507443A (en) * 2014-12-14 2017-03-16 ヴィア アライアンス セミコンダクター カンパニー リミテッド Set associative cache memory with heterogeneous replacement policy
JP2021524078A (en) * 2018-05-18 2021-09-09 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Select one of several cache removal algorithms used to remove tracks from the cache
JP7216741B2 (en) 2018-05-18 2023-02-01 インターナショナル・ビジネス・マシーンズ・コーポレーション Select one of several cache deletion algorithms to use to remove tracks from the cache

Also Published As

Publication number Publication date
JPWO2004046933A1 (en) 2006-03-16
JP3940148B2 (en) 2007-07-04

Similar Documents

Publication Publication Date Title
EP0637800B1 (en) Data processor having cache memory
US8219780B2 (en) Mitigating context switch cache miss penalty
US7441054B2 (en) Method of accessing internal memory of a processor and device thereof
US9164772B2 (en) Hybrid queue for storing instructions from fetch queue directly in out-of-order queue or temporarily in in-order queue until space is available
KR100955722B1 (en) Microprocessor including cache memory supporting multiple accesses per cycle
US6161167A (en) Fully associate cache employing LRU groups for cache replacement and mechanism for selecting an LRU group
CN1297903C (en) Method and apparatus for pipelining ordered input/output transactions in a cache coherent multi-processor system
US8954681B1 (en) Multi-stage command processing pipeline and method for shared cache access
WO2000039764A9 (en) A dual-ported pipelined two level cache system
WO1998027492A1 (en) Cache hierarchy management with locality hints for different cache levels
EP1815343A2 (en) Cache with prefetch
JP2008107983A (en) Cache memory
US20080320240A1 (en) Method and arrangements for memory access
US8214617B2 (en) Apparatus and method of avoiding bank conflict in single-port multi-bank memory system
JP2009512933A (en) Cache with accessible store bandwidth
US7461211B2 (en) System, apparatus and method for generating nonsequential predictions to access a memory
WO2004046933A1 (en) Memory controller and cache replacement control method
US20070226382A1 (en) Method for improving direct memory access performance
JPH06202951A (en) Cash memory system
JP4266900B2 (en) Image processing system
JP4409620B2 (en) Arithmetic processing device, cache memory control device and control method
JP4750889B2 (en) Cache memory control device and pipeline control method
US6687821B1 (en) System for dynamically configuring system logic device coupled to the microprocessor to optimize application performance by reading from selection table located in non-volatile memory
US7181575B2 (en) Instruction cache using single-ported memories
EP1596280A1 (en) Pseudo register file write ports

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP US

WWE Wipo information: entry into national phase

Ref document number: 2004553121

Country of ref document: JP