-
Cache CoherenceStudies/Formal Verification 2023. 1. 26. 10:33
Cache Memory란?
https://www.techtarget.com/searchstorage/definition/cache-memory
What is Cache Memory? Cache Memory in Computers, Explained
Learn the meaning and different types of cache memory, also known as CPU memory, which provides faster access to frequently used program instructions or information that the CPU is likely to need next.
www.techtarget.com
- cache controller란?
: a hardware block responsible for managing the cache memory.
It automatically writes code or data from main memory into the cache.
Cache Coherence
캐시일관성-위키백과
https://ko.wikipedia.org/wiki/%EC%BA%90%EC%8B%9C_%EC%9D%BC%EA%B4%80%EC%84%B1
캐시 일관성 - 위키백과, 우리 모두의 백과사전
위키백과, 우리 모두의 백과사전. -->
ko.wikipedia.org
▶캐시 일관성
- 공유 메모리 시스템에서 각 클라이언트(프로세서)가 가진 로컬 캐시간의 일관성을 의미함
- 각 클라이언트가 자신만의 로컬 캐시를 가지고 다른 여러 클라이언트와 메모리를 공유하고 있을 때, 캐시의 갱신으로 인한 데이터 불일치 문제가 발생함
- 캐시 일관성을 유지한다는 것 = 데이티 불일치 현상을 없애는 것
- 캐시 일관성을 유지하기 위해서는 다른 프로세서가 갱신한 캐시 값을 곧바로 혹은 지연하여 다른 프로세서에서 사용할 수 있도록 해주어야 함
▶캐시 일관성 구조
- 디렉터리 기반
- 캐시 블록의 공유 상태, 노드 등을 기록하는 저장 공간인 디렉터리를 이용하여 관리하는 구조
- 메모리 요청에 대해 어떤 노드에서 해당 캐시 블록의 복사본을 가지고 있는지를 알고 있기 때문에 특정 노드에만 요청을 하게 됨.
- 스누핑(snooping)
- 주소 버스를 항상 감시하여 캐시 상의 메모리에 접근이 있는지를 감시하는 구조
- 다른 캐시에서 쓰기가 발생하면 캐시 컨트롤러에 의해서 자신의 캐시 위에 있는 복사본을 무효화시킴
- 메모리 요청에 대해 다른 모든 노드에 브로드캐스트를 해야함 -> 성능 확장성(Scalability)가 좋지 않음
▶캐시 일관성을 유지하기 위한 주요 프로토콜
- MESI 프로토콜
MESI 프로토콜
- 캐시 메모리의 일관성을 유지하기 위해 별도의 flag 할당한 후 플래그의 상태를 통해 데이터의 유효성 여부를 판단하는 프로토콜
- 메모리가 가질 수 있는 4가지 상태
- Modified(수정) 상태 : 데이터가 수정된 상태
- Exclusive(배타) 상태 : 유일한 복사본이며, 주기억장치의 내용과 동일한 상태
- Shared(공유) 상태 : 데이터가 두 개 이상의 프로세서 캐시에 적재되어 있는 상태
- Invalid(무효) 상태 : 데이터가 다른 프로세스에 의해 수정되어 무효화된 상태
split transaction bus
A split-transaction bus can be thought of as having two distinct bus lines. One line for requests and a separate one for responses. Each of these will act atomically with respect to requests or responses.
http://15418.courses.cs.cmu.edu/spring2013/article/26
Non-Atomic Bus Transactions : 15-418 Spring 2013
We will discuss non atomic bus transactions in this article, the issues that arise from their use, and their benefits. An atomic bus transaction follows the pattern of a client placing a command on the bus, and then another client places a response command
15418.courses.cs.cmu.edu
Write Back Vs. Write Through
▶ Write Through
- CPU가 데이터를 사용하면 캐시에 저장되게 되는데, 데이터가 캐시 됨과 동시에 주기억장치 또는 디스크로 기입되는 방식을 지원하는 구조의 캐시
▶ Write Back
- CPU 데이터를 사용할 때 데이터는 먼저 캐시로 기록되는데,
- 캐시 내에 일시적으로 저장된 후에 블록 단위에 캐시로부터 해제되는 때(캐시안에 있는 내용을 버릴 시)에만
- 주기억장치 또는 보조기억장치에 기록되는 방식
- 데이터를 쓸 때 메모리에는 쓰지 않고 캐시에만 업데이트를 하다가 필요할 때에만 주기억장치나 보조기억장치에 기록하는 방법
MESI Protocol
https://en.wikipedia.org/wiki/MESI_protocol
MESI protocol - Wikipedia
From Wikipedia, the free encyclopedia Cache coherence protocol, includes an Exclusive state as an extension of the MSI protocol. The MESI protocol is an Invalidate-based cache coherence protocol, and is one of the most common protocols that support write-b
en.wikipedia.org
단일-버스 다중프로세서 시스템(2) - 캐쉬 일관성 유지를 위한 버스 감시 매커니즘 (MESI protocol), 디렉토리 기반 캐쉬 프로토콜 (tistory.com)
단일-버스 다중프로세서 시스템(2) - 캐쉬 일관성 유지를 위한 버스 감시 매커니즘 (MESI protocol),
캐시 일관성 유지 방법 중 가장 많이 사용하는 버스 감시 메커니즘에 대한 소개이다. 버스 감시 매커니즘을 이용하는 방법 데이터 일관성 유지를 위하여 버스 감시 기능을 가진 H/W 모듈인 스누
butter-shower.tistory.com
MESI Protocol의 상태
'Studies > Formal Verification' 카테고리의 다른 글
[One Pixel Attack]OPA2D 논문 리뷰 (0) 2023.05.25 MSI protocol - NuSMV 구현 (1) 2023.03.10 [논문] Intriguing properties of neural networks (0) 2023.03.10 NuSMV Turorial (0) 2023.01.26