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
WriteThrough Class Reference

The WriteThrough coherence protocol. More...

#include <write_through.h>

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

Public Member Functions

 WriteThrough (CacheABC &cache)
 Construct a new WriteThrough 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 BusWr (cache_line *line)
 Receive a BusWr message. More...
 
bool doesWriteNoAllocate ()
 Determine whether the coherence protocol uses write no-allocate. 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 BusRdX (cache_line *line)
 Receive a BusRdX message. More...
 
virtual bool BusUpdt (cache_line *line)
 Receive a BusUpdt message. More...
 
virtual bool BusUpgr (cache_line *line)
 Receive a BusUpgr message. More...
 
virtual bool doesDirtySharing ()
 Determine whether the coherence protocol does dirty sharing. More...
 

Additional Inherited Members

- Protected Attributes inherited from CoherenceProtocol
CacheABCcache
 The parent cache.
 

Detailed Description

The WriteThrough coherence protocol.

Constructor & Destructor Documentation

◆ WriteThrough()

WriteThrough::WriteThrough ( CacheABC cache)
inline

Construct a new WriteThrough coherence protocol.

Parameters
cacheThe parent cache

Member Function Documentation

◆ BusRd()

bool WriteThrough::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.

◆ BusWr()

bool WriteThrough::BusWr ( cache_line line)
virtual

Receive a BusWr message.

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

Reimplemented from CoherenceProtocol.

◆ doesWriteNoAllocate()

bool WriteThrough::doesWriteNoAllocate ( )
virtual

Determine whether the coherence protocol uses write no-allocate.

Returns
True if the coherence protocol uses write no-allocate

Reimplemented from CoherenceProtocol.

◆ isWriteBackNeeded()

bool WriteThrough::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 WriteThrough::PrRd ( cache_line line)
virtual

Receive a PrRd message.

Parameters
lineThe cache line accessed (non-null)

Implements CoherenceProtocol.

◆ PrWr()

void WriteThrough::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: