완전 연관 캐시(Fully associative cache)
- 주어지는 블록은 아무 캐시 엔트리에 저장될 수 있다
- 캐시내의 모든 엔트리를 검색해야함
- 엔트리당 하나의 비교기가 필요하다
집합 연관 캐시(Set associative cache)
- 집합 하나에 n개의 엔트리를 포함할 수 있다
- 블록 넘버는 집합에 따라 결정된다
- (Block number) modulo ( 캐시안의 집합 개수 )
- 주어진 세트의 모든 항목 한 번에 검색
- n개의 비교기가 필요
직접 사상 캐시는 1way 집합 연관 캐시라고도 볼 수 있다
연습 문제
1워드 크기의 블록 4개로 구성된 세 종류의 캐시가 있다. 하나는 완전 연관 방식, 다른 하나는 2way 집합 연관 방식 나머지는 직접 사상 방식이다. 블록 주소 0, 8, 0, 6, 8 순으로 블록을 참조할 때 각 캐시 구성에서 실패는 몇 번씩 발생하는가?
직접 사상 캐시
0 modulo 4 = 0
6 modulo 4 = 2
8 modulo 4 = 0
1 | 2 | 3 | 4 |
0 | |||
8 | |||
0 | |||
0 | 6 | ||
8 | 6 |
총 5번
2way 집합 연관 캐시
0 modulo 2 = 0
6 modulo 2 = 0
8 modulo 2 = 0
Set 1 | Set 2 | ||
0 | |||
0 | 8 | ||
0 | 8 | ||
0 | 6 | ||
8 | 6 |
총 4번
완전 집합 연관 캐시
Fully | |||
0 | |||
0 | 8 | ||
0 | 8 | 6 | |
0 | 8 | 6 | |
0 | 8 | 6 |
총 3번
'School > 컴퓨터 구조' 카테고리의 다른 글
[컴퓨터 구조] 캐시(Cache) - 캐시 퍼포먼스 측정 (0) | 2023.05.29 |
---|---|
[컴퓨터 구조] 캐시(Cache) - 캐시 미스와 쓰기 처리 (0) | 2023.05.29 |
[컴퓨터 구조] 캐시(Cache) - Direct Mapped Cache (0) | 2023.05.29 |
1-1 Computer Organization (0) | 2023.03.08 |