Computer Architecture,  Study

[Computer Arch.] Difference between CAM and Fully-associative Cache?

Computer architecture 분야에서 두 개의 단어는 많이 사용한다. 이 두개는 실제 헷갈릴 수 있는 단어다.

Content-addressable Memory (CAM)

이름 그대로 content를 가지고 access를 하여 address를 얻는 메모리 구조를 말한다. Input으로 특정 content data가 들어오면, 해당 content가 메모리 어디에 있는지 모든 address 영역을 뒤져서 찾는다. 따라서 매우 값비싼 동작을 필요로한다. 대표적인 예시로 CPU microarchitecture에서 사용하는 IQ (Instruction Queue) 가 있는데, 특정 register의 결과가 어떤 IQ에서 source operand로 사용하는지 모든 메모리 (IQ)를 뒤질 때 사용된다.

또한 cache 구조에서 말하는 fully-associative cache 구조에서 tag matching을 하는 영역을 CAM 형태의 구조로 일컬을 수도 있다. 즉, CAM은 fully-associative cache 구조의 일부가 될 수 있다.

Input: data
Output: address

Fully-associative Cache

Cache에서 associative 라는 단어는 많이 사용되는데, 여기서 fully-associative cache는 모든 address를 tag로 사용해서 해당 tag가 존재하는지 뒤지고, 존재하면 해당 address의 data를 뱉어낸다.
Fully-associative cache는 위에서 언급한 CAM 구조를 포함하며, 실제 데이터를 저장하는 메모리도 함께 포함한다.

Input: address
Output: address에 해당하는 data

Reference

Leave a Reply

Your email address will not be published. Required fields are marked *