< previous page page_548 next page >

Page 548
Firefly The Firefly protocol [21] has four states, but uses only three: Read Private, Read Shared, and Private Dirty, in contrast to the previous examples (refer to Figure 8.23). The invalid state is used only to define an initial condition of a cache line. Firefly uses the update scheme instead of invalidation, i.e., writes to cache are broadcast and written to memory. All other caches sharing the line snoop on the bus and update their copies correspondingly. Therefore, no cache line will be invalid after being properly loaded. There is also a special bus line, the SharedLine, which is asserted to indicate that at least one other cache is sharing the line.
When a read miss occurs, if another cache has a copy of the line, it supplies it to the requesting cache by asserting the SharedLine. All sharing caches, including the requesting cache, set the state of the cache line to Read Shared. If the state of the cache line is previously Dirty, it is written to main memory. If no other cache has a copy of the requested line, it is supplied by the memory and is loaded in the Read Private state.
Similarly, for a write miss, the requested line is supplied either by other caches or by memory. When the line comes from other caches, the SharedLine is asserted and recognized by the requesting cache. Thus, the line is set to the Read Shared state and the ensuing write is broadcast to all caches and memory, which update their copies. If the line is supplied by memory, the cache line is loaded in the Dirty state and written to without broadcasting the new data.
For a write hit, if the line is Dirty or Read Private, it is written to immediately. For the latter case, the state is changed to Dirty. If it is in the Read Shared state, the requesting cache must write the new data to memory. All other caches sharing the line grab the data from the bus and update their copies. In addition, these caches assert the SharedLine. This is needed for the requesting cache to check whether the other caches are still sharing the line. If the line is no longer shared, the broadcast can be avoided (this can happen when other sharing caches have displaced the line from their caches), in which case it is loaded in the Read Private state. Otherwise, it is loaded in the Read Shared state.
Dragon The Dragon approach [191] uses the update protocol (i.e., updates to a cache line are broadcast to the other caches sharing the cache line instead of invalidating the copies in the other caches). It makes use of a SharedLine, which is asserted to indicate that at least one other cache is sharing the same cache line. Dragon allows multiple writers, and a distinctive feature is that instead of also writing through to memory (whenever a cache writes to a shared line), the updates are only propagated to the other caches holding a copy of the same line. Memory is not updated until a line is replaced. This feature necessitates the addition of another state, so that the states of the Dragon are: Read Private, Shared Clean, Shared Dirty, and Dirty Private. The difference between the Shared Clean and Shared Dirty states is that the last cache, if any, to write to a Shared Clean line changes its state to Shared Dirty, while the other sharing cache retains the Shared Clean state. Thus, Shared Dirty (and also Private Dirty) imply ownership.
When a read miss occurs, if the cache line is supplied by other caches that also assert the SharedLine, the line is loaded in the Shared Clean state. For the supplying cache, the state is changed to Shared Dirty if it is previously in the Private Dirty state; or it remains in the Shared Dirty state if that is

 
< previous page page_548 next page >