큰 캐시 블록은 공간 지역성에 의해 miss rate를 전반적으로 감소 시킴
그러나 고정된 사이즈의 캐시에서는 문제가 발생
- 큰 블록은 워드에 접근할 때 교체가 일어날 수 있음
- 이것은 miss rate의 증가로 이어짐, why? 블록 교체때문에 정작 필요한 블록들이 빈번히 사라지기 때문
캐시 미스
1. 원래의 PC 값(next PC - 4)을 메모리에 보낸다
2. 메인 메모리에 읽기 동작을 지시하고 메모리가 접근을 끝낼 때까지 기다린다
3. 캐시 엔트리에 쓴다.
- 이 때 메모리에서 인출한 데이터를 데이터 부분에 Write
- 태그 필드에 주소 상위비트를 Write
- 유효비트를 1로 만든다
4. 명령어 수행을 첫 단계부터 다시 시작한다. 캐시에서 명령어를 다시 인출하는데, 이번에는 필요한 명령어를 캐시에서 찾을 수 있게됨
쓰기의 처리(Handling Write)
Store Instruction을 수행할 때, 캐시의 블록만 업데이트된다면?
- 캐시와 메인 메모리간의 데이터 불일치(inconsistent)가 발생할 수 있다
즉시 쓰기(Write-Through)
캐시와 메인 메모리 둘다 업데이트하는 방법(consistency)를 위해
좋은 성능을 기대하기는 어려움, why? 캐시의 처리 속도보다 메인 메모리의 처리 속도가 느리기 때문
- 예를 들어, CPI는 1이고 10%의 명령어가 저장 명령이고 메인 메모리에 데이터를 저장하는 게 100cycle이 소모된다 가정
- CPI = 1 + 0.1 * 100 = 11
쓰기 버퍼(Write-Buffer)
- 데이터가 메모리에 적재되는 동안 데이터를 가지고 있는 장치
- CPU는 계속 수행이 된다
- 메모리에 적재가 완료되면 버퍼는 비워진다
- 버퍼가 Full일 때만, Stall이 발생한다
나중 쓰기(Write-Back)
- 캐시에만 업데이트를 하는 방식
- 블록이 업데이트되는지를 트래킹한다
- 업데이트된 블록이 교체되면 그것을 메인 메모리에 작성한다
'School > 컴퓨터 구조' 카테고리의 다른 글
[컴퓨터 구조] 캐시(Cache) - Associative Caches (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 |