42#ifndef __MEM_RUBY_STRUCTURES_CACHEMEMORY_HH__
43#define __MEM_RUBY_STRUCTURES_CACHEMEMORY_HH__
46#include <unordered_map>
53#include "mem/ruby/protocol/CacheRequestType.hh"
54#include "mem/ruby/protocol/CacheResourceType.hh"
55#include "mem/ruby/protocol/RubyRequest.hh"
61#include "params/RubyCache.hh"
74 typedef std::shared_ptr<replacement_policy::ReplacementData>
ReplData;
147 void print(std::ostream& out)
const;
258std::ostream&
operator<<(std::ostream& out,
const CacheMemory& obj);
Cycles is a wrapper class for representing cycle counts, i.e.
Abstract superclass for simulation objects.
A common base class of cache replacement policy objects.
Cycles getLatency() const
bool isTagPresent(Addr address) const
Addr getAddressAtIdx(int idx) const
void clearLockedAll(int context)
bool testCacheAccess(Addr address, RubyRequestType type, DataBlock *&data_ptr)
AbstractCacheEntry * getNullEntry() const
Cycles getDataLatency() const
ALUFreeListArray atomicALUArray
bool m_use_occupancy
Set to true when using WeightedLRU replacement policy, otherwise, set to false.
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Cycles getTagLatency() const
std::vector< std::vector< ReplData > > replacement_data
We store all the ReplacementData in a 2-dimensional array.
void print(std::ostream &out) const
CacheMemory & operator=(const CacheMemory &obj)
void recordCacheContents(int cntrl, CacheRecorder *tr) const
void setMRU(Addr address)
bool m_is_instruction_only_cache
gem5::ruby::CacheMemory::CacheMemoryStats cacheMemoryStats
void deallocate(Addr address)
void htmCommitTransaction()
int findTagInSet(int64_t line, Addr tag) const
void setLocked(Addr addr, int context)
int findTagInSetIgnorePermissions(int64_t cacheSet, Addr tag) const
bool isBlockInvalid(int64_t cache_set, int64_t loc)
CacheMemory(const CacheMemory &obj)
int64_t addressToCacheSet(Addr address) const
void htmAbortTransaction()
bool tryCacheAccess(Addr address, RubyRequestType type, DataBlock *&data_ptr)
std::shared_ptr< replacement_policy::ReplacementData > ReplData
void profilePrefetchMiss()
void clearLocked(Addr addr)
void profilePrefetchHit()
bool isBlockNotBusy(int64_t cache_set, int64_t loc)
Addr cacheProbe(Addr address) const
void allocateVoid(Addr address, AbstractCacheEntry *new_entry)
void recordRequestType(CacheRequestType requestType, Addr addr)
void printData(std::ostream &out) const
bool cacheAvail(Addr address) const
CacheMemory(const Params &p)
replacement_policy::Base * m_replacementPolicy_ptr
We use the replacement policies from the Classic memory system.
std::unordered_map< Addr, int > m_tag_index
AbstractCacheEntry * allocate(Addr address, AbstractCacheEntry *new_entry)
int getReplacementWeight(int64_t set, int64_t loc)
std::vector< std::vector< AbstractCacheEntry * > > m_cache
int getCacheAssoc() const
bool checkResourceAvailable(CacheResourceType res, Addr addr)
AbstractCacheEntry * lookup(Addr address)
bool isLocked(Addr addr, int context)
This is a simple scalar statistic, like a counter.
A vector of scalar stats.
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of Statistics objects.
statistics::Histogram htmTransCommitWriteSet
statistics::Scalar m_prefetch_misses
statistics::Scalar numTagArrayWrites
statistics::Scalar numAtomicALUOperations
statistics::Scalar numDataArrayStalls
statistics::Scalar numTagArrayReads
statistics::Scalar numTagArrayStalls
statistics::Scalar m_demand_hits
statistics::Histogram htmTransCommitReadSet
statistics::Vector m_accessModeType
statistics::Scalar m_demand_misses
statistics::Scalar numDataArrayWrites
statistics::Formula m_prefetch_accesses
statistics::Scalar m_prefetch_hits
statistics::Histogram htmTransAbortWriteSet
statistics::Formula m_demand_accesses
statistics::Scalar numAtomicALUArrayStalls
statistics::Scalar numDataArrayReads
statistics::Histogram htmTransAbortReadSet
CacheMemoryStats(statistics::Group *parent)