CohereSim: A Bus-based Cache Simulator  v3.3
A tool for education in computing - learn about coherence protocols, replacement policies, and SMP vs DSM
fifo.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "replacement_policy.h"
7 
9 class FIFO : public ReplacementPolicy {
10 public:
11 
16  FIFO(CacheABC& cache, uint32_t num_sets, uint32_t assoc);
17  ~FIFO();
18 
22  uint32_t getVictim(uint32_t set_idx);
23 
26  void printState(uint32_t set_idx);
27 
28 private:
29 
31  uint32_t* up_next;
32 };
The cache interface.
Definition: cache_abc.h:9
The FIFO replacement policy.
Definition: fifo.h:9
void printState(uint32_t set_idx)
Print out the replacer's internal state.
Definition: fifo.cc:22
uint32_t getVictim(uint32_t set_idx)
Determine which line of a range of lines to replace.
Definition: fifo.cc:16
FIFO(CacheABC &cache, uint32_t num_sets, uint32_t assoc)
Construct a new FIFO replacement policy.
Definition: fifo.cc:8
uint32_t * up_next
The index of the next line to evict.
Definition: fifo.h:31
The base class for replacement policies.
Definition: replacement_policy.h:9
uint32_t num_sets
The number of sets in the cache.
Definition: replacement_policy.h:40
uint32_t assoc
The associativity of the cache.
Definition: replacement_policy.h:42
CacheABC & cache
The parent cache.
Definition: replacement_policy.h:37
Declaration of the replacement policy base class.