KR101291040B1 - cache line locking method of cache memory - Google Patents

cache line locking method of cache memory Download PDF

Info

Publication number
KR101291040B1
KR101291040B1 KR1020110080470A KR20110080470A KR101291040B1 KR 101291040 B1 KR101291040 B1 KR 101291040B1 KR 1020110080470 A KR1020110080470 A KR 1020110080470A KR 20110080470 A KR20110080470 A KR 20110080470A KR 101291040 B1 KR101291040 B1 KR 101291040B1
Authority
KR
South Korea
Prior art keywords
bit
cache
locking
lock
cache line
Prior art date
Application number
KR1020110080470A
Other languages
Korean (ko)
Other versions
KR20130017812A (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 KR1020110080470A priority Critical patent/KR101291040B1/en
Publication of KR20130017812A publication Critical patent/KR20130017812A/en
Application granted granted Critical
Publication of KR101291040B1 publication Critical patent/KR101291040B1/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/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

본 발명의 캐시메모리의 캐시 라인 락킹방법은 특정 캐시 라인의 락킹을 위해 프로세서는 하나의 명령어 또는 두 개의 명령어들을 처리하여 캐시 라인을 락킹하도록 하여 프로세서의 명령어 접근 시간을 감소시켜 캐시 라인 락킹 동작시 프로세서 및 캐시에서 소비되는 전력을 감소시킬 수 있고, 캐시 라인 락킹 수행시 수행 속도를 빠르게 할 수 있다.In the cache line locking method of the cache memory of the present invention, a processor processes a single instruction or two instructions to lock a cache line for locking a specific cache line, thereby reducing the instruction access time of the processor, thereby reducing the processor line during the cache line locking operation. And it is possible to reduce the power consumed in the cache, it is possible to speed up the performance when performing cache line locking.

Description

캐시메모리의 캐시 라인 락킹방법{cache line locking method of cache memory}Cache line locking method of cache memory

본 발명은 캐시메모리의 캐시 라인 락킹방법에 관한 것으로, 캐시메모리의 특정 캐시 라인의 락킹을 위해 프로세서는 하나의 명령어 또는 두 개의 명령어들을 처리하여 캐시 라인을 락킹하도록 하여 프로세서의 명령어 접근 시간을 감소시켜 캐시 라인 락킹 동작시 프로세서 및 캐시에서 소비되는 전력을 감소시킬 수 있고, 캐시 라인 락킹 수행시 수행 속도를 빠르게 할 수 있는 캐시메모리의 캐시 라인 락킹방법에 관한 것이다.The present invention relates to a cache line locking method of a cache memory. To lock a specific cache line of a cache memory, a processor processes one instruction or two instructions to lock a cache line, thereby reducing the instruction access time of the processor. The present invention relates to a cache line locking method of a cache memory capable of reducing power consumed by a processor and a cache during a cache line locking operation, and speeding up execution when performing cache line locking.

일반적으로 캐시메모리(Cache Memory)는 처리속도가 상대적으로 고속인 프로세서(processor)와 상대적으로 저속인 주메모리(Main Memory) 사이에서 일시적으로 정보를 저장하는 고속의 기억장치이다. 이러한 캐시메모리는 공유 프로그램의 수행시 참조집약성(locality of reference)을 이용하여 컴퓨터의 처리속도를 빠르게 할 수 있다. 즉, 컴퓨터프로그램이 수행될 때 프로세서가 접근하는 주메모리 내의 주소를 관찰하면 어느 한정된 시간에 주메모리의 한두 영역만이 집중적으로 접근되는 관찰할 수 있으며, 이를 공간의 집약성이라 한다. 이러한 성질을 이용하여 주메모리와 프로세서의 사이에 고속의 캐시메모리를 두어 여기에 자주 사용되는 주메모리의 일부 영역을 저장함으로써, 프로세서가 주메모리를 접근하는데 걸리는 시간을 대폭 단축할 수 있다.Generally, a cache memory is a high speed memory device that temporarily stores information between a processor having a relatively high processing speed and a main memory having a relatively low speed. Such a cache memory may speed up a computer by using a locality of reference when executing a shared program. In other words, when the computer program is executed, when observing an address in the main memory accessed by the processor, only one or two areas of the main memory can be observed intensively at any given time, which is called space density. By using this property, by placing a high speed cache memory between the main memory and the processor, and storing some areas of the main memory that are frequently used, the time required for the processor to access the main memory can be greatly reduced.

도 1은 일반적인 4개의 32비트 워드(word)로 구성된 캐시메모리를 가진 캐시 구조의 블럭도이다.1 is a block diagram of a cache structure having a cache memory composed of four general 32-bit words.

캐시는 캐시태그데이터(CTAG)가 저장된 캐시태그 저장부(1)와 캐시데이터가 저장된 캐시데이터 저장부(3)와 락비트( Lock Bit :L), 유효비트(Valid Bit :V) 및 더티비트(Dirty Bit:D)들로 구성된 상태정보가 저장된 캐시상태 저장부(5)로 구성된 캐시메모리(10)와 캐시제어기(20)로 구성된다.The cache includes a cache tag storage unit 1 storing cache tag data (CTAG), a cache data storage unit 3 storing cache data, a lock bit (L), a valid bit (Valid Bit: V), and a dirty bit. It consists of a cache memory 10 and a cache controller 20 composed of a cache state storage unit 5 storing state information composed of (Dirty Bit: D).

캐시메모리(10)는 캐시 라인 안에 저장되어 있는 정보가 주메모리의 어느 영역에 해당되는지 알아야 하는데 캐시태그 저장부(1)의 캐시태그데이터(CTAG)를 통하여 캐시 라인 안에 저장되어 있는 정보가 주메모리의 어느 영역의 주소인지 알 수 있으며, 캐시메모리(10)는 주메모리에서 읽어온 데이터를 저장하고 있으며, 이는 캐시데이터 저장부(3)에 저장된 캐시데이터이다.The cache memory 10 needs to know which area of the main memory the information stored in the cache line corresponds to. The information stored in the cache line is stored through the cache tag data CTAG of the cache tag storage unit 1. It can be seen that the address of which area, the cache memory 10 stores the data read from the main memory, which is the cache data stored in the cache data storage (3).

캐시제어기(20)는 읽기(read) 및 쓰기(write)를 위한 메모리 요청을 메모리 컨트롤러에게 보내기 전에 가로채며, 이때 메모리요청주소(MA)는 태그(Tag), 인덱스(Index) 및 오프셋(Offset)의 세 부분으로 나누어 처리된다. 캐시제어기(20)는 캐시메모리(10)의 캐시 라인을 찾기 위해 메모리요청주소(MA)의 인덱스(Index)를 사용하여 인덱스에 의해 선택된 캐시 라인은 캐시태그 저장부(1)의 캐시태그데이터(CTAG)와 캐시상태 저장부(5)의 유효비트(V)와 더티비트(D)와 락비트(L)를 이용하여 캐시데이터의 사용 가능 여부를 결정한다. 만약 캐시데이터가 사용 가능하면 캐시 히트(hit)라 하고, 그렇지 않을 경우 캐시 미스(miss)라고 한다.The cache controller 20 intercepts memory requests for read and write before sending them to the memory controller, where the memory request address (MA) is a tag, an index, and an offset. The process is divided into three parts. The cache controller 20 uses the index of the memory request address MA to find the cache line of the cache memory 10, and the cache line selected by the index is stored in the cache tag data of the cache tag storage 1. CTAG) and the valid bit V of the cache state storage unit 5, the dirty bit D, and the lock bit L are used to determine whether the cache data can be used. If cache data is available, it is called a cache hit, otherwise it is called a cache miss.

캐시 미스이면 캐시제어기(20)는 주메모리에서 미스된 캐시 라인의 모든 정보를 캐시메모리(10)로 복사하고 프로세서로부터 요청된 데이터를 프로세서로 전송하며, 캐시 히트인 경우에는 캐시제어기(20)는 캐시메모리(10)에 저장된 캐시데이터를 프로세서에 전송한다. If the cache misses, the cache controller 20 copies all the information of the missed cache line from the main memory to the cache memory 10 and transmits the requested data from the processor to the processor. In the case of a cache hit, the cache controller 20 The cache data stored in the cache memory 10 is transmitted to the processor.

캐시상태 저장부(5)에 저장된 유효비트(V)가 활성화되어 있으면 캐시데이터 저장부(3)에 저장된 캐시데이터는 유효한 데이터임을 나타내며, 더티비트(D)는 캐시 라인 안에 저장되어 있는 캐시데이터와 주메모리 안에 저장되어 있는 데이터가 일치하는지를 결정하는 비트이고, 락비트(L)는 해당 캐시 라인의 캐시데이터가 교체(Replacement)될 수 있는지의 유무를 나타낸다. 즉, 락비트(L)가 활성화되어 있으면 해당 캐시 라인에 저장된 캐시데이터는 캐시데이터의 교체에서 면제되었음을 나타낸다. If the valid bit (V) stored in the cache state storage unit 5 is activated, the cache data stored in the cache data storage unit 3 is valid data, and the dirty bit (D) corresponds to the cache data stored in the cache line. This bit determines whether the data stored in the main memory is matched, and the lock bit L indicates whether the cache data of the corresponding cache line can be replaced. That is, when the lock bit L is activated, the cache data stored in the corresponding cache line is exempted from replacing the cache data.

이와 같이 특정 캐시 라인이 락킹되면 캐시의 영역이 줄어들기 때문에 사용 가능한 캐시의 크기는 감소되게 되나, 특정 캐시 라인을 락킹시켜 주어 미스 패널티(miss penalty)에 의한 예기치 못한 실행시간의 문제점을 피할 수 있다.When a specific cache line is locked in this way, the size of the available cache is reduced because the area of the cache is reduced, but by locking the specific cache line, it is possible to avoid unexpected runtime problems due to miss penalty. .

도 2는 종래의 캐시메모리의 캐시 라인 락킹방법의 순서도이고, 도 3은 도 2의 캐시 초기화명령 수행단계의 순서도이고, 도 4는 도 2의 락킹데이터 기록명령어 수행단계의 순서도이고, 도 5는 도 2의 락비트 갱신명령어 수행단계의 순서도이다. 2 is a flowchart of a cache line locking method of a conventional cache memory, FIG. 3 is a flowchart of a cache initialization command performing step of FIG. 2, FIG. 4 is a flowchart of a locking data write command performing step of FIG. 2, and FIG. 5 is FIG. 2 is a flowchart illustrating a lock bit update command execution step shown in FIG. 2.

도 2에 도시된 바와 같이 종래의 캐시메모리의 캐시 라인 락킹방법은 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 특정 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독하는 상태정보 판독단계(S10)와, 상태정보 판독단계(S10)에서 판독된 유효비트(V)와 락비트(L)가 모두 활성화되어 있는지를 검출하는 상태정보 검출단계(S20)와, 상태정보 검출단계(S20)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면 선택된 캐시 라인을 초기화시키기 위하여 프로세서에 의해 캐시 초기화 명령어를 수행하여 선택된 캐시 라인의 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 메모리요청주소(MA)에 따른 주메모리에 선택된 캐시 라인의 캐시데이터를 저장한 후 유효비트(V)를 비활성화시키고, 선택된 캐시 라인의 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않으면 유효비트(V)를 비활성화시키는 캐시 초기화명령 수행단계(S30)와, 프로세서에 의해 락킹데이터 기록명령어를 수행하여 메모리요청주소(MA)에 의해 선택된 주메모리에 저장된 락킹데이터를 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고 유효비트(V)를 활성화시키는 락킹데이터 기록명령 수행단계(S40)와, 프로세서에 의해 락비트 갱신명령어를 수행하여 선택된 캐시 라인의 락비트(L)를 활성화시키는 락비트 갱신명령 수행단계(S50)로 구성된다.As shown in FIG. 2, the cache line locking method of the conventional cache memory stores the state information of the valid bit V and the lock bit L of a specific cache line selected by an index of the memory request address MA. Status information reading step S10 for reading, and status information detecting step S20 for detecting whether both the valid bit V and the lock bit L read in the status information reading step S10 are activated; If both the valid bit V and the lock bit L are not activated in the information detecting step S20, a cache initialization instruction is performed by a processor to initialize the selected cache line and the valid bit V of the selected cache line. If all of the dirty bits (D) are enabled, the cache data of the selected cache line is stored in the main memory according to the memory request address (MA), and then the valid bit (V) is deactivated. Dirty bit (D) If the two are not activated, the cache initialization instruction execution step (S30) of deactivating the valid bit (V) and the locking data write command by the processor to perform the locking data stored in the main memory selected by the memory request address (MA) selected Locking data write command execution step (S40) for storing in the cache data storage unit 3 of the cache line and activating the valid bit (V), and the lock bit (L) of the selected cache line by performing a lock bit update command by the processor ), Performing a lock bit update command (S50).

도 3에 도시된 바와 같이 캐시 초기화명령 수행단계(S30)는 프로세서에 접근하여 캐시를 초기화시키는 캐시 초기화명령어를 패치하는 초기화명령어 패치단계(S31)와, 패치된 초기화명령어를 디코더에 의해 디코딩하는 초기화명령어 디코딩단계(S32)와, 디코딩된 초기화명령어를 캐시제어기(20)로 전송하는 초기화명령어 전송단계(S33)와, 캐시제어기(20)로 전송된 초기화명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 유효비트와 더티비트 판독단계(S34)와 유효비트와 더티비트 판독단계(S34)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 유효비트와 더티비트 판단단계(S35)와, 유효비트와 더티비트 판단단계(S35)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 메모리요청주소(MA)에 따른 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 카피백단계(S36)와, 유효비트와 더티비트 판단단계(S35)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 카피백단계(S36) 완료 후 선택된 캐시 라인의 유효비트(V)를 비활성화시키는 캐시초기화단계(S37)로 구성된다.As shown in FIG. 3, the cache initialization instruction performing step S30 includes an initialization instruction patch step S31 for patching a cache initialization instruction for accessing a processor to initialize a cache, and an initialization for decoding the patched initialization instruction by a decoder. Instruction decoding step S32, an initialization command transmission step S33 for transmitting the decoded initialization command to the cache controller 20, and a valid bit V of the cache line selected according to the initialization command transmitted to the cache controller 20. ) And the valid bit and dirty bit reading step (S34) and the valid bit and dirty bit reading step (S34) for reading the dirty bit (D) and the presence or absence of the activation of the valid bit (V) and dirty bit (D) is determined. The main memory according to the memory request address (MA) when both the valid bit and the dirty bit determination step (S35) and the valid bit and the dirty bit (D) are activated in the valid bit and dirty bit determination step (S35). Select on A copyback step (S36) for storing the cache data of the cache line and deactivating the dirty bit (D), and both the valid bit (V) and the dirty bit (D) are activated in the valid bit and dirty bit determination step (S35) Or a cache initialization step S37 for deactivating the valid bit V of the selected cache line after the copyback step S36 is completed.

도 4에 도시된 바와 같이 락킹데이터 기록명령 수행단계(S40)는 프로세서에 접근하여 락킹데이터 기록명령어를 패치하는 락킹데이터 기록명령어 패치단계(S41)와, 패치된 락킹데이터 기록명령어를 디코더에 의해 디코딩하는 락킹데이터 기록명령어 디코딩단계(S42)와, 디코딩된 락킹데이터 기록명령어를 캐시제어기(20)로 전송하는 락킹데이터 기록명령어 전송단계(S43)와, 캐시제어기(20)로 전송된 락킹데이터 기록명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 유효비트와 더티비트 판독단계(S44)와 유효비트와 더티비트 판독단계(S44)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 유효비트와 더티비트 판단단계(S45)와, 유효비트와 더티비트 판단단계(S45)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 메모리요청주소(MA)에 따른 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 카피백단계(S46)와, 유효비트와 더티비트 판단단계(S45)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 카피백단계(S46) 완료 후 메모리요청주소(MA)에 의해 선택된 주메모리에 저장된 락킹데이터를 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고 유효비트(V)를 활성화시키는 락킹데이터 기록단계(S47)로 구성된다.As shown in FIG. 4, the performing of the locking data recording command (S40) includes a locking data recording command patch step (S41) of accessing the processor to patch the locking data recording command, and decoding the patched locking data recording command by the decoder. Locking data recording command decoding step (S42), the locking data recording command transmission step (S43) for transmitting the decoded locking data recording command to the cache controller 20, and the locking data recording command transmitted to the cache controller 20 The valid bit and the dirty bit reading step (S44) and the valid bit and dirty bit reading step (S44) for reading the valid bit (V) and the dirty bit (D) of the selected cache line according to The valid bit and the dirty bit determination step (S45) for determining whether the dirty bit (D) is activated or not, and the valid bit (V) and the dirty bit (D) are both activated in the valid bit and the dirty bit determination step (S45). A copyback step (S46) for storing the cache data of the selected cache line in the main memory according to the memory request address (MA) and deactivating the dirty bit (D), and the valid bit in the valid bit and dirty bit determination step (S45). Both V) and the dirty bit D are not activated or the locking data stored in the main memory selected by the memory request address MA after completion of the copyback step S46 is transferred to the cache data storage unit 3 of the selected cache line. Locking data recording step (S47) for storing and activating the valid bit (V).

도 5에 도시된 바와 같이 락비트 갱신명령 수행단계(S50)는 프로세서에 접근하여 락비트 갱신명령어를 패치하는 락비트 갱신명령어 패치단계(S51)와, 패치된 락비트 갱신명령어를 디코더에 의해 디코딩하는 락비트 갱신명령어 디코딩단계(S52)와, 디코딩된 락비트 갱신명령어를 캐시제어기(20)로 전송하는 락비트 갱신명령어 전송단계(S53)와, 캐시제어기(20)로 전송된 락비트 갱신명령어에 따라 선택된 캐시 라인의 락비트(L)를 활성화시키는 락비트 갱신단계(54)로 구성된다.As shown in FIG. 5, in operation S50, a lock bit update instruction patch step S51 for accessing a processor to patch a lock bit update instruction, and decoding the patched lock bit update instruction by a decoder A lock bit update command decoding step (S52), a lock bit update command sending step (S53) of transmitting the decoded lock bit update command to the cache controller 20, and a lock bit update command word transmitted to the cache controller 20 And a lock bit update step 54 for activating the lock bit L of the selected cache line.

상기와 같이 종래의 캐시메모리의 캐시 라인 락킹방법은 선택된 캐시 라인의 락비트(L)를 활성화시켜 선택된 캐시 라인을 락킹하기 위해 캐시 초기화명령 수행단계(S30)에서는 초기화 명령어를 수행하기 위한 특정 프로그램이 저장된 메모리로부터 초기화 명령어를 패치하고, 패치된 명령어를 디코더에 의해 디코딩하고, 디코더에 의해 해석된 명령어를 실행하도록 프로세서에 접근하여 프로세서에 의해 이를 수행하고, 상기와 동일하게 락킹데이터 기록명령 수행단계(S40)와 락비트 갱신명령 수행단계(S50)에서도 프로세서에 접근하여 해당 명령어를 패치, 패치된 명령어 디코딩 및 명령어를 실행하도록 프로세서에 의해 이를 수행하여야 하므로, 선택된 캐시 라인을 락킹하기 위해 세 번 프로세서에 접근하여 프로세서에 의해 명령어 패치, 명령어 디코딩 및 명령어를 실행하게 되므로, 잦은 프로세서 접근에 따라 선택된 캐시 라인 락킹 동작을 위해 프로세서 및 캐시에서 소비되는 전력이 증가되고, 캐시 라인 락킹 수행시 수행 속도가 느려지는 문제점을 가지고 있다. As described above, in the cache line locking method of the conventional cache memory, in order to lock the selected cache line by activating the lock bit (L) of the selected cache line, a specific program for executing the initialization command is performed in step S30. Patching the initialization instruction from the stored memory, decoding the patched instruction by the decoder, accessing the processor to execute the instruction interpreted by the decoder, and performing this by the processor, and performing the locking data recording instruction as above. In step S40 and the step of performing a lock bit update instruction (S50), the processor must access the processor to perform the patch, decode the patched instruction, and execute the instruction, so that the processor can execute the instruction three times to lock the selected cache line. Access and patch instructions, decode instructions by processor And since the instructions are executed, the power consumed by the processor and the cache for the selected cache line locking operation is increased according to frequent processor access, and the execution speed is slowed when performing the cache line locking.

본 발명의 목적은 캐시메모리의 특정 캐시 라인의 락킹을 위해 프로세서는 하나의 명령어 또는 두 개의 명령어들을 처리하여 캐시 라인을 락킹하도록 하여 프로세서의 명령어 접근 시간을 감소시켜 캐시 라인 락킹 동작시 프로세서 및 캐시에서 소비되는 전력을 감소시킬 수 있고, 캐시 라인 락킹 수행시 수행 속도를 빠르게 할 수 있는 캐시메모리의 캐시 라인 락킹방법을 제공하는 데 있다.An object of the present invention is to lock a cache line by processing a single instruction or two instructions for locking a specific cache line of the cache memory, thereby reducing the instruction access time of the processor in the cache and the cache during the cache line locking operation. The present invention provides a cache line locking method of a cache memory capable of reducing power consumption and speeding up execution when performing cache line locking.

상기의 목적을 달성하기 위하여 본 발명의 캐시메모리의 캐시 라인 락킹방법은 캐시태그데이터가 저장된 캐시태그 저장부, 유효비트와 더티비트와 락비트가 저장된 캐시상태 저장부 및 캐시데이터가 저장된 캐시데이터 저장부로 구성된 캐시메모리에 대해서 메모리요청주소의 인덱스에 의해 선택된 특정 캐시 라인을 락킹하기 위한 캐시메모리의 캐시 라인 락킹방법에 있어서, 상기 메모리요청주소의 인덱스에 의해 선택된 캐시 라인의 유효비트와 락비트의 상태정보를 판독하는 상태정보 판독단계; 상기 상태정보 판독단계에서 판독된 유효비트와 락비트의 활성화 유무를 판단하는 상태정보 판단단계; 및 상기 상태정보 판단단계에서 상기 유효비트와 락비트가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 수행하고, 수행된 락킹명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인을 락킹시키는 캐시락킹단계를 구비하며,
상기 캐시락킹단계는 상기 상태정보 판단단계에서 상기 유효비트와 락비트가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 패치하는 락킹명령어 패치단계; 상기 락킹명령어 패치단계에서 패치된 락킹명령어를 디코더에 의해 디코딩하는 락킹명령어 디코딩단계; 상기 락킹명령어 디코딩단계에서 디코딩된 락킹명령어를 캐시제어기로 전송하는 락킹명령어 전송단계; 상기 캐시제어기로 전송된 락킹명령어에 따라 상기 선택된 캐시 라인의 유효비트와 더티비트를 판독하는 유효비트와 더티비트 판독단계; 상기 유효비트와 더티비트 판독단계에서 판독된 유효비트와 더티비트의 활성화 유무를 판단하는 유효비트와 더티비트 판단단계; 상기 유효비트와 더티비트 판단단계에서 유효비트와 더티비트가 모두 활성화되어 있으면 주메모리에 상기 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트를 비활성화시키는 카피백단계; 및 상기 유효비트와 더티비트 판단단계에서 유효비트와 더티비트가 모두 활성화되어 있지 않거나 상기 카피백단계 완료 후 메모리요청주소에 의해 선택된 주메모리에 저장된 락킹데이터를 상기 선택된 캐시 라인의 캐시데이터 저장부에 저장하고, 상기 선택된 캐시 라인의 캐시상태 저장부의 유효비트와 락비트를 활성화시키는 캐시라인 락킹단계를 구비한 것을 특징으로 한다.
In order to achieve the above object, the cache line locking method of the cache memory of the present invention includes a cache tag storage unit storing cache tag data, a cache state storage unit storing valid bits, dirty bits, and lock bits, and cache data storing cache data. A cache line locking method of a cache memory for locking a specific cache line selected by an index of a memory request address with respect to a negatively configured cache memory, the cache line locking method comprising: a state of valid bits and lock bits of a cache line selected by an index of the memory request address Reading status information for reading information; A status information determining step of determining whether the valid bit and the lock bit read in the status information reading step are activated; And in the state information determining step, if both the valid bit and the lock bit are not activated, perform a locking instruction for locking the selected cache line by a processor, and by the cache controller 20 according to the performed locking instruction. A cache locking step of locking the selected cache line;
The cache locking step may include: a locking instruction word patching step of fetching a locking instruction word for locking the selected cache line by a processor when both the valid bit and the lock bit are not activated in the state information determining step; A locking command decoding step of decoding the locking command patched in the locking command patch step by a decoder; A locking command transmitting step of transmitting the locking command decoded in the locking command decoding step to a cache controller; A valid bit and dirty bit reading step of reading a valid bit and a dirty bit of the selected cache line according to a locking command sent to the cache controller; A valid bit and dirty bit determination step of determining whether the valid bit and the dirty bit read in the valid bit and dirty bit reading step are activated; A copyback step of storing cache data of the selected cache line in the main memory and deactivating the dirty bit when both the valid bit and the dirty bit are activated in the valid bit and dirty bit determination step; And locking data stored in the main memory selected by the memory request address after the valid bit and the dirty bit are not activated in the valid bit and dirty bit determination step or after the copyback step is completed, to the cache data storage unit of the selected cache line. And a cache line locking step of activating a valid bit and a lock bit of a cache state storage unit of the selected cache line.

삭제delete

본 발명의 캐시메모리의 캐시 라인 락킹방법은 특정 캐시 라인의 락킹을 위해 프로세서는 하나의 명령어 또는 두 개의 명령어들을 처리하여 캐시 라인을 락킹하도록 하여 프로세서의 명령어 접근 시간을 감소시켜 캐시 라인 락킹 동작시 프로세서 및 캐시에서 소비되는 전력을 감소시킬 수 있고, 캐시 라인 락킹 수행시 수행 속도를 빠르게 할 수 있다.In the cache line locking method of the cache memory of the present invention, a processor processes a single instruction or two instructions to lock a cache line for locking a specific cache line, thereby reducing the instruction access time of the processor, thereby reducing the processor line during the cache line locking operation. And it is possible to reduce the power consumed in the cache, it is possible to speed up the performance when performing cache line locking.

도 1은 일반적인 4개의 32비트 워드(word)로 구성된 캐시메모리를 가진 캐시 구조의 블럭도,
도 2는 종래의 캐시메모리의 캐시 라인 락킹방법의 순서도이고,
도 3은 도 2의 캐시 초기화명령 수행단계의 순서도이고,
도 4는 도 2의 락킹데이터 기록명령어 수행단계의 순서도이고,
도 5는 도 2의 락비트 갱신명령어 수행단계의 순서도이고,
도 6은 본 발명의 캐시메모리의 캐시 라인 락킹방법의 순서도이고,
도 7은 본 발명의 다른 실시예인 캐시메모리의 캐시 라인 락킹방법의 순서도이고,
도 8은 도 7의 캐시 초기화명령 수행단계의 순서도이고,
도 9는 도 7의 락킹데이터 기록 및 락비트 갱신단계의 순서도이다.
1 is a block diagram of a cache structure having a cache memory composed of four general 32-bit words.
2 is a flowchart of a cache line locking method of a conventional cache memory.
3 is a flowchart of a cache initialization command execution step of FIG.
4 is a flowchart of a locking data write command execution step of FIG. 2;
5 is a flowchart of a lock bit update command execution step of FIG. 2;
6 is a flowchart of a cache line locking method of a cache memory of the present invention;
7 is a flowchart illustrating a cache line locking method of a cache memory according to another embodiment of the present invention.
8 is a flowchart illustrating a cache initialization command execution step of FIG. 7.
9 is a flowchart of the locking data recording and lock bit updating step of FIG. 7.

이하, 첨부된 도면을 참조하여 본 발명의 캐시메모리의 캐시 라인 락킹방법을 상세히 설명하고자 한다.Hereinafter, a cache line locking method of a cache memory of the present invention will be described in detail with reference to the accompanying drawings.

도 6은 본 발명의 캐시메모리의 캐시 라인 락킹방법의 순서도이고, 도 7은 본 발명의 다른 실시예인 캐시메모리의 캐시 라인 락킹방법의 순서도이고, 도 8은 도 7의 캐시 초기화명령 수행단계의 순서도이고, 도 9는 도 7의 락킹데이터 기록 및 락비트 갱신단계의 순서도이다.6 is a flowchart of a cache line locking method of a cache memory of the present invention, FIG. 7 is a flowchart of a cache line locking method of a cache memory according to another embodiment of the present invention, and FIG. 8 is a flowchart of a step of performing a cache initialization command of FIG. 7. 9 is a flowchart of the locking data recording and lock bit updating step of FIG.

도 6에 도시된 바와 같이 본 발명의 캐시메모리의 캐시 라인 락킹방법은 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독하는 상태정보 판독단계(S100)와, 상태정보 판독단계(S100)에서 판독된 유효비트(V)와 락비트(L)의 활성화 유무를 판단하는 상태정보 판단단계(S110)와, 상기 상태정보 판단단계(S110)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 수행하고 수행된 락킹명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인을 락킹시키는 캐시락킹단계(S190)로 구성된다.As shown in FIG. 6, the cache line locking method of the cache memory of the present invention stores the state information of the valid bit V and the lock bit L of the cache line selected by the index of the memory request address MA. Status information reading step (S100) for reading, status information determining step (S110) for determining whether activation bit (V) and lock bit (L) are activated in the status information reading step (S100), and the status information If neither the valid bit V nor the lock bit L is activated in the determining step S110, a locking command for locking the selected cache line is performed by a processor and a cache controller according to the locking command performed. A cache locking step (S190) for locking the cache line selected by 20).

캐시락킹단계(S190)는 상태정보 판단단계(S110)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 패치하는 락킹명령어 패치단계(S120)와, 락킹명령어 패치단계(S120)에서 패치된 락킹명령어를 디코더에 의해 디코딩하는 락킹명령어 디코딩단계(S130)와, 락킹명령어 디코딩단계(S130)에서 디코딩된 락킹명령어를 캐시제어기로 전송하는 락킹명령어 전송단계(S140)와, 캐시제어기로 전송된 락킹명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 유효비트와 더티비트 판독단계(S150)와, 유효비트와 더티비트 판독단계(S150)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 유효비트와 더티비트 판단단계(S160)와, 유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 카피백단계(S170)와, 유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 카피백단계(S170) 완료 후 메모리요청주소(MA)에 의해 선택된 주메모리에 저장된 락킹데이터를 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 선택된 캐시 라인의 캐시상태 저장부(5)의 유효비트(V)와 락비트(L)를 활성화시키는 캐시라인 락킹단계(S180)로 구성된다.In the cache locking step S190, when neither the valid bit V nor the lock bit L is activated in the status information determining step S110, a locking instruction word for patching a locking instruction for locking the cache line selected by the processor. The locking command decode step (S130), the locking command decoded in the locking command patch step (S120) by the decoder (S130) and the locking command decoded in the lock command decoding step (S130) to the cache controller A locking command transmission step (S140) to be transmitted, a valid bit and a dirty bit reading step (S150) of reading the valid bit (V) and the dirty bit (D) of the selected cache line according to the locking command transmitted to the cache controller, Valid bit and dirty bit determining step (S160) for determining whether the valid bit (V) and dirty bit (D) is activated in the valid bit and dirty bit reading step (S150) and the valid bit and dirty bit determining step ( To S160) If both the valid bit (V) and the dirty bit (D) are enabled, a copyback step (S170) for storing the cache data of the selected cache line in the main memory and deactivating the dirty bit (D), and the valid bit and the dirty bit In the determining step (S160), both the valid bit (V) and the dirty bit (D) are not activated, or after the completion of the copy back step (S170), the cache data selected in the memory selected by the memory request address (MA) selected cache line The cache line locking step (S180) stores the cache data storage unit 3 and activates the valid bit V and the lock bit L of the cache state storage unit 5 of the selected cache line.

도 7에 도시된 바와 같이 본 발명의 다른 실시예인 캐시메모리의 캐시 라인 락킹방법은 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독하는 상태정보 판독단계(S200)와, 상태정보 판독단계(S200)에서 판독된 유효비트(V)와 락비트(L)의 활성화 유무를 판단하는 상태정보 판단단계(S210)와, 상기 상태정보 판단단계(S210)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 수행하고, 프로세서에 의해 수행된 초기화명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인의 초기화를 수행하는 캐시 초기화명령 수행단계(S220)와, 캐시 초기화명령 수행단계(S220) 후 프로세서에 의해 선택된 캐시 라인의 락킹데이터 기록 및 락비트갱신을 위한 락명령어를 수행하고, 프로세서에 의해 수행된 락명령어에 따라 캐시제어기(20)에 의해 주메모리에 저장된 락킹데이타를 선택된 캐시 라인의 캐시데이터 저장부(3)에 기록하고, 선택된 캐시 라인의 락비트를 활성화시키는 락킹데이터 기록 및 락비트 갱신단계(S230)로 구성된다.As shown in FIG. 7, the cache line locking method of the cache memory, according to another embodiment of the present invention, includes the valid bit V and the lock bit L of the cache line selected by the index of the memory request address MA. A status information reading step (S200) for reading the status information, a status information determining step (S210) for determining whether the valid bit V and the lock bit L are activated in the status information reading step (S200); If neither the valid bit V nor the lock bit L is activated in the state information determining step S210, an initialization instruction for initializing the cache line selected by the processor is performed, and the initialization performed by the processor is performed. Cache initialization command execution step (S220) for performing the initialization of the cache line selected by the cache controller 20 according to the command, and recording the locking data of the cache line selected by the processor after the cache initialization command execution step (S220) And performing a lock command for updating the lock bit, and recording the locking data stored in the main memory by the cache controller 20 in the cache data storage unit 3 of the selected cache line according to the lock command performed by the processor. Locking data recording and locking bit updating step (S230) for activating the lock bit of the selected cache line.

도 8에 도시된 바와 같이 캐시 초기화명령 수행단계(S220)는 상태정보 판단단계(S210)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 패치하는 초기화명령어 패치단계(S221)와, 초기화명령어 패치단계(S221)에서 패치된 초기화명령어를 디코더에 의해 디코딩하는 초기화명령어 디코딩단계(S222)와, 초기화명령어 디코딩단계(S222)에서 디코딩된 초기화명령어를 캐시제어기로 전송하는 초기화명령어 전송단계(S223)와, 캐시제어기로 전송된 초기화 명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제1 유효비트와 더티비트 판독단계(S224)와, 제1 유효비트와 더티비트 판독단계(S224)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제1 유효비트와 더티비트 판단단계(S225)와, 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제1 카피백단계(S226)와, 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 제1 카피백단계(S226) 완료 후 선택된 캐시 라인의 유효비트(V)를 비활성화시켜 선택된 캐시 라인을 초기화시키는 캐시초기화단계(S227)로 구성된다.As shown in FIG. 8, if both the valid bit V and the lock bit L are not activated in the state information determining step S210, the cache initialization command performing step S220 initializes the cache line selected by the processor. Initialization command patch step (S221) for patching the initialization command to make, initialization command decoding step (S222) for decoding the initialization command patched in the initialization command patch step (S221) by the decoder (S222), initialization command decoding step (S222) In the initialization command transmission step (S223) for transmitting the decoded initialization command to the cache controller, and the first validity to read the valid bit (V) and dirty bit (D) of the selected cache line according to the initialization command sent to the cache controller The first presence or absence of the bit and dirty bit read step (S224), and whether the valid bit (V) and the dirty bit (D) read in the first valid bit and dirty bit read step (S224) is activated When both the valid bit and the dirty bit determination step (S225) and the first valid bit and the dirty bit determination step (S225) are both enabled, the cache data of the cache line selected in the main memory The valid bit (V) and the dirty bit (D) are not activated in the first copyback step (S226) and the first valid bit and the dirty bit determination step (S225) for storing the data and deactivating the dirty bit (D). Or after the completion of the first copyback step S226, a cache initialization step S227 for inactivating the valid bit V of the selected cache line to initialize the selected cache line.

또한, 도 9에 도시된 바와 같이 락킹데이터 기록 및 락비트 갱신단계(S230)는 프로세서에 의해 락킹데이터기록 및 락비트갱신을 위한 락명령어를 패치하는 락명령어 패치단계(S231)와, 락명령어 패치단계(S231)에서 패치된 락명령어를 디코더에 의해 디코딩하는 락명령어 디코딩단계(S232)와, 락명령어 디코딩단계(S232)에서 디코딩된 락명령어를 캐시제어기로 전송하는 락명령어 전송단계(S233)와, 캐시제어기로 전송된 락명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제2 유효비트와 더티비트 판독단계(S234)와, 제2 유효비트와 더티비트 판독단계(S234)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제2 유효비트와 더티비트 판단단계(S235)와, 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제2 카피백단계(S236)와, 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 제2 카피백단계(S236) 완료 후 주메모리에 저장된 락킹데이터를 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 선택된 캐시 라인의 캐시상태 저장부(5)에 저장된 유효비트(V)와 락비트(L)를 활성화시키는 락킹데이터 처리단계(S237)로 구성된다.
In addition, as illustrated in FIG. 9, the locking data recording and locking bit updating step (S230) includes a lock instruction patch step (S231) of patching a lock instruction for locking data recording and updating the lock bit by a processor, and a lock instruction patch. A lock command decoding step S232 for decoding the lock command patched in step S231 by a decoder; a lock command transmission step S233 for transmitting the lock command decoded in the lock command decoding step S232 to a cache controller; A second valid bit and dirty bit reading step (S234) for reading the valid bit (V) and the dirty bit (D) of the selected cache line according to the lock instruction transmitted to the cache controller, and reading the second valid bit and the dirty bit. A second valid bit and dirty bit determination step (S235) for determining whether the valid bit (V) and the dirty bit (D) is read in step S234, and the second valid bit and dirty bit determination step (S235) Valid bit (V) and dirty bit (D) If both are enabled, the second copyback step (S236) stores the cache data of the selected cache line in the main memory and deactivates the dirty bit (D), and the valid bit (in the second valid bit and dirty bit determination step (S235)). After both V) and the dirty bit D are not activated or after the second copyback step S236 is completed, the locking data stored in the main memory is stored in the cache data storage unit 3 of the selected cache line, and Locking data processing step (S237) for activating the valid bit (V) and the lock bit (L) stored in the cache state storage unit (5).

상기의 구성에 따른 본 발명인 캐시메모리의 캐시 라인 락킹방법의 동작은 다음과 같다. Operation of the cache line locking method of the cache memory of the present invention according to the above configuration is as follows.

도 6에 도시된 바와 같이 본 발명의 실시예인 캐시메모리의 캐시 라인 락킹방법의 동작을 살펴보면 다음과 같다.As shown in FIG. 6, the operation of the cache line locking method of the cache memory according to the embodiment of the present invention is as follows.

상태정보 판독단계(S100)는 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독한다. The status information reading step S100 reads the status information of the valid bit V and the lock bit L of the cache line selected by the index of the memory request address MA.

상태정보 판단단계(S110)는 상태정보 판독단계(S100)에서 판독된 유효비트(V)와 락비트(L)의 활성화 유무를 판단하며, 상태정보 판단단계(S110)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있으면, 즉, 유효비트(V)는 유효논리값을 갖고, 동시에 락비트(L)도 유효논리값을 가지면, 해당 선택된 캐시 라인은 이미 캐시 락(Lock)이 걸려 있으므로 다시 캐시 락을 설정할 필요가 없으므로 상태정보 판독단계(S100)를 수행한다,  The status information determining step S110 determines whether the valid bit V and the lock bit L are activated in the status information reading step S100, and the valid bit V and the valid bit V in the status information determining step S110. If all of the lock bits (L) are active, that is, the valid bit (V) has a valid logical value, and at the same time the lock bit (L) has a valid logical value, then the selected cache line is already locked. Since there is no need to set the cache lock again, the status information reading step (S100) is performed.

상태정보 판단단계(S110)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 즉, 유효비트(V)가 무효논리값을 갖고, 락비트(L)가 무효논리값을 갖거나, 유효비트(V)가 유효논리값을 갖고, 락비트(L)가 무효논리값을 갖거나, 유효비트(V)가 무효논리값을 갖고, 락비트(L)가 유효논리값을 가지면, 해당 캐시 라인에는 캐시 락을 설정할 수 있으므로, 락킹명령어 패치단계(S120)는 사용자에 의해 캐시 락을 설정하기 위해 다수의 명령어들이 저장된 메모리로부터 락킹명령어를 패치하고, 락킹명령어 디코딩단계(S130)에서 락킹명령어 패치단계(S120)에서 패치된 락킹명령어를 디코더에 의해 디코딩하고, 디코딩된 락킹명령어를 실행하기 위해 락킹명령어 전송단계(S140)는 락킹명령어 디코딩단계(S130)에서 디코딩된 락킹명령어를 캐시제어기로 전송하고, 캐시제어기에 의해 전송된 락킹명령어에 의해 캐시제어기는 유효비트와 더티비트 판독단계(S150)와, 유효비트와 더티비트 판단단계(S160)와, 카피백단계(S170)와, 캐시라인 락킹단계(S180)를 수행하게 된다.If neither the valid bit V nor the lock bit L is activated in the state information determining step S110, that is, the valid bit V has an invalid logical value, and the lock bit L has an invalid logical value. Valid bit (V) has a valid logical value, lock bit (L) has an invalid logical value, valid bit (V) has an invalid logical value, and lock bit (L) has a valid logical value If the cache line is set to the cache line, the locking instruction patch step S120 may patch the locking instruction from a memory in which a plurality of instructions are stored to set the cache lock by the user, and decode the locking instruction step S130. In order to decode the locking command, which is patched in the locking command command step (S120) by the decoder, and to execute the decoded locking command, the locking command transmission step (S140) caches the locking command decoded in the locking command decoding step (S130). Send to controller, cache By the locking command transmitted by the controller, the cache controller reads the valid bit and the dirty bit (S150), determines the valid bit and the dirty bit (S160), the copy back step (S170), and the cache line locking step (S180). Will be performed.

유효비트와 더티비트 판독단계(S150)는 캐시제어기로 전송된 락킹명령어에 따라 선택된 캐시 라인의 캐시상태 저장부(5)에 저장된 유효비트(V)와 더티비트(D)를 판독하며, 유효비트와 더티비트 판단단계(S160)는 유효비트와 더티비트 판독단계(S150)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단한다.Valid bit and dirty bit read step (S150) reads the valid bit (V) and dirty bit (D) stored in the cache state storage unit 5 of the selected cache line in accordance with the locking command transmitted to the cache controller, In the dirty bit determining step S160, the valid bit and the dirty bit reading step S150 determine whether the valid bit V and the dirty bit D are activated.

후기입 방식(write back)의 캐시메모리를 사용하는 경우 캐시데이터는 캐시메모리의 캐시데이터 저장부(3)에 저장되어 가장 최근의 데이터를 저장하고 있으나 주메모리에는 이를 저장하지 않으므로 주메모리의 데이터를 갱신하여 캐시메모리와 주메모리 사이에 일관성이 유지되도록 해주어야 한다. 따라서 유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 저장된 데이터는 유효한 데이터가 아니므로 카피백단계(S170)에 의해 현재 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장된 캐시데이터를 메모리요청주소(MA)에 의해 선택된 주메모리에 저장하도록 하여 주메모리의 데이터를 갱신해주고, 더티비트(D)를 무효논리값을 갖도록 비활성화시켜준다.In the case of using write back cache memory, the cache data is stored in the cache data storage unit 3 of the cache memory to store the most recent data. However, the cache data is not stored in the main memory. Updates should be made to maintain consistency between cache memory and main memory. Therefore, if both the valid bit (V) and the dirty bit (D) are activated in the valid bit and dirty bit determination step (S160), the data stored in the main memory is not valid data, and thus the cache currently selected by the copy back step (S170). The cache data stored in the cache data storage unit 3 of the line is stored in the main memory selected by the memory request address MA to update the data of the main memory, and the dirty bit D is deactivated to have an invalid logical value. give.

유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 카피백단계(S170) 완료 후에는 캐시라인 락킹단계(S180)는 메모리요청주소(MA)에 의해 선택된 주메모리에 저장된 락킹데이터를 현재 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 선택된 캐시 라인의 캐시상태 저장부(5)의 유효비트(V)와 락비트(L)를 모두 유효논리값을 갖도록 활성화시켜 준다. In the valid bit and dirty bit determination step (S160), both the valid bit (V) and the dirty bit (D) are not activated, or after the copyback step (S170) is completed, the cache line locking step (S180) is a memory request address (MA). The lock data stored in the main memory selected by < RTI ID = 0.0 >) < / RTI > Activate to have all valid logic values.

이와 같이 본 발명의 캐시메모리의 캐시 라인 락킹방법은 상태정보 판단단계(S110)에서 현재 선택된 캐시 라인에 캐시 락을 설정할 수 있을 경우에는 상태정보 판단단계(S110) 이후에는 프로세서는 한 번의 캐시 락 설정을 위한 락킹명령어를 패치하고, 패치된 락킹명령어를 디코딩하고, 디코딩된 락킹명령어를 캐시제어기로 전송하도록 하여, 한 번의 프로세서의 접근에 의해 하나의 캐시 라인에 대해 락을 설정할 수 있으므로, 종래에 비해 프로세서의 접근 시간을 감소시킬 수 있으며, 특히, 캐시메모리의 다수의 캐시 라인에 락을 설정하고자 하는 경우 종래에 비해 프로세서의 접근 시간을 상당히 감소시킬 수 있으며, 이로 인해 캐시 라인 락킹 동작시 프로세서 및 캐시에서 소비되는 전력을 감소시킬 수 있고, 캐시 라인 락킹 수행시 수행 속도를 빠르게 할 수 있다. As described above, in the cache line locking method of the cache memory of the present invention, when the cache lock can be set in the cache line currently selected in the state information determining step S110, the processor sets one cache lock after the state information determining step S110. It is possible to set a lock on one cache line by one processor's access by patching a locking instruction for the processor, decoding the patched locking instruction, and transmitting the decoded locking instruction to the cache controller. It is possible to reduce the access time of the processor, and in particular, to set a lock on a plurality of cache lines of the cache memory, the access time of the processor can be considerably reduced compared to the conventional one, and thus the processor and the cache during the cache line locking operation Can reduce power consumption and improve performance when performing cache line locking. Can.

도 7 내지 도 9에 도시된 본 발명의 다른 실시예인 캐시메모리의 캐시 라인 락킹방법의 동작은 다음과 같다.The operation of the cache line locking method of the cache memory according to another embodiment of the present invention shown in FIGS. 7 to 9 is as follows.

상태정보 판독단계(S200)와 상태정보 판단단계(S210)는 도 6의 상태정보 판독단계(S100)와 상태정보 판단단계(S110)와 동일하다.The status information reading step S200 and the status information determining step S210 are the same as the status information reading step S100 and the status information determining step S110 of FIG. 6.

도 6의 경우 프로세서는 한 번의 락킹명령어를 패치하여 선택된 캐시 라인에 대해서 캐시 락을 설정하는데 반해, 도 7의 경우에는 프로세서는 두 번의 명령어를 패치하여 캐시 락을 설정한다.In FIG. 6, the processor sets a cache lock for a selected cache line by patching one locking instruction, whereas in FIG. 7, the processor sets a cache lock by patching two instructions.

즉, 프로세서는 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 패치하는 초기화명령어 패치단계(S221)와, 초기화명령어 패치단계(S221)에서 패치된 초기화명령어를 디코더에 의해 디코딩하는 초기화명령어 디코딩단계(S222)와, 초기화명령어 디코딩단계(S222)에서 디코딩된 초기화명령어를 캐시제어기로 전송하는 초기화명령어 전송단계(S223)와, 캐시제어기로 전송된 초기화 명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제1 유효비트와 더티비트 판독단계(S224)와, 제1 유효비트와 더티비트 판독단계(S224)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제1 유효비트와 더티비트 판단단계(S225)와, 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제1 카피백단계(S226)와, 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 제1 카피백단계(S226) 완료 후 선택된 캐시 라인의 유효비트(V)를 비활성화시켜 선택된 캐시 라인을 초기화시키는 캐시초기화단계(S227)로 구성된 캐시 초기화명령 수행단계(S220)를 수행한다.That is, the processor may perform an initialization command patch step (S221) for patching an initialization command for initializing the selected cache line, and an initialization command decoding step (S222) for decoding the initialization command patched in the initialization command patch step (S221) by a decoder. And an initialization command transmission step (S223) for transmitting the initialization command decoded in the initialization command decoding step (S222) to the cache controller, and a valid bit (V) and a dirty bit of the cache line selected according to the initialization command sent to the cache controller. (D) whether the first valid bit and dirty bit read step (S224) and the valid bit (V) and dirty bit (D) read in the first valid bit and dirty bit read step (S224) are activated or not. If both the valid bit (V) and the dirty bit (D) are activated in the first valid bit and dirty bit determination step (S225) and the first valid bit and dirty bit determination step (S225), the main memory is stored in the main memory. The first copyback step (S226) for storing the cache data of the selected cache line and deactivating the dirty bit (D), and the valid bit (V) and the dirty bit (D) in the first valid bit and dirty bit determination step (S225). ) Is not activated or the cache initialization command performing step (S227) configured to initialize the selected cache line by deactivating the valid bit (V) of the selected cache line after the first copyback step (S226) (S220) ).

이와 같이 캐시 초기화명령 수행단계(S220)는 상태정보 판단단계(S210)에서 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 수행하고, 프로세서에 의해 수행된 초기화명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인의 초기화를 수행하도록 하여, 프로세서는 초기화명령어를 한 번 수행하고, 캐시제어기(20)는 프로세서에 의해 수행된 초기화명령어에 따라 선택된 캐시 라인의 초기화를 실행한다.As described above, if the valid bit V and the lock bit L are not activated in the state information determining step S210, the cache initialization command execution step S220 may include an initialization command for initializing the cache line selected by the processor. And the initialization of the cache line selected by the cache controller 20 according to the initialization instruction performed by the processor, so that the processor executes the initialization instruction once, and the cache controller 20 is executed by the processor. Initialize the selected cache line according to the initialization command.

또한, 프로세서에 의해 락킹데이터기록 및 락비트갱신을 위한 락명령어를 패치하는 락명령어 패치단계(S231)와, 락명령어 패치단계(S231)에서 패치된 락명령어를 디코더에 의해 디코딩하는 락명령어 디코딩단계(S232)와, 락명령어 디코딩단계(S232)에서 디코딩된 락명령어를 캐시제어기로 전송하는 락명령어 전송단계(S233)와, 캐시제어기로 전송된 락명령어에 따라 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제2 유효비트와 더티비트 판독단계(S234)와, 제2 유효비트와 더티비트 판독단계(S234)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제2 유효비트와 더티비트 판단단계(S235)와, 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제2 카피백단계(S236)와, 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 제2 카피백단계(S236) 완료 후 주메모리에 저장된 락킹데이터를 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 선택된 캐시 라인의 캐시상태 저장부(5)에 저장된 유효비트(V)와 락비트(L)를 활성화시키는 락킹데이터 처리단계(S237)로 구성된 락킹데이터 기록 및 락비트 갱신단계(S230)를 수행한다.In addition, a lock instruction patch step (S231) for patching a lock instruction for recording locking data and updating the lock bit by the processor, and a lock instruction decoding step for decoding the lock instruction patched in the lock instruction patch step (S231) by a decoder. (S232), the lock command transmission step (S233) for transmitting the lock command decoded in the lock command decoding step (S232) to the cache controller, and the valid bit (V) of the cache line selected in accordance with the lock command sent to the cache controller And the second valid bit and dirty bit reading step S234 for reading the dirty bit D, and the valid bit V and the dirty bit D read in the second valid bit and dirty bit reading step S234. Main memory if both of the valid bit (V) and the dirty bit (D) are activated in the second valid bit and dirty bit determination step (S235) and the second valid bit and dirty bit determination step (S235) for determining whether to activate. Cache data of the cache line selected in The valid bit (V) and the dirty bit (D) are not activated in the second copyback step (S236) and the second valid bit and the dirty bit determination step (S235) for storing and deactivating the dirty bit (D). After completion of the second copyback step S236, the locking data stored in the main memory is stored in the cache data storage unit 3 of the selected cache line, and the valid bit V stored in the cache state storage unit 5 of the selected cache line is stored. And a locking data processing step (S237) for activating the lock bit (L), and performing a locking data recording and locking bit update step (S230).

이와 같이 캐시 락킹데이터 기록 및 락비트 갱신단계(S230)는 캐시 초기화명령 수행단계(S220) 후 프로세서에 의해 선택된 캐시 라인의 락킹데이터 기록 및 락비트갱신을 위한 락명령어를 수행하고, 프로세서에 의해 수행된 락명령어에 따라 캐시제어기(20)에 의해 주메모리에 저장된 락킹데이타를 선택된 캐시 라인의 캐시데이터 저장부(3)에 기록하고, 선택된 캐시 라인의 락비트를 활성화시키도록 하여 프로세서는 프로세서는 락명령어를 한 번 수행하고, 캐시제어기(20)는 프로세서에 의해 수행된 락명령어에 따라 선택된 캐시 라인의 락킹 동작을 종료한다.As described above, in the cache locking data recording and lock bit updating step S230, after the cache initialization command performing step S220, a lock instruction for writing the locking data and updating the lock bit of the cache line selected by the processor is performed by the processor. The locking data stored in the main memory by the cache controller 20 is written to the cache data storage unit 3 of the selected cache line according to the received lock command, and the processor is configured to activate the lock bit of the selected cache line. After the instruction is executed once, the cache controller 20 ends the locking operation of the selected cache line according to the lock instruction performed by the processor.

따라서, 본 발명의 다른 실시예의 캐시메모리 락킹방법의 경우 캐시 초기화명령 수행단계(S220)는 종래의 캐시 초기화명령 수행단계와 동일하나, 본 발명의 경우 종래의 두 번의 프로세서의 접근에 의해 수행되는 락킹데이터 기록명령 수행단계와 락비트 갱신명령 수행단계를 락킹데이터 기록 및 락비트 갱신단계(S240)에 의해 한 번의 프로세서의 접근에 의해 수행되도록 하여 종래에 비해 프로세서 접근 시간을 감소시킬 수 있다.Therefore, in the cache memory locking method according to another embodiment of the present invention, the step of performing the cache initialization command (S220) is the same as that of the conventional cache initialization command, but in the present invention, the locking is performed by accessing two conventional processors. The processor access time can be reduced by performing the data write command execution step and the lock bit update command execution step by one processor access by the locking data recording and lock bit update step (S240).

Claims (5)

캐시태그데이터(CTAG)가 저장된 캐시태그 저장부(1), 유효비트(V)와 더티비트(D)와 락비트(L)가 저장된 캐시상태 저장부(5) 및 캐시데이터가 저장된 캐시데이터 저장부(3)로 구성된 캐시메모리에 대해서 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 특정 캐시 라인을 락킹하기 위한 캐시메모리의 캐시 라인 락킹방법에 있어서,
상기 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독하는 상태정보 판독단계(S100);
상기 상태정보 판독단계(S100)에서 판독된 유효비트(V)와 락비트(L)의 활성화 유무를 판단하는 상태정보 판단단계(S110); 및
상기 상태정보 판단단계(S110)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 수행하고 수행된 락킹명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인을 락킹시키는 캐시락킹단계(S190)를 구비하며,
상기 캐시락킹단계(S190)는, 상기 상태정보 판단단계(S110)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 락킹하기 위한 락킹명령어를 패치하는 락킹명령어 패치단계(S120)와, 상기 락킹명령어 패치단계(S120)에서 패치된 락킹명령어를 디코더에 의해 디코딩하는 락킹명령어 디코딩단계(S130)와, 상기 락킹명령어 디코딩단계(S130)에서 디코딩된 락킹명령어를 캐시제어기로 전송하는 락킹명령어 전송단계(S140)와, 상기 캐시제어기로 전송된 락킹명령어에 따라 상기 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 유효비트와 더티비트 판독단계(S150)와, 상기 유효비트와 더티비트 판독단계(S150)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 유효비트와 더티비트 판단단계(S160)와, 상기 유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 상기 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 카피백단계(S170)와, 상기 유효비트와 더티비트 판단단계(S160)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 상기 카피백단계(S170) 완료 후 메모리요청주소(MA)에 의해 선택된 주메모리에 저장된 락킹데이터를 상기 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 상기 선택된 캐시 라인의 캐시상태 저장부(5)의 유효비트(V)와 락비트(L)를 활성화시키는 캐시라인 락킹단계(S180)를 구비한 것을 특징으로 캐시메모리의 캐시 라인 락킹방법.
Cache tag storage unit 1 storing cache tag data CTAG, cache state storage unit 5 storing valid bits V, dirty bits D, and lock bits L, and cache data storing cache data In the cache line locking method of the cache memory for locking the specific cache line selected by the index of the memory request address MA with respect to the cache memory constituted by the section (3),
A status information reading step (S100) of reading status information of a valid bit (V) and a lock bit (L) of a cache line selected by an index of the memory request address (MA);
A status information determination step (S110) of determining whether the valid bit (V) and the lock bit (L) are activated in the status information reading step (S100); And
If neither the valid bit V nor the lock bit L is activated in the state information determining step S110, a locking instruction for locking the selected cache line is performed by a processor and according to the performed locking instruction It has a cache locking step (S190) for locking the cache line selected by the cache controller 20,
In the cache locking step S190, when neither the valid bit V nor the lock bit L is activated in the state information determining step S110, a locking instruction word for locking the selected cache line by a processor Locking command patch step (S120) for patching, Locking command decoding step (S130) to decode the locking command patched in the locking command patch step (S120) by the decoder (S130), Decoding in the locking command decoding step (S130) A locking instruction transmission step (S140) for transmitting the locked locking instruction to the cache controller, a valid bit for reading the valid bit (V) and the dirty bit (D) of the selected cache line according to the locking instruction transmitted to the cache controller; Valid bit and dirty bit determination stage for determining whether to activate the valid bit (V) and the dirty bit (D) read in the dirty bit read step (S150) and the valid bit and dirty bit read step (S150) If the valid bit (V) and the dirty bit (D) are activated in the system (S160) and the valid bit and the dirty bit determination step (S160), the cache data of the selected cache line is stored in a main memory and the dirty bit ( D) Deactivation of the copy back step (S170) and the valid bit and the dirty bit determination step (S160), both the valid bit (V) and the dirty bit (D) is not activated or the copy back step (S170) is completed Then, the locking data stored in the main memory selected by the memory request address MA is stored in the cache data storage unit 3 of the selected cache line, and the valid bit V of the cache state storage unit 5 of the selected cache line is stored. And a cache line locking step (S180) for activating the lock bit (L).
삭제delete 캐시태그데이터(CTAG)가 저장된 캐시태그 저장부(1), 유효비트(V)와 더티비트(D)와 락비트(L)가 저장된 캐시상태 저장부(5) 및 캐시데이터가 저장된 캐시데이터 저장부(3)로 구성된 캐시메모리에 대해서 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 특정 캐시 라인을 락킹하기 위한 캐시메모리의 캐시 라인 락킹방법에 있어서,
상기 메모리요청주소(MA)의 인덱스(Index)에 의해 선택된 캐시 라인의 유효비트(V)와 락비트(L)의 상태정보를 판독하는 상태정보 판독단계(S200);
상기 상태정보 판독단계(S200)에서 판독된 유효비트(V)와 락비트(L)의 활성화 유무를 판단하는 상태정보 판단단계(S210);
상기 상태정보 판단단계(S210)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 수행하고, 프로세서에 의해 수행된 초기화명령어에 따라 캐시제어기(20)에 의해 선택된 캐시 라인에 대해서 초기화를 수행하는 캐시 초기화명령 수행단계(S220); 및
상기 캐시 초기화명령 수행단계(S220) 후 프로세서에 의해 선택된 캐시 라인의 락킹데이터 기록 및 락비트갱신을 위한 락명령어를 수행하고, 프로세서에 의해 수행된 락명령어에 따라 캐시제어기(20)에 의해 주메모리에 저장된 락킹데이타를 선택된 캐시 라인의 캐시데이터 저장부(3)에 기록하고, 선택된 캐시 라인의 락비트를 활성화시키는 락킹데이터 기록 및 락비트 갱신단계(S230)를 구비한 것을 특징으로 하는 캐시메모리의 캐시 라인 락킹방법.
Cache tag storage unit 1 storing cache tag data CTAG, cache state storage unit 5 storing valid bits V, dirty bits D, and lock bits L, and cache data storing cache data In the cache line locking method of the cache memory for locking the specific cache line selected by the index of the memory request address MA with respect to the cache memory constituted by the section (3),
A status information reading step (S200) of reading status information of a valid bit (V) and a lock bit (L) of a cache line selected by an index of the memory request address (MA);
A state information determination step (S210) of determining whether the valid bit (V) and the lock bit (L) are activated in the state information reading step (S200);
If neither the valid bit V nor the lock bit L is activated in the state information determining step S210, an initialization instruction for initializing the cache line selected by the processor is performed, and the initialization performed by the processor is performed. Performing a cache initialization command (S220) for performing initialization on the cache line selected by the cache controller 20 according to the command; And
After performing the cache initialization command (S220), a lock command for recording and locking the lock data of the cache line selected by the processor is executed, and the main memory is executed by the cache controller 20 according to the lock command performed by the processor. And a locking data recording and lock bit updating step (S230) for recording the locking data stored in the cache data storage unit 3 of the selected cache line and activating the lock bit of the selected cache line. Cache line locking method.
제 3 항에 있어서, 상기 캐시 초기화명령 수행단계(S220)는,
상기 상태정보 판단단계(S210)에서 상기 유효비트(V)와 락비트(L)가 모두 활성화되어 있지 않으면, 프로세서에 의해 상기 선택된 캐시 라인을 초기화시키기 위한 초기화명령어를 패치하는 초기화명령어 패치단계(S221);
상기 초기화명령어 패치단계(S221)에서 패치된 초기화명령어를 디코더에 의해 디코딩하는 초기화명령어 디코딩단계(S222);
상기 초기화명령어 디코딩단계(S222)에서 디코딩된 초기화명령어를 캐시제어기로 전송하는 초기화명령어 전송단계(S223);
상기 캐시제어기로 전송된 초기화 명령어에 따라 상기 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제1 유효비트와 더티비트 판독단계(S224);
상기 제1 유효비트와 더티비트 판독단계(S224)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제1 유효비트와 더티비트 판단단계(S225);
상기 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 상기 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제1 카피백단계(S226); 및
상기 제1 유효비트와 더티비트 판단단계(S225)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 상기 제1 카피백단계(S226) 완료 후 상기 선택된 캐시 라인의 유효비트(V)를 비활성화시켜 상기 선택된 캐시 라인을 초기화시키는 캐시초기화단계(S227)를 구비한 것을 특징으로 하는 캐시메모리의 캐시 라인 락킹방법.
The method of claim 3, wherein performing the cache initialization command (S220),
If neither the valid bit V nor the lock bit L is activated in the state information determining step S210, an initialization command patch step of patching an initialization command for initializing the selected cache line by a processor (S221). );
An initialization command decoding step (S222) of decoding an initialization command patched in the initialization command patch step (S221) by a decoder;
An initialization command transmission step (S223) of transmitting the initialization command decoded in the initialization command decoding step (S222) to a cache controller;
A first valid bit and dirty bit reading step (S224) of reading a valid bit (V) and a dirty bit (D) of the selected cache line according to an initialization command sent to the cache controller;
A first valid bit and dirty bit determination step (S225) for determining whether the valid bit (V) and the dirty bit (D) read in the first valid bit and dirty bit reading step (S224) are activated;
If both the valid bit V and the dirty bit D are activated in the first valid bit and the dirty bit determination step S225, cache data of the selected cache line is stored in a main memory and the dirty bit D is deactivated. To make a first copyback step (S226); And
In the first valid bit and dirty bit determination step (S225), both the valid bit (V) and the dirty bit (D) are not activated, or after the first copyback step (S226) is completed, the valid bit of the selected cache line ( And a cache initialization step (S227) for deactivating V) to initialize the selected cache line.
제 3 항에 있어서, 상기 락킹데이터 기록 및 락비트 갱신단계(S230)는,
프로세서에 의해 락킹데이터 기록 및 락비트갱신을 위한 락명령어를 패치하는 락명령어 패치단계(S231);
상기 락명령어 패치단계(S231)에서 패치된 락명령어를 디코더에 의해 디코딩하는 락명령어 디코딩단계(S232);
상기 락명령어 디코딩단계(S232)에서 디코딩된 락명령어를 캐시제어기로 전송하는 락명령어 전송단계(S233);
상기 캐시제어기로 전송된 락명령어에 따라 상기 선택된 캐시 라인의 유효비트(V)와 더티비트(D)를 판독하는 제2 유효비트와 더티비트 판독단계(S234);
상기 제2 유효비트와 더티비트 판독단계(S234)에서 판독된 유효비트(V)와 더티비트(D)의 활성화 유무를 판단하는 제2 유효비트와 더티비트 판단단계(S235);
상기 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있으면 주메모리에 상기 선택된 캐시 라인의 캐시데이터를 저장하고 더티비트(D)를 비활성화시키는 제2 카피백단계(S236); 및
상기 제2 유효비트와 더티비트 판단단계(S235)에서 유효비트(V)와 더티비트(D)가 모두 활성화되어 있지 않거나 상기 제2 카피백단계(S236) 완료 후 주메모리에 저장된 락킹데이터를 상기 선택된 캐시 라인의 캐시데이터 저장부(3)에 저장하고, 상기 선택된 캐시 라인의 캐시상태 저장부(5)에 저장된 유효비트(V)와 락비트(L)를 활성화시키는 락킹데이터 처리단계(S237)를 구비한 것을 특징으로 하는 캐시메모리의 캐시 라인 락킹방법.
The method of claim 3, wherein the locking data recording and updating lock bit step (S230),
A lock instruction patch step (S231) of patching a lock instruction for recording locking data and updating the lock bit by a processor;
A lock command decoding step (S232) of decoding the lock command patched in the lock command patch step (S231) by a decoder;
A lock command transmission step (S233) of transmitting the lock command decoded in the lock command decoding step (S232) to a cache controller;
A second valid bit and dirty bit reading step (S234) of reading a valid bit (V) and a dirty bit (D) of the selected cache line according to the lock command transmitted to the cache controller;
A second valid bit and dirty bit determination step (S235) of determining whether the valid bit (V) and the dirty bit (D) are read in the second valid bit and dirty bit reading step (S234);
If both the valid bit (V) and the dirty bit (D) are activated in the second valid bit and dirty bit determination step (S235), cache data of the selected cache line is stored in main memory and the dirty bit (D) is deactivated. A second copyback step (S236); And
In the second valid bit and dirty bit determination step (S235), both the valid bit (V) and the dirty bit (D) are not activated, or after the second copyback step (S236) is completed, the locking data stored in the main memory is read. Locking data processing step (S237) for storing in the cache data storage unit 3 of the selected cache line, and activates the valid bit (V) and lock bit (L) stored in the cache state storage unit 5 of the selected cache line Cache line locking method of the cache memory, characterized in that it comprises a.
KR1020110080470A 2011-08-12 2011-08-12 cache line locking method of cache memory KR101291040B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020110080470A KR101291040B1 (en) 2011-08-12 2011-08-12 cache line locking method of cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020110080470A KR101291040B1 (en) 2011-08-12 2011-08-12 cache line locking method of cache memory

Publications (2)

Publication Number Publication Date
KR20130017812A KR20130017812A (en) 2013-02-20
KR101291040B1 true KR101291040B1 (en) 2013-08-01

Family

ID=47896912

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020110080470A KR101291040B1 (en) 2011-08-12 2011-08-12 cache line locking method of cache memory

Country Status (1)

Country Link
KR (1) KR101291040B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100053540A (en) * 2007-08-02 2010-05-20 프리스케일 세미컨덕터, 인크. Cache locking device and methods thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100053540A (en) * 2007-08-02 2010-05-20 프리스케일 세미컨덕터, 인크. Cache locking device and methods thereof

Also Published As

Publication number Publication date
KR20130017812A (en) 2013-02-20

Similar Documents

Publication Publication Date Title
US10860323B2 (en) Method and apparatus for processing instructions using processing-in-memory
US9251095B2 (en) Providing metadata in a translation lookaside buffer (TLB)
CN101097544B (en) Global overflow method for virtualized transactional memory
US8347141B2 (en) Method and apparatus to maintain data integrity in disk cache memory during and after periods of cache inaccessibility
US5524233A (en) Method and apparatus for controlling an external cache memory wherein the cache controller is responsive to an interagent communication for performing cache control operations
US9170955B2 (en) Providing extended cache replacement state information
US20050198442A1 (en) Conditionally accessible cache memory
US20180300258A1 (en) Access rank aware cache replacement policy
US8131945B2 (en) Disowning cache entries on aging out of the entry
US9128842B2 (en) Apparatus and method for reducing the flushing time of a cache
JP2007011580A (en) Information processing device
US20200104259A1 (en) System, method, and apparatus for snapshot prefetching to improve performance of snapshot operations
USRE49418E1 (en) Information processing apparatus and cache control method
JP5319049B2 (en) Cash system
US10997064B2 (en) Ordering updates for nonvolatile memory accesses
US8069312B2 (en) Apparatus, circuit and method of controlling memory initialization
US8473685B2 (en) Cache memory device, processor, and control method for cache memory device to reduce power unnecessarily consumed by cache memory
KR101291040B1 (en) cache line locking method of cache memory
KR101306623B1 (en) cache way locking method of cache memory
US20230099256A1 (en) Storing an indication of a specific data pattern in spare directory entries
KR100985517B1 (en) cache memory controlling method
KR20220058934A (en) Invalidation of conversion index buffer

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee