Open elinjkim opened 8 years ago
* clidr : cache level id register
* Figure 4.19. CLIDR bit assignments
* 29 27 24 21 18 15 12 9 6 3 0
*+-----------------------------------------------------------------+
*| |LoUU|Loc|LoUIS|Ctype7|Ctype6|Ctype5|Ctype4|Ctype3|Ctype2|Ctype1|
*+-----------------------------------------------------------------+
* Ctype1 : Level 1 cache의 구현 type
* Ctype2 : Level 2 Cache의 구현 type
캐시 구조와 관련해서 p413 참고
클린 & 플러시 관련 내용은 p431 "12.5.4 Cleaning the D-Cache Using Way and Set Index Addressing" 참고
* L2 캐시 지원 여부를 알아아보는 소스
* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0464d/BABHCIHB.html
* clidr[26:24] LoC
* Indicates the Level of Coherency for the cache hierarchy:
* - 0b000 L2 cache not implemented on the processor.
* - 0b010 L2 cache coherency.
* r3 = clidr & 0x07000000;
* r3 = r3 >> 23;
* if(r3 == 0) // L2 캐시 지원하지않음.
* goto finished;
Direct mapped cache에서는 메인 메모리로부터 값을 저장하기 위해 사용할 수 있는 공간이 하나이므로 가장 높은 thrashing을 야기할 수 있음 => thrashing 때문에 캐시 라인을 반복해서 제거하고 로딩하는 작업이 일어남
=> trashing(스레싱)을 줄이기위해서 캐시는 way라는 더 작은 단위로 쪼개짐 . 하나의 메인메모리 주소에 대해 캐시 안에 여러개의 저장 위치를 제공할 수 있음(세트 연상 캐시, set associativity)
way를 이용하여 캐시라인을 클린하고 플러시하는 데 사용하는 MRC명령어 (위의 표)
- 명령어 캐시라인 플러시
- 데이터 캐시라인 플러시
- 데이터 캐시라인 클린
- 데이터 캐시라인 클린 및 플러시
Table 4-47 shows the individual bit field and complete register encodings for the CCSIDR. The CSSELR determines which CCSIDR to select.
결국 cssidr(캐시의 way나 라인수)를 읽어오기 전에 어떤 level의 캐시를 읽어올지 선택을 csselr로 해주는 것이라고 되어있습니다.
https://en.wikipedia.org/wiki/ARM_Cortex-A7 라즈베리 파이가 사용하는 코어의 cache정보를 찾아봤습니다.
L1 cache 8–64 KB/8–64 KB <-- L1은 8 way 32KB+32KB 입니다. (32KB L1 instruction cache and a 32KB L1 ) L2 cache Optional, up to 1 MB <-- L2는 512kb입니다. ( 2836 has a 512KB L2 cache)
39주차 스터디 시작합니다. 토즈 강남토즈타워점