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 | Protected Attributes | Private Member Functions
InteractiveMode Class Referenceabstract

The InteractiveMode abstract base class. More...

#include <interactive_mode.h>

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

Public Member Functions

 InteractiveMode (std::string p_name)
 Construct a new interactive mode cache. More...
 
virtual ~InteractiveMode ()
 Finalize the interactive mode output.
 
virtual bool evalutateCommand (std::string &cmd)=0
 Evaluate a command received from the input. More...
 
virtual bool issueBusMsg (bus_msg_e bus_msg)
 Issue a BusRd message to neighboring caches. More...
 
state_e getLineState (uint32_t set_idx, uint32_t way_idx)
 Get the state of a line in the cache. More...
 
virtual void printCmdFormatMessage ()=0
 Write the command format message to stderr.
 

Protected Attributes

std::string p_name
 The name of the policy/protocol being run in interactive mode.
 
cache_line lines [N_INTERACTIVE_MODE_LINES]
 The cache lines in interactive mode.
 

Private Member Functions

virtual void reset ()=0
 Revert the system back to the initial state.
 
virtual void printSeparator ()=0
 Print a horizontal line in the table.
 
virtual void printStats ()=0
 Print results after each operation to the table.
 

Detailed Description

The InteractiveMode abstract base class.

Constructor & Destructor Documentation

◆ InteractiveMode()

InteractiveMode::InteractiveMode ( std::string  p_name)
inline

Construct a new interactive mode cache.

Parameters
p_nameThe policy/protocol name

Member Function Documentation

◆ evalutateCommand()

virtual bool InteractiveMode::evalutateCommand ( std::string &  cmd)
pure virtual

Evaluate a command received from the input.

Parameters
cmdThe input command
Returns
True if the command was successful

Implemented in InteractiveModeReplacer, and InteractiveModeCoherence.

◆ getLineState()

state_e InteractiveMode::getLineState ( uint32_t  set_idx,
uint32_t  way_idx 
)
inlinevirtual

Get the state of a line in the cache.

Parameters
set_idxThe index of the set containing the line
way_idxThe index of the way containing the line (0 to assoc-1)
Returns
The state of the cache line

Implements CacheABC.

◆ issueBusMsg()

virtual bool InteractiveMode::issueBusMsg ( bus_msg_e  bus_msg)
inlinevirtual

Issue a BusRd message to neighboring caches.

Parameters
bus_msgThe specific bus message
Returns
True if the 'COPIES-EXIST' line was asserted

Implements CacheABC.

Reimplemented in InteractiveModeCoherence.


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