본문 바로가기

Compiler & Computer Architecture6

Memory Consistency Model Memory Consistency Model 의 필요성 아래에서 2개의 Thread로 코드들을 실행시키는 예를 보자. - initial int A, flag = 0; - Thread 1 A = 1; flag = 1; - Thread 2 while (flag == 0); print(A); 이때 컴파일러는 소스코드의 program order를 제대로 컴파일 되었다 해도, 오른쪽에서 A 는 0을 출력할 수도 있다. 프로세서의 OOO Execution으로 인한 메모리 access 순서가 바뀌었을 수도 있고, 아니면 하필 Thread 1 Cache에서 flag에 대한 write만 먼저 메인메모리에 먼저 반영되었을 수도 있다. * 참고로 동일한 프로세서의 동일한 address에 대한 write는 그 순서가 항상 보.. 2023. 10. 24.
Cache coherency protocols * 이글의 내용 및 그림들의 많은 부분을 아래 자료들로 부터 참고해 왔습니다. - Computer Architecture: A Quantitative Approach ( 6th edition ) - Prof. Dr. Ben H. Juurlink youtube ( https://www.youtube.com/@prof.dr.benh.juurlink5459/videos ) Introduction to Multiprocessor System Memory Architectures 여러프로세서와 캐시 및 메모리를 구성하는 방법은 크게 Centralized Shared-Memory Architectures, Distributed Shared-Memory ( DSM ) 로 나눌 수 있다. Centralized Shar.. 2023. 10. 24.
Instruction-Level Parallelism : Hardware Based Speculation for Out-of-Order Execution * 이글의 내용 및 그림들의 많은 부분을 아래 자료들로 부터 참고해 왔습니다. - Computer Architecture: A Quantitative Approach ( 6th edition ) - Prof. Dr. Ben H. Juurlink youtube ( https://www.youtube.com/@prof.dr.benh.juurlink5459/videos ) * 이글은 프로세서의 Out-of-Order Execution 에 대한 심화내용이니, 해당 내용을 모른다면 이전글 Instruction-Level Parallelism : Out-Of-Order Execution( https://zbvs.tistory.com/36 )을 참고하세요. Key Ideas for H/W Based Out-of-Or.. 2023. 10. 24.
Instruction-Level Parallelism : Out-Of-Order Execution * 이글의 내용 및 그림들의 많은 부분을 아래 자료들로 부터 참고해 왔습니다. - Computer Architecture: A Quantitative Approach ( 6th edition ) - Prof. Dr. Ben H. Juurlink youtube ( https://www.youtube.com/@prof.dr.benh.juurlink5459/videos ) Instruction-Level Parallelism: Concepts and Challenges What is Instruction Level Parallelism? 아래 loop를 봐보자. 비록 x[i] = x[i] + y[i]; 부분에서는 병렬적으로 실행할 부분이 적지만, 각 Iteration 1회는 서로 의존적이지 않으므로 병렬적으로.. 2023. 10. 24.
Hypervisor ( x64 ) # CPU/MMU Memory Mapping Memory Mapping http://haifux.org/lectures/312/High-Level%20Introduction%20to%20the%20Low-Level%20of%20Virtualization.pdf x64라도 access 하려는 virtual address의 [63:48] 비트는 쓰이지 않는다. CR3 레지스터는 PM L4 (PageMap Level4) 물리 주소를 가리키고 access 하려는 virtual address의 [47:39] 비트는 PM L4에 Offset값으로 쓰인다. PML4 엔트리의 구조는 다음과 같다. PML4 Entry의 [51:12] 비트는 다음 레벨( PDPT ) 테이블의 물리 주소를 가리킨다. 같은방식으로 반복해서 .. 2022. 1. 16.
CPU Cache 사상과 회로 구성 참고 글 : https://www.clear.rice.edu/comp425/slides/L24.pdf 이 글은 다음과 같은 시스템을 가정하고 보자. * 메인 메모리 : 4GB ( 32bit 메모리 주소 ) * Cache size : 64KB ( 2^16 bytes ) * Block ( Line ) size : 64byte ( 2^6 bytes ) -> 따라서 메인 메모리의 총 블록 수는 : 2^32 / 2^6 = 2^26 -> 캐시의 총 블록 수는 : 26^16 / 2^6 = 2^10 Fully Associative Mapping ( 완전 연관 사상 ) 완전 연관 사상에서는 하나의 캐시 블록(Line)이 그 어떤 메인메모리 블록이라도 캐싱할 수 있다. 예를들어 하나의 캐시 블록은 26 bit의 Tag값을.. 2021. 12. 4.