63 size(
p.size), lookupLatency(
p.tag_latency),
65 warmupBound((
p.warmup_percentage/100.0) * (
p.size /
p.block_size)),
66 warmedUp(false), numBlocks(
p.size /
p.block_size),
67 dataBlks(new uint8_t[
p.size]),
90 for (
const auto& location : entries) {
111 assert(requestor_id < system->maxRequestors());
136 *dest_blk = std::move(*src_blk);
167 const uint32_t task_id = blk.
getTaskId();
193 for (
unsigned j = 0;
j < 5; ++
j) {
206 auto print_blk = [&str](
CacheBlk &blk) {
208 str +=
csprintf(
"\tBlock: %s\n", blk.print());
213 str =
"no valid tags\n";
219 : statistics::
Group(&_tags),
222 ADD_STAT(tagsInUse, statistics::units::Rate<
223 statistics::units::
Tick, statistics::units::
Count>::get(),
224 "Average ticks per tags in use"),
226 "Total number of references to valid blocks."),
228 "Sample count of references to valid blocks."),
229 ADD_STAT(avgRefs, statistics::units::Rate<
230 statistics::units::
Count, statistics::units::
Count>::get(),
231 "Average number of references to valid blocks."),
233 "The tick when the warmup percentage was hit."),
234 ADD_STAT(occupancies, statistics::units::Rate<
235 statistics::units::
Count, statistics::units::
Tick>::get(),
236 "Average occupied blocks per tick, per requestor"),
237 ADD_STAT(avgOccs, statistics::units::Rate<
238 statistics::units::Ratio, statistics::units::
Tick>::get(),
239 "Average percentage of cache occupancy"),
241 "Occupied blocks per task id"),
243 "Occupied blocks per task id, per block age"),
244 ADD_STAT(ratioOccsTaskId, statistics::units::Ratio::get(),
245 "Ratio of occupied blocks and all blocks, per task id"),
247 "Number of tag accesses"),
249 "Number of data accesses")
256 using namespace statistics;
262 avgRefs = totalRefs / sampledRefs;
289 ratioOccsTaskId.flags(
nozero);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
virtual std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const =0
Find all possible entries for insertion and replacement of an address.
virtual Addr extractTag(const Addr addr) const
Generate the tag from the given address.
ReplaceableEntry * getEntry(const uint32_t set, const uint32_t way) const
Get an entry based on its set and way.
Tick getAge() const
Get the block's age, that is, the number of ticks since its insertion.
unsigned getRefCount() const
Get the number of references to this block since insertion.
uint32_t getTaskId() const
Get the task id associated to this block.
void insert(const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID)
Set member variables when a block insertion occurs.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
RequestPtr req
A pointer to the original request.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
virtual bool isValid() const
Checks if the entry is valid.
virtual bool matchTag(Addr tag, bool is_secure) const
Checks if the given tag information corresponds to this entry's.
Counter value() const
Return the current value of this stat as its base type.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual void regStats()
Callback to set stat parameters.
virtual void preDumpStats()
Callback before stats are dumped.
const FlagsType nonan
Don't print if this is NAN.
const FlagsType nozero
Don't print if this is zero.
const FlagsType total
Print the total.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
void registerExitCallback(const std::function< void()> &callback)
Register an exit callback.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...