KR100851298B1 - Cache memory controller and method for managing cache memory using the same - Google Patents

Cache memory controller and method for managing cache memory using the same Download PDF

Info

Publication number
KR100851298B1
KR100851298B1 KR1020050131344A KR20050131344A KR100851298B1 KR 100851298 B1 KR100851298 B1 KR 100851298B1 KR 1020050131344 A KR1020050131344 A KR 1020050131344A KR 20050131344 A KR20050131344 A KR 20050131344A KR 100851298 B1 KR100851298 B1 KR 100851298B1
Authority
KR
South Korea
Prior art keywords
data
cache memory
address
requested
entry
Prior art date
Application number
KR1020050131344A
Other languages
Korean (ko)
Other versions
KR20070069346A (en
Inventor
이태훈
이병옥
Original Assignee
엠텍비젼 주식회사
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 엠텍비젼 주식회사 filed Critical 엠텍비젼 주식회사
Priority to KR1020050131344A priority Critical patent/KR100851298B1/en
Publication of KR20070069346A publication Critical patent/KR20070069346A/en
Application granted granted Critical
Publication of KR100851298B1 publication Critical patent/KR100851298B1/en

Links

Images

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/122Replacement control using replacement algorithms of the least frequently used [LFU] type, e.g. with individual count value
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches

Abstract

본 발명은 캐시 메모리 컨트롤러 및 이를 이용한 캐시 메모리 관리 방법에 관한 것으로서, 외부로부터 요청되는 데이터의 어드레스를 입력받아 요청될 데이터의 예측 어드레스를 추정하는 어드레스 추정부; 및 상기 외부로부터 요청되는 데이터가 캐시 메모리에 존재하지 않는 경우, 상기 어드레스 추정부로부터 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리로부터 교체할 엔트리로 선택하는 교체 대상 엔트리 선택부를 포함하는 것을 특징으로 하는 캐시 메모리 컨트롤러 및 이를 이용한 캐시 메모리 관리 방법을 제공한다.The present invention relates to a cache memory controller and a cache memory management method using the same, comprising: an address estimator configured to receive an address of data requested from the outside and estimate a predicted address of the requested data; And a replacement target entry selector configured to select, as an entry to replace from the cache memory, an entry that does not include a predicted address of the requested data estimated from the address estimator when the data requested from the outside does not exist in the cache memory. A cache memory controller and a cache memory management method using the same are provided.

캐시 메모리, 엔트리 교체 Cache memory, entry replacement

Description

캐시 메모리 컨트롤러 및 이를 이용한 캐시 메모리 관리 방법{Cache memory controller and method for managing cache memory using the same}Cache memory controller and method for managing cache memory using the same}

도 1은 본 발명의 바람직한 일실시예에 따른 캐시 메모리 컨트롤러(10)의 연결관계를 나타낸 도면,1 is a view showing a connection relationship between the cache memory controller 10 according to an embodiment of the present invention,

도 2는 캐시 메모리 컨트롤러(10)의 상세 구성을 나타낸 블록도,2 is a block diagram showing a detailed configuration of the cache memory controller 10;

도 3은 캐시 메모리 컨트롤러의 동작을 나타낸 순서도이다.3 is a flowchart illustrating an operation of a cache memory controller.

<도면 주요 부분의 부호에 대한 설명><Description of Signs of Major Parts of Drawings>

10...캐시 메모리 컨트롤러, 20...캐시 메모리,10 ... cache memory controller, 20 ... cache memory,

30...CPU, 40...주기억장치,30 ... CPU, 40 ... main memory,

본 발명은 캐시 메모리 컨트롤러 및 이를 이용한 캐시 메모리 관리 방법에 관한 것으로서, 특히 캐시 메모리에 저장된 데이터를 교체하는 방법을 보완하여 보 다 효율적이고 속도 증가를 가져올 수 있는 캐시 메모리 컨트롤러 및 이를 이용한 캐시 메모리 관리 방법에 관한 것이다.The present invention relates to a cache memory controller and a cache memory management method using the same, and in particular, a cache memory controller and a cache memory management method using the same, which are more efficient and can increase speed by supplementing a method of replacing data stored in the cache memory. It is about.

캐시 메모리(cache memory)는 일반적으로 주기억장치와 CPU 사이에 위치하는 고속의 기억장치로서 CPU로부터 주기억장치에 대한 메모리 참조는 대부분 국한된 영역에서 이루어진다는 점을 이용하여 메모리 액세스 시간을 감소하여 프로그램의 수행시간을 단축시키기 위한 메모리로서, 널리 사용되고 있다.Cache memory is a high-speed memory generally located between the main memory and the CPU. The memory reference from the CPU to the main memory is mostly performed in localized areas, thereby reducing the memory access time and executing the program. It is widely used as a memory for shortening the time.

이러한 캐시 메모리는 주기억장치와 CPU 사이에서 CPU 등으로부터의 메모리 액세스 요청이 있을 때 주기억장치에 액세스하기 전에 캐시 메모리를 우선 참조하고 원하는 데이터가 발견되면 데이터를 읽어 들여 CPU로 전송하고(이를 일반적으로 "히트(hit)"라 한다), 원하는 데이터가 발견되지 않으면 주기억장치로 메모리 액세스를 요청하게 된다(이를 "미스(miss)"라 한다).This cache memory first references the cache memory before accessing the main memory when there is a memory access request from the CPU, etc. between the main memory and the CPU, reads the data and sends it to the CPU when the desired data is found (usually " Hit ") If the desired data is not found, the main memory is requested to access the memory (this is called a" miss ").

캐시 메모리를 효율적으로 관리하고 메모리 액세스 시간을 감소시켜 프로그램의 전체 수행 속도를 증가시키기 위해서는 이러한 히트율이 높아야 하는데, 이를 위해서는 캐시 메모리와 주기억장치간에 데이터를 어떻게 교체(replacement)할 것인가가 중요한 문제로 작용한다.In order to efficiently manage cache memory and reduce memory access time to increase the overall execution speed of a program, this hit rate must be high.However, how to replace data between cache memory and main memory is an important issue. Works.

캐시 메모리와 주기억장치간에 데이터를 교체하는 방법으로는, 가장 적게 사용된 엔트리를 선택하는 방식(LRU, Least Recently Used), 가장 최근에 사용된 엔트리를 선택하는 방식(MRU, Most Recently Used) 또는 가장 먼저 저장된 엔트리를 선택하는 방식(FIFO, First In First Out) 등이 있다. 보통 캐시 메모리 컨트롤러에서는 이러한 방식들 중 어느 하나 또는 이들의 조합을 선택하여 사용하게 되는 데, 이러한 방식에 의해 교체할 엔트리가 선택된 경우 해당 엔트리에 주기억장치로부터 새로 로드되는 데이터를 저장하게 된다.The way data is exchanged between cache memory and main memory is by selecting the least used entry (LRU), by selecting the most recently used entry (MRU, Most Recently Used). One way is to select the first stored entry (FIFO, First In First Out). In general, the cache memory controller selects and uses any one or a combination of these methods. When an entry to be replaced is selected by this method, the newly loaded data from the main memory is stored in the entry.

그러나, 이러한 방식에 의하면 예컨대 교체 대상으로 선택된 엔트리가 현재 요청된 데이터의 다음 데이터를 포함하고 있는 경우에 문제가 될 수 있다. 예컨대, LRU 방식의 경우 다음에 요청되는 데이터가 바로 전 단계에서 교체된 캐시 엔트리에 포함되어 있는 경우 이를 다시 주기억장치에서 불러 들여 캐시 메모리에 저장해야 한다. 더구나, 이러한 과정이 연속적으로 이루어진다면 캐시 메모리 및 주기억장치로 인한 메모리 액세스 타임이 오히려 현저하게 증가할 수 있다는 문제점이 있다.However, this approach can be problematic, for example, if the entry selected for replacement includes the next data of the currently requested data. For example, in the case of the LRU method, when the next requested data is included in the cache entry replaced in the previous step, the LRU method needs to retrieve it from the main memory and store it in cache memory. Moreover, if this process is performed continuously, there is a problem that the memory access time due to the cache memory and the main memory can be significantly increased.

본 발명은 상기한 바와 같은 문제점을 감안하여 안출된 것으로서, 캐시 메모리와 주기억장치간에 데이터를 교체하는 방법을 보완하여, 현재 요청되는 데이터 다음에 요청될 데이터의 어드레스를 추정하여 요청될 데이터의 어드레스를 포함하지 않는 엔트리를 교체할 엔트리로 선택함으로써 보다 효율적이고 속도 증가를 가져올 수 있는 캐시 메모리 컨트롤러 및 캐시 메모리 관리 방법을 제공하는 것을 목적으로 한다.SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and complements the method of replacing data between the cache memory and the main memory, thereby estimating the address of the data to be requested next to the currently requested data, thereby determining the address of the data to be requested. It is an object of the present invention to provide a cache memory controller and a cache memory management method capable of bringing more efficient and speed-up by selecting an entry which is not included as a replacement item.

상기한 바와 같은 목적을 달성하기 위한 본 발명은, 데이터를 저장하는 복수 개의 엔트리를 포함하는 캐시 메모리를 관리하는 캐시 메모리 컨트롤러에 있어서, 외부로부터 요청되는 데이터의 어드레스를 입력받아 요청될 데이터의 예측 어드레스를 추정하는 어드레스 추정부; 및 상기 외부로부터 요청되는 데이터가 캐시 메모리에 존재하지 않는 경우, 상기 어드레스 추정부로부터 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리로부터 교체할 엔트리로 선택하는 교체 대상 엔트리 선택부를 포함하는 것을 특징으로 하는 캐시 메모리 컨트롤러를 제공한다.According to an aspect of the present invention, there is provided a cache memory controller for managing a cache memory including a plurality of entries for storing data. An address estimator for estimating a value; And a replacement target entry selector configured to select, as an entry to replace from the cache memory, an entry that does not include a predicted address of the requested data estimated from the address estimator when the data requested from the outside does not exist in the cache memory. A cache memory controller is provided.

여기에서, 상기 교체 대상 엔트리 선택부는, LRU(Least Recently Used), MRU(Most Recently Use) 또는 FIFO(First In First Out) 방식 중 적어도 어느 하나에 의해 교체 엔트리를 선택하고, 상기 교체 엔트리가 요청될 데이터의 예측 어드레스를 포함하지 않는 경우 교체할 엔트리로 최종 선택하도록 구성할 수 있다.Here, the replacement target entry selector may select a replacement entry by at least one of a least recently used (LRU), most recently use (MRU), or first in first out (FIFO) scheme, and the replacement entry may be requested. If it does not include the predicted address of the data, it can be configured to make a final selection as an entry to be replaced.

또한, 상기 어드레스 추정부는, 요청되는 데이터의 어드레스를 순차적으로 저장하고 순차적으로 저장된 어드레스들로부터 변화율을 계산하여 요청될 데이터의 예측 어드레스를 추정하도록 구성할 수 있다.In addition, the address estimator may be configured to sequentially store the address of the requested data and calculate a rate of change from the sequentially stored addresses to estimate the predicted address of the requested data.

또한, 상기 어드레스 추정부는, 외부로부터 요청되는 데이터의 어드레스의 변화율을 더 입력받아, 요청되는 데이터의 어드레스 및 상기 입력받은 변화율에 의거하여 요청될 데이터의 예측 어드레스를 추정하도록 구성할 수 있다.The address estimator may further receive a rate of change of the address of data requested from the outside and estimate the predicted address of the requested data based on the address of the requested data and the received rate of change.

본 발명의 다른 측면에 의하면, 데이터를 저장하는 복수개의 엔트리를 포함하는 캐시 메모리를 관리하는 캐시 메모리 컨트롤러에서 캐시 메모리를 관리하는 방법에 있어서, 외부로부터 요청되는 데이터의 어드레스로부터 요청될 데이터의 예 측 어드레스를 추정하는 단계; 및 상기 외부로부터 요청되는 데이터가 캐시 메모리에 존재하지 않는 경우, 상기 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리로부터 교체할 엔트리로 선택하는 단계를 포함하는 것을 특징으로 하는 캐시 메모리 관리 방법을 제공한다.According to another aspect of the present invention, a method of managing a cache memory in a cache memory controller that manages a cache memory including a plurality of entries for storing data, the prediction of data to be requested from an address of the data requested from the outside Estimating an address; And selecting an entry that does not include the estimated address of the estimated requested data as an entry to be replaced from the cache memory when the data requested from the outside does not exist in the cache memory. Provide management methods.

여기에서, 상기 교체할 엔트리를 선택하는 단계는, LRU(Least Recently Used), MRU(Most Recently Use) 또는 FIFO(First In First Out) 방식 중 적어도 어느 하나에 의해 교체 엔트리를 선택하고, 상기 교체 엔트리가 요청될 데이터의 예측 어드레스를 포함하지 않는 경우 교체할 엔트리로 최종 선택할 수 있다.The selecting of the entry to be replaced may include selecting a replacement entry by at least one of a least recently used (LRU), most recently use (MRU), or first in first out (FIFO) method, and the replacement entry. If does not include the predicted address of the data to be requested, the final selection may be made as an entry to replace.

또한, 상기 예측 어드레스를 추정하는 단계는, 요청되는 데이터의 어드레스를 순차적으로 저장하고 순차적으로 저장된 어드레스들로부터 변화율을 계산하여 요청될 데이터의 예측 어드레스를 추정할 수 있다.In the estimating of the prediction address, the prediction address of the data to be requested may be estimated by sequentially storing the address of the requested data and calculating a rate of change from the sequentially stored addresses.

또한, 상기 예측 어드레스를 추정하는 단계부는, 외부로부터 요청되는 데이터의 어드레스의 변화율을 더 입력받고, 요청되는 데이터의 어드레스 및 상기 입력받은 변화율에 의거하여 요청될 데이터의 예측 어드레스를 추정할 수 있다.The estimating unit may further receive a rate of change of the address of the data requested from the outside, and estimate the predicted address of the requested data based on the address of the requested data and the received rate of change.

이하, 첨부 도면을 참조하여 본 발명의 바람직한 실시예를 상세하게 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 바람직한 일실시예에 따른 캐시 메모리 컨트롤러(10)의 연결관계를 나타낸 도면이다.1 is a diagram illustrating a connection relationship between a cache memory controller 10 according to an exemplary embodiment of the present invention.

도 1을 참조하면, 캐시 메모리 컨트롤러(10)는 CPU(Central Processing Unit,30)와 주기억장치(40) 사이에 연결되며, 캐시 데이터를 저장하는 캐시메모리(20)와 연결된다.Referring to FIG. 1, a cache memory controller 10 is connected between a central processing unit (CPU) 30 and a main memory 40, and is connected to a cache memory 20 storing cache data.

여기에서, 캐시 메모리(20)는 종래 일반적으로 사용되는 캐시 메모리로써, 주기억장치(40)에 로드(load)된 데이터 중에서 일부 데이터를 저장하고 있는 고속의 비교적 소용량의 메모리 수단이다. 캐시 메모리(20)는 일반적으로 복수개의 엔트리(entry)를 구비하며 데이터의 입출력은 보통 엔트리 단위로 이루어진다. 엔트리는 캐시 메모리가 데이터가 입출력되는 복수개의 단위로 구분되어 있음을 표현하기 위한 것으로서, 페이지(page) 또는 블록(block) 등으로 표현하기도 한다.Here, the cache memory 20 is a cache memory generally used in the related art and is a high speed relatively small memory means for storing some data among data loaded in the main memory 40. The cache memory 20 generally includes a plurality of entries, and input / output of data is usually performed in units of entries. The entry is used to express that the cache memory is divided into a plurality of units through which data is inputted and outputted, and may also be expressed as a page or a block.

CPU(30)는 중앙처리장치로서 컴퓨터 등에서 일반적으로 사용되는 프로세싱 장치를 말하는 것으로서, 명령어(instruction) 등의 처리에 필요한 데이터를 캐시 메모리(20) 또는 주기억장치(40)로 요청하여 데이터를 수신한 후, 명령어 등의 처리를 수행하게 된다.The CPU 30 refers to a processing apparatus generally used in a computer or the like as a central processing unit. The CPU 30 requests data from the cache memory 20 or the main memory 40 to receive data necessary for processing an instruction or the like and receives the data. After that, the processing of the command is performed.

주기억장치(40)는 메모리 수단으로서 비용상의 이유로 일반적으로 불휘발성 메모리 소자를 사용하는 것이 보통이며, 캐시 메모리(20)에 비해 메모리 액세스 타임 등이 느린 것이 보통이다.The main memory 40 generally uses a nonvolatile memory element for cost reasons as a memory means, and a memory access time is generally slower than that of the cache memory 20.

캐시 메모리 컨트롤러(10)는 캐시 메모리(20)의 전반적인 동작을 제어한다. 즉, 주기억장치(40)에 로드되어 있는 데이터 중에서 어떠한 데이터를 캐시 메모리(20)에 저장할 것인지, 캐시 메모리(20)가 가득차서 일부 엔트리를 교체해야 하는 경우 어떠한 엔트리를 교체할 것인지에 대한 동작과 CPU(30)로부터 요청되는 데이터가 캐시 메모리(20)에 존재하는지를 판단하기 위한 내부 알고리듬 및 이를 처리 하기 위한 구성을 포함한다. 이를 위하여, 캐시 메모리 컨트롤러(10)는 주기억장치(40)의 데이터와의 연관 관계를 나타내는 매핑 테이블(mapping table) 등을 사용할 수 있다.The cache memory controller 10 controls the overall operation of the cache memory 20. That is, an operation for determining which data is to be stored in the cache memory 20 among the data loaded in the main memory 40, and which entries are replaced when the cache memory 20 is full and some entries need to be replaced. And an internal algorithm for determining whether data requested from 30 exists in the cache memory 20, and a configuration for processing the same. To this end, the cache memory controller 10 may use a mapping table indicating an association relationship with data of the main memory 40.

이러한 연결 구성하에서, 본 실시예에 의한 캐시 메모리 컨트롤러(10)는, CPU(30)로부터 요청되는 데이터가 캐시 메모리에 존재하지 않는 경우 주기억장치(40)로 데이터를 요청하고 캐시 메모리(20)에서 교체할 엔트리를 선택함에 있어 CPU(30)로부터 추후 요청될 데이터를 예측하여 추후 요청될 데이터가 교체할 엔트리에 포함되어 있는가를 판단하여 교체할 엔트리를 선택하는 것을 특징으로 한다.Under such a connection configuration, the cache memory controller 10 according to the present embodiment requests data to the main memory 40 when the data requested from the CPU 30 does not exist in the cache memory, and the cache memory 20 requests the data from the cache memory 20. In selecting an entry to be replaced, the CPU 30 may predict the data to be requested later, and determine whether the data to be requested later is included in the entry to be replaced.

이에 대해서는 도 2를 참조하여 보다 상세하게 설명한다.This will be described in more detail with reference to FIG. 2.

도 2는 도 1의 캐시 메모리 컨트롤러(10)의 상세 구성을 나타낸 블록도이다.FIG. 2 is a block diagram illustrating a detailed configuration of the cache memory controller 10 of FIG. 1.

도 2에 나타낸 바와 같이, 캐시 메모리 컨트롤러(10)는, CPU(30)로부터 요청되는 데이터의 어드레스를 입력받아 요청될 데이터의 예측 어드레스를 추정하는 어드레스 추정부(11)와, 상기 CPU(30)로부터 요청되는 데이터가 캐시 메모리(20)에 존재하지 않는 경우, 상기 어드레스 추정부(11)로부터 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리(20)로부터 교체할 엔트리로 선택하는 교체 대상 엔트리 선택부(12)를 포함한다.As shown in FIG. 2, the cache memory controller 10 receives an address of data requested from the CPU 30, an address estimator 11 estimating a predicted address of the data to be requested, and the CPU 30. If the data requested from the cache memory 20 does not exist, the entry that does not include the predicted address of the requested data estimated from the address estimator 11 is selected as an entry to replace from the cache memory 20. A replacement target entry selector 12;

또한, 캐시 메모리 컨트롤러(10)는 캐시 메모리(20)와 연결되어 제어 신호와 데이터를 송수신한다. 캐시 메모리(20)는 도 2에 나타낸 바와 같이 예컨대 n개의 엔트리를 구비하며 각 엔트리는 엔트리 교체시 등에 필요한 플래그나 카운터 (counter, 21)를 포함할 수 있다.In addition, the cache memory controller 10 is connected to the cache memory 20 to transmit and receive control signals and data. The cache memory 20 has, for example, n entries as shown in FIG. 2, and each entry may include a flag or counter 21 required for entry replacement.

어드레스 추정부(11)는 CPU(30)로부터 현재 요청되는 데이터의 어드레스를 입력받는 동시에 도 2에 나타낸 바와 같이 어드레스 예측값을 입력받는다. 어드레스 예측값은 CPU(30)의 내부 레지스터 등에 미리 저장되어 있는 명령어나 데이터값을 사용할 수 있으며, 어드레스 추정부(10)는 입력되는 어드레스 예측값을 이용하여 현재 CPU(30)로부터 요청된 데이터를 제외하고 다음 단계 또는 그 다음 단계 등 추후 사용(요청)될 데이터가 저장되어 있는 어드레스를 추정한다.The address estimating unit 11 receives the address of the data currently requested from the CPU 30 and at the same time receives the address prediction value as shown in FIG. The address predictor may use an instruction or data value pre-stored in an internal register of the CPU 30. The address estimator 10 excludes data currently requested from the CPU 30 by using the input address predictor. Estimate the address where the data to be used (requested) is stored, such as the next step or the next step.

추후 요청될 데이터의 예측 어드레스가 추정되면. 어드레스 추정부(11)는 추정된 예측 어드레스를 교체 대상 엔트리 선택부(12)로 전송한다.If a predicted address of data to be requested later is estimated. The address estimator 11 transmits the estimated prediction address to the replacement target entry selector 12.

교체 대상 엔트리 선택부(12)는 우선 CPU(30)로부터 현재 요청된 데이터가 캐시 메모리(20)에 존재하는지를 판단하고, 캐시 메모리(20)에 해당 데이터가 존재하면 요청된 데이터를 CPU(30)로 전송한다.The replacement target entry selector 12 first determines whether data currently requested from the CPU 30 exists in the cache memory 20, and if the corresponding data exists in the cache memory 20, the requested data is sent to the CPU 30. To send.

요청된 데이터가 캐시 메모리(20)에 존재하지 않는 경우, 캐시 메모리 컨트롤러(10)는 해당 데이터를 주기억장치(40)로 요청하고, 캐시 메모리(20)에서 교체할 엔트리를 선택한다.If the requested data does not exist in the cache memory 20, the cache memory controller 10 requests the corresponding data to the main memory 40, and selects an entry to be replaced in the cache memory 20.

앞서 설명한 바와 같이, 캐시 메모리(20)는 보통 복수개의 엔트리(페이지, 블록)를 구비하고 엔트리 단위로 데이터의 입출력, 저장, 삭제 등의 동작이 이루어지는데, 캐시 메모리(20)에서 교체할 엔트리를 선택하는 방법으로서는 가장 적게 사용된 엔트리를 선택하는 방식(LRU, Least Recently Used), 가장 최근에 사용된 엔트리를 선택하는 방식(MRU, Most Recently Used) 또는 가장 먼저 저장된 엔트리 를 선택하는 방식(FIFO, First In First Out) 등이 있으며, 보통 이러한 방식 중에서 필요한 방식을 적절하게 선택 또는 조합하여 사용할 수 있다.As described above, the cache memory 20 generally includes a plurality of entries (pages and blocks), and operations such as input / output, storage, and deletion of data are performed in units of entries. The cache memory 20 replaces entries to be replaced. The selection method may include selecting the least recently used entry (LRU, least recently used), selecting the most recently used entry (MRU, Most Recently Used), or selecting the first stored entry (FIFO, First In First Out), and these methods can usually be selected or used as appropriate.

본 발명에 의한 캐시 메모리 컨트롤러(10)는 이러한 엔트리 교체 대상 선택 방식 들 중 어떠한 것들과도 결합하여 사용할 수 있다. 즉, LRU 방식이든 MRU 방식이든 또는 FIFO 방식이든 교체할 엔트리가 선택되면, 교체할 엔트리가 어드레스 추정부(11)에서 추정된 예측 어드레스에 대한 데이터를 포함하고 있는지를 판단한다. The cache memory controller 10 according to the present invention can be used in combination with any of these entry replacement object selection schemes. That is, if an entry to be replaced is selected, whether in the LRU method, the MRU method, or the FIFO method, it is determined whether the entry to be replaced includes data for the predicted address estimated by the address estimator 11.

만약, 추정된 예측 어드레스에 대한 데이터를 포함하지 않는다면 해당 엔트리를 교체할 엔트리로 최종 선택하고 주기억장치(40)로부터 전송되는 데이터를 해당 엔트리에 기록한다. 추정된 예측 어드레스를 포함하는 경우에는, 해당 엔트리를 제외한 나머지 엔트리에 대해서 앞서의 과정을 반복함으로써 교체할 엔트리를 선택하게 된다.If the data for the estimated prediction address is not included, the entry is finally selected as an entry to be replaced, and the data transmitted from the main memory 40 is recorded in the entry. In the case of including the estimated prediction address, an entry to be replaced is selected by repeating the above process for the remaining entries except for the corresponding entry.

이러한 과정을 도 3의 순서도에 나타내었다.This process is shown in the flowchart of FIG. 3.

도 3을 참조하면, 우선 CPU(40)로부터 데이터가 요청되면 캐시 메모리 컨트롤러(10)는 해당 데이터가 캐시 메모리(20)에 존재하는지를 판단한다(S100).Referring to FIG. 3, first, when data is requested from the CPU 40, the cache memory controller 10 determines whether the corresponding data exists in the cache memory 20 (S100).

캐시 메모리(20)에 해당 데이터가 존재한다면 엔트리들의 우선 순위 등을 갱신하고(S140), 요청된 데이터를 출력한다(S150).If the data exists in the cache memory 20, the priority of the entries is updated (S140), and the requested data is output (S150).

엔트리들의 우선 순위 갱신은 도 2의 플래그 또는 카운터(21)를 사용할 수 있다. 예컨대, LRU 방식에 의해 교체 대상 엔트리를 결정하는 경우, 일정 시간 마다 카운터(21)를 1씩 증가시키되 참조된 엔트리의 카운터는 참조시마다 0으로 한 다. 이렇게 하면 최근에 가장 적게 쓰인 엔트리가 가장 높은 값을 가지게 되므로 교체할 엔트리를 쉽게 선택할 수 있다. LRU 방식의 경우 엔트리의 우선 순위 갱신은 참조되지 않은 엔트리의 카운터(21)를 1씩 증가시키고 참조된 엔트리의 카운터(21)값을 0으로 하는 것을 의미한다.Priority update of entries may use the flag or counter 21 of FIG. 2. For example, when the replacement target entry is determined by the LRU method, the counter 21 is incremented by 1 every predetermined time, but the counter of the referenced entry is set to 0 at each reference. This ensures that the least recently used entry has the highest value, making it easier to select the entry to replace. In the case of the LRU scheme, updating the priority of an entry means incrementing the counter 21 of an unreferenced entry by one and setting the counter 21 value of the referenced entry to zero.

다른 방식 예컨대 MRU, FIFO 등의 경우에도 적절하게 우선순위를 갱신하거나 필요한 경우 우선순위 갱신 이외의 다른 방법을 사용할 수 있다.Other methods, such as MRU, FIFO, etc. may also be used to update the priority as appropriate, or use a method other than the priority update if necessary.

한편, 단계(S100)에서 요청된 데이터가 캐시 메모리(20)에 존재하지 않는 경우 어드레스 추정부(11)는 CPU(30)로부터 입력되는 어드레스 예측값에 의거하여 추후 요청될 데이터에 대한 예측 어드레스를 추정한다(S110).On the other hand, when the data requested in step S100 does not exist in the cache memory 20, the address estimator 11 estimates a predicted address for data to be requested later based on an address predicted value input from the CPU 30. (S110).

예측 어드레스가 추정되면, 교체 대상 엔트리 선택부(12)는 앞서 설명한 바와 같이 LRU, MRU 또는 FIFO 등 적절한 방식에 의해 교체 대상으로 선택된 엔트리에 예측 어드레스가 포함되어 있는지를 판단하여, 예측 어드레스가 포함되어 있지 않은 엔트리를 교체 대상 엔트리로 최종 선택한다(S130).When the prediction address is estimated, the replacement target entry selector 12 determines whether the prediction address is included in the entry selected for replacement by an appropriate method such as LRU, MRU, or FIFO as described above, and includes the prediction address. The entry that is not present is finally selected as the replacement target entry (S130).

다음으로, 캐시 메모리 컨트롤러(10)는 주기억장치(40)로부터 전송되어 온 데이터를 교체 대상 엔트리로 선택된 엔트리에 기록하고(S130), 앞서 설명한 단계(S140) 및 단계(S150)을 수행한다.Next, the cache memory controller 10 writes the data transmitted from the main memory 40 to the entry selected as the replacement target entry (S130), and performs the above-described steps (S140) and (S150).

한편, 도 2에서 CPU(30)로부터 어드레스 예측값이 입력되는 경우, 어드레스 예측값은 추후에 요청될 어드레스 및 어드레스의 변화율을 포함할 수 있다. 예컨대, 3차원 텍스쳐 데이터의 경우 연속되는 좌표값을 참조하는 데이터를 요청하는 경우가 대부분이므로 CPU(30)는 연속되는 좌표값의 변화율을 계산하여 이를 어드레스 변화율로 환산하여 캐시 메모리 컨트롤러(10)로 전송하도록 구성할 수 있다.Meanwhile, when an address prediction value is input from the CPU 30 in FIG. 2, the address prediction value may include an address to be requested later and a change rate of the address. For example, in the case of three-dimensional texture data, most of the cases request data that refers to a continuous coordinate value, the CPU 30 calculates a change rate of the continuous coordinate value and converts it into an address change rate to the cache memory controller 10. Can be configured to send.

이러한 경우, 캐시 메모리 컨트롤러(10)의 어드레스 추정부(11)는 어드레스 변화율을 참조하여 추후에 요청될 어드레스를 용이하게 추정할 수 있게 된다.In this case, the address estimator 11 of the cache memory controller 10 can easily estimate an address to be requested later by referring to the address change rate.

또한, 어드레스 예측값 또는 어드레스 변화율은 어드레스 추정부(11)에 의해 자체적으로 결정하도록 구성할 수 있다. 예컨대, 어드레스 추정부(11)에 메모리 수단을 구비하고, 요청되는 데이터의 어드레스를 순차적으로 기록하도록 한 후, 일정 시점마다 데이터의 어드레스의 변화율을 판단하여 추후 요청될 어드레스를 추정하도록 구성할 수 있다. 이러한 경우, CPU(30)로부터는 도 2에서와는 달리 현재 요청되는 어드레스만이 입력되면 충분하다.In addition, the address prediction value or the rate of change of address can be configured to be determined by the address estimator 11 itself. For example, the address estimator 11 may include a memory means, and sequentially write the address of the requested data, and then determine the rate of change of the address of the data at a predetermined time point to estimate the address to be requested later. . In this case, unlike in FIG. 2, only the currently requested address is input from the CPU 30.

이상에서, 본 발명의 바람직한 실시예를 참조하여 본 발명의 구성을 설명하였으나 본 발명이 상기 실시예에 한정되는 것은 아니며 첨부되는 특허청구범위 및 도면에 의해 여러가지 변형, 수정 실시가 가능하다는 것은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에게는 자명할 것이다.In the above, the configuration of the present invention has been described with reference to the preferred embodiment of the present invention, but the present invention is not limited to the above embodiments, and various modifications and changes can be made by the appended claims and drawings. It will be apparent to those of ordinary skill in the art.

예컨대, 상기 실시예에서는, 주기억장치(40)로의 데이터 요청은 CPU(30)에서만 요청되는 것으로 설명하였으나, 그래픽 컨트롤러(graphic controller) 등과 같이 CPU(30) 이외의 다른 부분에서 주기억장치(40)로 데이터를 요청하는 경우에도 본 발명을 그대로 적용할 수 있음은 물론이다.For example, in the above-described embodiment, the data request to the main memory 40 is described as being requested only by the CPU 30, but the main memory 40 may be transferred from a part other than the CPU 30, such as a graphic controller. In the case of requesting data, the present invention can be applied as it is.

본 발명에 의하면, 현재 요청되는 데이터 다음에 요청될 데이터의 어드레스를 추정하여 요청될 데이터의 어드레스를 포함하지 않는 엔트리를 교체할 엔트리로 선택함으로써 보다 효율적이고 속도 증가를 가져올 수 있는 캐시 메모리 컨트롤러 및 캐시 메모리 관리 방법을 제공할 수 있다.According to the present invention, a cache memory controller and cache capable of bringing more efficient and speed-up by estimating the address of data to be requested after the currently requested data and selecting an entry which does not include the address of the data to be requested as an entry to replace A memory management method can be provided.

Claims (8)

데이터를 저장하는 복수개의 엔트리를 포함하는 캐시 메모리를 관리하는 캐시 메모리 컨트롤러에 있어서,A cache memory controller for managing a cache memory including a plurality of entries for storing data, the cache memory controller comprising: 외부로부터 요청되는 데이터의 어드레스를 입력받아 어드레스를 순차적으로 저장하고, 순차적으로 저장된 어드레스들로부터 변화율을 계산하여 요청될 데이터의 예측 어드레스를 추정하거나, 외부로부터 요청되는 데이터의 어드레스의 변화율을 더 입력받아 요청되는 데이터의 어드레스 및 상기 입력받은 변화율에 의거하여 요청될 데이터의 예측 어드레스를 추정하는 어드레스 추정부; 및Receives the address of data requested from the outside and stores the addresses sequentially, calculates the rate of change from the sequentially stored addresses, estimates the predicted address of the data to be requested, or receives the rate of change of the address of the data requested from the outside. An address estimator for estimating a predicted address of the data to be requested based on the address of the requested data and the received change rate; And 상기 외부로부터 요청되는 데이터의 어드레스가 캐시 메모리에 존재하지 않는 경우, 상기 어드레스 추정부로부터 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리로부터 교체할 엔트리로 선택하는 교체 대상 엔트리 선택부If the address of the data requested from the outside does not exist in the cache memory, a replacement target entry selector for selecting an entry not including the predicted address of the requested data estimated from the address estimator as an entry to be replaced from the cache memory. 를 포함하는 것을 특징으로 하는 캐시 메모리 컨트롤러.Cache memory controller comprising a. 제1항에 있어서,The method of claim 1, 상기 교체 대상 엔트리 선택부는, LRU(Least Recently Used), MRU(Most Recently Use) 또는 FIFO(First In First Out) 방식 중 적어도 어느 하나에 의해 교체 엔트리를 선택하고, 상기 교체 엔트리가 요청될 데이터의 예측 어드레스를 포함하지 않는 경우 교체할 엔트리로 최종 선택하는 것을 특징으로 하는 캐시 메모리 컨트롤러.The replacement target entry selector may select a replacement entry by at least one of a least recently used (LRU), most recently use (MRU), or first in first out (FIFO) scheme, and predict the data to which the replacement entry is requested. And if it does not contain an address, finally selects the entry to be replaced. 삭제delete 삭제delete 데이터를 저장하는 복수개의 엔트리를 포함하는 캐시 메모리를 관리하는 캐시 메모리 컨트롤러에서 캐시 메모리를 관리하는 방법에 있어서,A method of managing cache memory in a cache memory controller that manages cache memory including a plurality of entries for storing data, the method comprising: 외부로부터 요청되는 데이터의 어드레스를 입력받아 어드레스를 순차적으로 저장하고, 순차적으로 저장된 어드레스들로부터 변화율을 계산하여 요청될 데이터의 예측 어드레스를 추정하거나, 외부로부터 요청되는 데이터의 어드레스의 변화율을 더 입력받고 요청되는 데이터의 어드레스 및 상기 입력받은 변화율에 의거하여 요청될 데이터의 예측 어드레스를 추정하는 단계; 및Receive the address of the data requested from the outside and store the addresses sequentially, calculate the rate of change from the sequentially stored addresses to estimate the predicted address of the data to be requested, or further receive the rate of change of the address of the data requested from the outside Estimating a predicted address of the data to be requested based on the address of the requested data and the input change rate; And 상기 외부로부터 요청되는 데이터가 캐시 메모리에 존재하지 않는 경우, 상기 추정된 요청될 데이터의 예측 어드레스를 포함하지 않는 엔트리를 캐시 메모리로부터 교체할 엔트리로 선택하는 단계If the externally requested data does not exist in the cache memory, selecting an entry that does not include the estimated address of the estimated requested data as an entry to replace from the cache memory; 를 포함하는 것을 특징으로 하는 캐시 메모리 관리 방법.Cache memory management method comprising a. 제5항에 있어서,The method of claim 5, 상기 교체할 엔트리를 선택하는 단계는, LRU(Least Recently Used), MRU(Most Recently Use) 또는 FIFO(First In First Out) 방식 중 적어도 어느 하나에 의해 교체 엔트리를 선택하고, 상기 교체 엔트리가 요청될 데이터의 예측 어드레스를 포함하지 않는 경우 교체할 엔트리로 최종 선택하는 것을 특징으로 하는 캐시 메모리 관리 방법.The selecting of an entry to replace may include selecting a replacement entry by at least one of a least recently used (LRU), most recently use (MRU), or first in first out (FIFO) scheme, and the replacement entry may be requested. And finally selecting the entry to be replaced if it does not include the predicted address of the data. 삭제delete 삭제delete
KR1020050131344A 2005-12-28 2005-12-28 Cache memory controller and method for managing cache memory using the same KR100851298B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020050131344A KR100851298B1 (en) 2005-12-28 2005-12-28 Cache memory controller and method for managing cache memory using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020050131344A KR100851298B1 (en) 2005-12-28 2005-12-28 Cache memory controller and method for managing cache memory using the same

Publications (2)

Publication Number Publication Date
KR20070069346A KR20070069346A (en) 2007-07-03
KR100851298B1 true KR100851298B1 (en) 2008-08-08

Family

ID=38504978

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050131344A KR100851298B1 (en) 2005-12-28 2005-12-28 Cache memory controller and method for managing cache memory using the same

Country Status (1)

Country Link
KR (1) KR100851298B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9852070B2 (en) 2014-09-17 2017-12-26 Samsung Electronics Co., Ltd. Cache memory system using a tag comparator to determine update candidates and operating method thereof

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101505005B1 (en) 2008-12-05 2015-03-24 삼성전자주식회사 Memory device and management method of memory device
US8688893B2 (en) 2009-06-23 2014-04-01 Intel Mobile Communications GmbH Memory device and memory interface
KR102147356B1 (en) 2013-09-30 2020-08-24 삼성전자 주식회사 Cache memory system and operating method for the same
KR102575380B1 (en) * 2021-04-14 2023-09-06 계명대학교 산학협력단 Memory control method and apparatus for efficient cache replacement

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5774685A (en) * 1995-04-21 1998-06-30 International Business Machines Corporation Method and apparatus for biasing cache LRU for prefetched instructions/data based upon evaluation of speculative conditions
US6490654B2 (en) * 1998-07-31 2002-12-03 Hewlett-Packard Company Method and apparatus for replacing cache lines in a cache memory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5774685A (en) * 1995-04-21 1998-06-30 International Business Machines Corporation Method and apparatus for biasing cache LRU for prefetched instructions/data based upon evaluation of speculative conditions
US6490654B2 (en) * 1998-07-31 2002-12-03 Hewlett-Packard Company Method and apparatus for replacing cache lines in a cache memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9852070B2 (en) 2014-09-17 2017-12-26 Samsung Electronics Co., Ltd. Cache memory system using a tag comparator to determine update candidates and operating method thereof

Also Published As

Publication number Publication date
KR20070069346A (en) 2007-07-03

Similar Documents

Publication Publication Date Title
US20070186048A1 (en) Cache memory and control method thereof
US7953935B2 (en) Cache memory system, and control method therefor
JP3880581B2 (en) Streaming data using cache locks
KR101483931B1 (en) Cache locking device and methods thereof
JP5536658B2 (en) Buffer memory device, memory system, and data transfer method
US20100217937A1 (en) Data processing apparatus and method
US9170943B2 (en) Selectively enabling write caching in a storage system based on performance metrics
JP4451717B2 (en) Information processing apparatus and information processing method
US20070079070A1 (en) Cache controller
KR100851298B1 (en) Cache memory controller and method for managing cache memory using the same
US20110314227A1 (en) Horizontal Cache Persistence In A Multi-Compute Node, Symmetric Multiprocessing Computer
US8086802B2 (en) Instruction cache system, instruction-cache-system control method, and information processing apparatus
KR20220110219A (en) Prefetch level downgrade
JP2017072982A (en) Information processing apparatus, cache control method, and cache control program
KR101472967B1 (en) Cache memory and method capable of write-back operation, and system having the same
US20110167223A1 (en) Buffer memory device, memory system, and data reading method
KR20070040340A (en) Disable write back on atomic reserved line in a small cache system
KR20080089622A (en) Memory access control apparatus and memory access control method
US6625696B1 (en) Method and apparatus to adaptively predict data quantities for caching
JP4904802B2 (en) Cache memory and processor
JP2013542511A (en) Method and apparatus for reducing processor cache pollution due to aggressive prefetching
CN114450668B (en) Circuit and method
JP2010146145A (en) Cache memory and pre-fetch method
KR20230022439A (en) Cache management circuitry for predictive adjustment of cache control policies based on persistent historical cache control information.
KR101976320B1 (en) Last level cache memory and data management method thereof

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20120710

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20130731

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20140728

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20150729

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20160801

Year of fee payment: 9