Skip to content

Class simtix::mem::CacheInterface

ClassList > simtix > mem > CacheInterface

Abstract interface for cache implementations.

  • #include <mem.h>

Inherits the following classes: simtix::mem::MemoryInterface

Inherited by the following classes: simtix::mem::Cache, simtix::mem::NBHBCache

Public Types inherited from simtix::mem::MemoryInterface

See simtix::mem::MemoryInterface

Type Name
typedef std::function< bool(RespStatus)> OnResp
enum uint8_t RespStatus

Public Functions

Type Name
virtual void AttachNextLevel (MemoryInterface * next_level) = 0
Attach the next level of memory hierarchy.
CacheInterface (const std::string & name, sim::TickPri pri=sim::kMemTickPri)
Constructor of CacheInterface .
virtual bool Flush (OnResp on_resp) = 0
Flush the cache.
virtual void ResetStat () = 0
Reset the statistics of the cache.
virtual const std::shared_ptr< stat::Group > stat () const = 0
Get statistics group for the cache.
virtual ~CacheInterface () = default

Public Functions inherited from simtix::mem::MemoryInterface

See simtix::mem::MemoryInterface

Type Name
MemoryInterface (const std::string & name, sim::TickPri pri=sim::kMemTickPri)
virtual bool Read (Payload payload, OnResp on_resp)
Enqueue a read request to the request queue.
virtual bool Write (Payload payload, OnResp on_resp)
Enqueue a write request to the request queue.
virtual uint8_t & operator[] (const uint64_t addr) = 0
The operator[] is used by the simulator to read or modify memory directly.
virtual ~MemoryInterface () = default

Public Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
Clocked (const std::string & name, TickPri pri=kDefaultPri)
Constructor for clocled.
const std::string & name () const
Get the name of the clocked object.
virtual ~Clocked ()

Protected Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
std::string name_
TickPri pri_

Protected Static Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
bool busy_ = true
std::map< TickPri, std::vector< Clocked * > > clocked_objs_map_
uint64_t cur_tick_ = 0

Protected Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
virtual bool HasPendingTasks () = 0
Checks if any registered clocked objects have pending tasks at the current tick.
virtual void Tick () = 0
Global tick function that advances the simulation by one cycle.

Protected Static Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
void Register (Clocked * c)
Register a clocked object to participate in tick-driven simulation.
void Unregister (Clocked * c)
Unregister a clocked object from tick-driven simulation.

Public Functions Documentation

function AttachNextLevel

Attach the next level of memory hierarchy.

virtual void simtix::mem::CacheInterface::AttachNextLevel (
    MemoryInterface * next_level
) = 0

Parameters:

  • next_level Pointer to the next level memory interface.

function CacheInterface

Constructor of CacheInterface .

inline explicit simtix::mem::CacheInterface::CacheInterface (
    const std::string & name,
    sim::TickPri pri=sim::kMemTickPri
) 

Parameters:

  • name Name of the cache interface.
  • pri Priority of the cache interface.

function Flush

Flush the cache.

virtual bool simtix::mem::CacheInterface::Flush (
    OnResp on_resp
) = 0

Parameters:

  • on_resp Callback for the response.

Returns:

True if the flush operation is successful.


function ResetStat

Reset the statistics of the cache.

virtual void simtix::mem::CacheInterface::ResetStat () = 0


function stat

Get statistics group for the cache.

virtual const std::shared_ptr< stat::Group > simtix::mem::CacheInterface::stat () const = 0

Returns:

Pointer to the statistics group.


function ~CacheInterface

virtual simtix::mem::CacheInterface::~CacheInterface () = default


The documentation for this class was generated from the following file projects/simtix/include/simtix/mem.h