Tuesday, June 21, 2011

What are the advantages of L1 and L2 Cache memories? Describe the Set Associative Cache mapping scheme.

What are the advantages of L1 and L2 Cache memories? Describe the Set Associative Cache mapping scheme.

Answer:


Uploaded with ImageShack.us

In the above architecture the Data-caches is shown as split-caches with two levels LI and L2. The I-Cache stands for instruction cache. PA means physical addressing, VA = virtual addressing, D -Data and I = Instruction. In the above diagram the first level LI cache uses 64KB ofWT D-cache. The second level L2 uses 256KB of WB D-cache.

The main advantage of multi-level cache is faster access, as by inclusion property; the first-level cache is always a subset of the second-level cache. If the hardware consistency is maintained between two cache levels, the efficiency of this multi-level cache organisation is comparatively improved.

The major advantages of multi-level caches include.
• No need to perform cache flusing.
• No aliasing problems.
• Fewer cache bugs in 0.5 kernels.
• When it is used in unix environment no Hushing to data caches is needed if bus watching is provided to monitor the system bus for DMA requests from I/o devices or from other CPUs.

Set Associative Cache Mapping Scheme :
In this mapping each word of cache can store two or more words of memory under the same index address. Each data word is stored together with its tag and the number of tag word item in one word of cache is said to form a set. A set associative cache of set size K will accommodate K words of main memory in each word of cache. Set associative cache offers the best performance cost ratio.




Uploaded with ImageShack.us

Most high-performance computer systems are based on this scheme. A set associative cache of set size K is called K-way associative cache. In a k-way associative cache, the m cache block frames are divided into V = m/k sets, .with k blocks per set. Each set is identified by a d-bet set number, where 2-= V. The cache block tags are no reduced to s-d bets. The set size k, is chosen as 2, 4, 8, 16 or 64 depending on a tradeoff among block size. W, cache size m, and other cost factors. A two-way associative cache with four sets is shown above.


Advantages of set-associative cache scheme :
• The block replacement algorithm needs to consider only a few blocks in the same set. Hence, the replacement policy can be more economically implemented with limited choices.
• The k-ways associative search is easier to implement
• Many design tradeoffs can be considered to yield a higher hit ratio on the cache. Often the cache operation is used together with TLB (Translation Lookaside Buffer)

No comments:

Post a Comment