Information Technology Reference
In-Depth Information
block. The write-through policy maintains coherence between the cache blocks and
their counterparts in the main memory at the expense of the extra time needed to
write to the main memory. This leads to an increase in the average access time.
On the other hand, the write-back policy eliminates the increase in the average
access time. However, coherence is only guaranteed at the time of replacement.
Cache Write Policy Upon a Cache Miss
Two main schemes can be used.
These are write-allocate whereby the main memory block is brought to the cache
and then updated. The other scheme is called write-no-allocate whereby the
missed main memory block is updated while in the main memory and not brought
to the cache.
In general, write-through caches use write-no-allocate policy while write-back
caches use write-allocate policy.
Cache Read Policy Upon a Cache Miss
Two possible strategies can be used.
In the first, the main memory missed block is brought to the cache while the required
word is forwarded immediately to the CPU as soon as it is available. In the second
strategy, the missed main memory block is entirely stored in the cache and the
required word is then forwarded to the CPU.
Having discussed the issues related to the design and analysis of cache memory,
we briefly present formulae for the average access time of a memory hierarchy under
different cache write policies.
Case No. 1: Cache Write-Through Policy
Write-allocate
In this case, the average access time for a memory system is given
by
t a ¼ t c þ
(1
h)t b þ w(t m t c )
where t b is the time required to transfer a block to the cache, (t m t c ) is the
additional time incurred due to the write operations, w is the fraction of write oper-
ations. It should be noted that if the data path and organization allow, then t b ¼ t m ;
otherwise, t b ¼ Bt m , where B is the block size in words.
Write-no-allocate
In this case, the average access time can be expressed as
t a ¼ t c þ
(1
w)(1
h)t b þ w(t m t c )
Case No. 2: Cache Write-Back Policy
The average access time for a system
that uses a write-back policy is given by t a ¼ t c þ
h)t b , where w b
is the probability that a block has been altered while being in the cache.
(1
h)t b þ w b (1
Search WWH ::




Custom Search