Enhanced Am486 Microprocessor
AMD
19
PRELIMINARY
memory coherency. The write-back cache requires en-
hanced system support because the cache may contain
data that is not identical to data in main memory at the
same address location.
4.5
The Enhanced Am486 microprocessor family write-
back cache coherency protocol reduces bus activity
while maintaining data coherency in a multi-master en-
vironment. The cache coherency protocol offers the fol-
lowing advantages:
Write-Back Cache Protocol
n
No unnecessary bus traffic. The protocol dynamical-
ly identifies shared data to the granularity of a cache
line. This dynamic identification ensures that the traf-
fic on the external bus is the minimum necessary to
ensure coherency.
n
Software-transparent. Because the protocol gives
the appearance of a single unified memory, software
does not have to maintain coherency or identify
shared data. Application software developed for a
system without a cache can run without modification.
Software support is required only in the operating
system to identify non-cacheable data regions.
A modified MESI protocol is implemented on the En-
hanced Am486 microprocessor family for systems with
write-back cache support. MESI allows cache line to
exist in four states: modified, exclusive, shared, and in-
valid. The Enhanced Am486 microprocessor family al-
locates memory in the cache due to a read miss. Write
allocation is not implemented. To maintain coherency
between cache and main memory, the MESI protocol
has the following characteristics:
n
The system memory is always updated for the case
during a snoop when a modified line is hit.
n
If a modified line is hit by another master during
snooping, the master is forced off the bus and the
snooped cache writes back the modified line to the
system memory. After the snooped cache completes
the write, the backed-off bus master restarts the ac-
cess and reads the modified data from memory.
4.5.1
Cache Line Overview
To implement the Enhanced Am486 microprocessor cache
coherency protocol, each tag entry is expanded to 2 bits: S1
and S0. Each tag entry is associated with a cache line. Table
3 shows the cache line organization.
Table 3. Cache Line Organization
Data Words (32 Bits)
Address Tag and Status
Address Tag, S1, S0
D0
D1
D2
D3
4.5.2
A cache line can occupy one of four legal states as
indicated by bits S0 and S1. The line states are shown
in Table 4. Each line in the cache is in one of these
states. The state transition is induced either by the pro-
cessor or during snooping from an external bus master.
Line Status and Line State
4.5.2.1
An invalid cache line does not contain valid data for any
external memory location. An invalid line does not par-
ticipate in the cache coherency protocol.
Invalid
4.5.2.2
An exclusive line contains valid data for some external
memory location. The data exactly matches the data in
the external memory location.
Exclusive
4.5.2.3
A shared line contains valid data for an external memory
location and the data is shared by another cache and
exactly matches the data in the external memory, or
indicates that the cache line is in write-through mode.
Shared
4.5.2.4
A modified line contains valid data for an external mem-
ory location. However, the data does not match the data
in the external location because the processor has mod-
ified the data since it was loaded from the external mem-
ory. A cache that contains a modified line is responsible
for ensuring that the data is properly maintained. This
means that in the case of an external access to that line
from another external bus master, the modified line is
first written back to the external memory before the other
external bus master can complete its access. Table 5
shows the MESI cache line states and the correspond-
ing availability of data.
Modified
Table 4. Legal Cache Line States
S1
S0
0
1
0
1
Line State
Invalid
Exclusive
Modified
Shared
0
0
1
1