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 | Private Attributes
FIFO Class Reference

The FIFO replacement policy. More...

#include <fifo.h>

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

Public Member Functions

 FIFO (CacheABC &cache, uint32_t num_sets, uint32_t assoc)
 Construct a new FIFO replacement policy. More...
 
uint32_t getVictim (uint32_t set_idx)
 Determine which line of a range of lines to replace. More...
 
void printState (uint32_t set_idx)
 Print out the replacer's internal state. More...
 
- Public Member Functions inherited from ReplacementPolicy
 ReplacementPolicy (CacheABC &cache, uint32_t num_sets, uint32_t assoc)
 Construct a new replacement policy. More...
 
virtual void touch (uint32_t set_idx, uint32_t way_idx)
 Notify the replacement policy that a line was just accessed. More...
 

Private Attributes

uint32_t * up_next
 The index of the next line to evict.
 

Additional Inherited Members

- Protected Attributes inherited from ReplacementPolicy
CacheABCcache
 The parent cache.
 
uint32_t num_sets
 The number of sets in the cache.
 
uint32_t assoc
 The associativity of the cache.
 

Detailed Description

The FIFO replacement policy.

Constructor & Destructor Documentation

◆ FIFO()

FIFO::FIFO ( CacheABC cache,
uint32_t  num_sets,
uint32_t  assoc 
)

Construct a new FIFO replacement policy.

Parameters
cacheThe parent cache
num_setsThe number of sets in the cache
assocThe associativity of the chace

Member Function Documentation

◆ getVictim()

uint32_t FIFO::getVictim ( uint32_t  set_idx)
virtual

Determine which line of a range of lines to replace.

Parameters
set_idxThe index of the set to choose from
Returns
The chosen line's index within the set (0 to assoc-1)

Reimplemented from ReplacementPolicy.

◆ printState()

void FIFO::printState ( uint32_t  set_idx)
virtual

Print out the replacer's internal state.

Parameters
set_idxThe index of the set

Reimplemented from ReplacementPolicy.


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