CohereSim: A Bus-based Cache Simulator  v3.3
A tool for education in computing - learn about coherence protocols, replacement policies, and SMP vs DSM
moesi.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "coherence_protocol.h"
7 
9 class MOESI : public CoherenceProtocol {
10 public:
11 
15 
18  void PrRd(cache_line* line);
21  void PrWr(cache_line* line);
22 
26  bool BusRd(cache_line* line);
30  bool BusRdX(cache_line* line);
34  bool BusUpgr(cache_line* line);
35 
38  bool doesDirtySharing();
39 
43  bool isWriteBackNeeded(state_e state);
44 };
The cache interface.
Definition: cache_abc.h:9
The base class for coherence protocols.
Definition: coherence_protocol.h:14
CacheABC & cache
The parent cache.
Definition: coherence_protocol.h:65
The MOESI coherence protocol.
Definition: moesi.h:9
bool doesDirtySharing()
Determine whether the coherence protocol does dirty sharing.
Definition: moesi.cc:91
void PrWr(cache_line *line)
Receive a PrWr message.
Definition: moesi.cc:24
void PrRd(cache_line *line)
Receive a PrRd message.
Definition: moesi.cc:8
bool BusRdX(cache_line *line)
Receive a BusRdX message.
Definition: moesi.cc:61
bool BusRd(cache_line *line)
Receive a BusRd message.
Definition: moesi.cc:43
MOESI(CacheABC &cache)
Construct a new MOESI coherence protocol.
Definition: moesi.h:14
bool isWriteBackNeeded(state_e state)
Determine whether a line needs to be written back to main memory.
Definition: moesi.cc:95
bool BusUpgr(cache_line *line)
Receive a BusUpgr message.
Definition: moesi.cc:78
Definition of the coherence protocol base class.
Cache line fields (without data field)
Definition: typedefs.h:152
state_e
Cache line state.
Definition: typedefs.h:64