CohereSim: A Bus-based Cache Simulator  v3.3
A tool for education in computing - learn about coherence protocols, replacement policies, and SMP vs DSM
Public Member Functions
MESI Class Reference

The MESI coherence protocol. More...

#include <mesi.h>

Inheritance diagram for MESI:
Inheritance graph
[legend]
Collaboration diagram for MESI:
Collaboration graph
[legend]

Public Member Functions

 MESI (CacheABC &cache)
 Construct a new MESI coherence protocol. More...
 
void PrRd (cache_line *line)
 Receive a PrRd message. More...
 
void PrWr (cache_line *line)
 Receive a PrWr message. More...
 
bool BusRd (cache_line *line)
 Receive a BusRd message. More...
 
bool BusRdX (cache_line *line)
 Receive a BusRdX message. More...
 
bool BusUpgr (cache_line *line)
 Receive a BusUpgr message. More...
 
bool isWriteBackNeeded (state_e state)
 Determine whether a line needs to be written back to main memory. More...
 
- Public Member Functions inherited from CoherenceProtocol
 CoherenceProtocol (CacheABC &cache)
 Construct a new coherence protocol. More...
 
virtual bool BusUpdt (cache_line *line)
 Receive a BusUpdt message. More...
 
virtual bool BusWr (cache_line *line)
 Receive a BusWr message. More...
 
virtual bool doesDirtySharing ()
 Determine whether the coherence protocol does dirty sharing. More...
 
virtual bool doesWriteNoAllocate ()
 Determine whether the coherence protocol uses write no-allocate. More...
 

Additional Inherited Members

- Protected Attributes inherited from CoherenceProtocol
CacheABCcache
 The parent cache.
 

Detailed Description

The MESI coherence protocol.

Constructor & Destructor Documentation

◆ MESI()

MESI::MESI ( CacheABC cache)
inline

Construct a new MESI coherence protocol.

Parameters
cacheThe parent cache

Member Function Documentation

◆ BusRd()

bool MESI::BusRd ( cache_line line)
virtual

Receive a BusRd message.

Parameters
lineThe cache line accessed
Returns
True if the line data can be or could have been shared

Implements CoherenceProtocol.

◆ BusRdX()

bool MESI::BusRdX ( cache_line line)
virtual

Receive a BusRdX message.

Parameters
lineThe cache line accessed
Returns
True if the line data can be or could have been shared

Reimplemented from CoherenceProtocol.

◆ BusUpgr()

bool MESI::BusUpgr ( cache_line line)
virtual

Receive a BusUpgr message.

Parameters
lineThe cache line accessed
Returns
True if the line data can be or could have been shared

Reimplemented from CoherenceProtocol.

◆ isWriteBackNeeded()

bool MESI::isWriteBackNeeded ( state_e  state)
virtual

Determine whether a line needs to be written back to main memory.

Parameters
stateThe state of the line
Returns
Whether the line needs to be written back to main memory

Implements CoherenceProtocol.

◆ PrRd()

void MESI::PrRd ( cache_line line)
virtual

Receive a PrRd message.

Parameters
lineThe cache line accessed (non-null)

Implements CoherenceProtocol.

◆ PrWr()

void MESI::PrWr ( cache_line line)
virtual

Receive a PrWr message.

Parameters
lineThe cache line accessed (non-null)

Implements CoherenceProtocol.


The documentation for this class was generated from the following files: