}
action(p_profileMiss, "pm", desc="Profile cache miss") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(p_profileHit, "ph", desc="Profile cache hit") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(t_allocateTBE, "t", desc="allocate TBE Entry") {
// added for profiling
action(uu_profileDataMiss, "\udm", desc="Profile the demand miss"){
- ++L1cache.demand_misses;
+ L1cache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit"){
- ++L1cache.demand_hits;
+ L1cache.profileDemandHit();
}
}
action(uu_profileInstMiss, "\ui", desc="Profile the demand miss") {
- ++Icache.demand_misses;
+ Icache.profileDemandMiss();
}
action(uu_profileInstHit, "\uih", desc="Profile the demand hit") {
- ++Icache.demand_hits;
+ Icache.profileDemandHit();
}
action(uu_profileDataMiss, "\ud", desc="Profile the demand miss") {
- ++Dcache.demand_misses;
+ Dcache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit") {
- ++Dcache.demand_hits;
+ Dcache.profileDemandHit();
}
// store conditionals
}
action(uu_profileMiss, "\um", desc="Profile the demand miss") {
- ++cache.demand_misses;
+ cache.profileDemandMiss();
}
action(uu_profileHit, "\uh", desc="Profile the demand hit") {
- ++cache.demand_hits;
+ cache.profileDemandHit();
}
}
action(uu_profileInstMiss, "\ui", desc="Profile the demand miss") {
- ++Icache.demand_misses;
+ Icache.profileDemandMiss();
}
action(uu_profileInstHit, "\uih", desc="Profile the demand hit") {
- ++Icache.demand_hits;
+ Icache.profileDemandHit();
}
action(uu_profileDataMiss, "\ud", desc="Profile the demand miss") {
- ++Dcache.demand_misses;
+ Dcache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit") {
- ++Dcache.demand_hits;
+ Dcache.profileDemandHit();
}
// store conditionals
}
action(uu_profileInstMiss, "\uim", desc="Profile the demand miss") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(uu_profileInstHit, "\uih", desc="Profile the demand hit") {
- ++L1Icache.demand_hits;
+ L1Icache.profileDemandHit();
}
action(uu_profileDataMiss, "\udm", desc="Profile the demand miss") {
- ++L1Dcache.demand_misses;
+ L1Dcache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit") {
- ++L1Dcache.demand_hits;
+ L1Dcache.profileDemandHit();
}
action(po_observeHit, "\ph", desc="Inform the prefetcher about the hit") {
}
action(uu_profileMiss, "\um", desc="Profile the demand miss") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(uu_profileHit, "\uh", desc="Profile the demand hit") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(nn_addSharer, "\n", desc="Add L1 sharer to list") {
}
action(p_profileMiss, "pi", desc="Profile cache miss") {
- ++cacheMemory.demand_misses;
+ cacheMemory.profileDemandMiss();
}
action(p_profileHit, "ph", desc="Profile cache hit") {
- ++cacheMemory.demand_hits;
+ cacheMemory.profileDemandHit();
}
action(r_load_hit, "r", desc="Notify sequencer the load completed.") {
}
action(l2m_profileMiss, "l2m", desc="l2m miss profile") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(l10m_profileMiss, "l10m", desc="l10m miss profile") {
- ++L1D0cache.demand_misses;
+ L1D0cache.profileDemandMiss();
}
action(l11m_profileMiss, "l11m", desc="l11m miss profile") {
- ++L1D1cache.demand_misses;
+ L1D1cache.profileDemandMiss();
}
action(l1im_profileMiss, "l1lm", desc="l1im miss profile") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(l10h_profileHit, "l10h", desc="l10h hit profile") {
- ++L1D0cache.demand_hits;
+ L1D0cache.profileDemandHit();
}
action(l11h_profileHit, "l11h", desc="l11h hit profile") {
- ++L1D1cache.demand_hits;
+ L1D1cache.profileDemandHit();
}
action(l1ih_profileHit, "l1lh", desc="l1ih hit profile") {
- ++L1Icache.demand_hits;
+ L1Icache.profileDemandHit();
}
action(l2h_profileHit, "l2h", desc="l2h hit profile") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(yy_recycleProbeQueue, "yy", desc="recycle probe queue") {
}
action(l10m_profileMiss, "l10m", desc="l10m miss profile") {
- ++L1D0cache.demand_misses;
+ L1D0cache.profileDemandMiss();
}
action(l11m_profileMiss, "l11m", desc="l11m miss profile") {
- ++L1D1cache.demand_misses;
+ L1D1cache.profileDemandMiss();
}
action(l1im_profileMiss, "l1lm", desc="l1im miss profile") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(l2m_profileMiss, "l2m", desc="l2m miss profile") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(yy_recycleProbeQueue, "yy", desc="recycle probe queue") {
//deallocated in dt_deallocateTBE (only for WB) as it checks the L3Hit flag of the TBE entry.
action(pr_profileL3HitMiss, "pr_l3hm", desc="L3 Hit or Miss Profile") {
if (tbe.L3Hit) {
- ++L3CacheMemory.demand_hits;
+ L3CacheMemory.profileDemandHit();
} else {
- ++L3CacheMemory.demand_misses;
+ L3CacheMemory.profileDemandMiss();
}
}
}
action(uu_profileInstMiss, "\uim", desc="Profile the demand miss") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(uu_profileInstHit, "\uih", desc="Profile the demand hit") {
- ++L1Icache.demand_hits;
+ L1Icache.profileDemandHit();
}
action(uu_profileDataMiss, "\udm", desc="Profile the demand miss") {
- ++L1Dcache.demand_misses;
+ L1Dcache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit") {
- ++L1Dcache.demand_hits;
+ L1Dcache.profileDemandHit();
}
action(z_recycleRequestQueue, "z", desc="Send the head of the mandatory queue to the back of the queue.") {
}
action(uu_profileMiss, "\um", desc="Profile the demand miss") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(uu_profileHit, "\uh", desc="Profile the demand hit") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(y_copyCacheStateToDir, "y", desc="Copy cache state to directory state") {
}
action(uu_profileInstMiss, "\uim", desc="Profile the demand miss") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(uu_profileInstHit, "\uih", desc="Profile the demand hit") {
- ++L1Icache.demand_hits;
+ L1Icache.profileDemandHit();
}
action(uu_profileDataMiss, "\udm", desc="Profile the demand miss") {
- ++L1Dcache.demand_misses;
+ L1Dcache.profileDemandMiss();
}
action(uu_profileDataHit, "\udh", desc="Profile the demand hit") {
- ++L1Dcache.demand_hits;
+ L1Dcache.profileDemandHit();
}
action(w_assertIncomingDataAndCacheDataMatch, "w", desc="Assert that the incoming data and the data in the cache match") {
}
action(uu_profileMiss, "\um", desc="Profile the demand miss") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(uu_profileHit, "\uh", desc="Profile the demand hit") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(w_assertIncomingDataAndCacheDataMatch, "w", desc="Assert that the incoming data and the data in the cache match") {
}
action(uu_profileL1DataMiss, "\udm", desc="Profile the demand miss") {
- ++L1Dcache.demand_misses;
+ L1Dcache.profileDemandMiss();
}
action(uu_profileL1DataHit, "\udh", desc="Profile the demand hits") {
- ++L1Dcache.demand_hits;
+ L1Dcache.profileDemandHit();
}
action(uu_profileL1InstMiss, "\uim", desc="Profile the demand miss") {
- ++L1Icache.demand_misses;
+ L1Icache.profileDemandMiss();
}
action(uu_profileL1InstHit, "\uih", desc="Profile the demand hits") {
- ++L1Icache.demand_hits;
+ L1Icache.profileDemandHit();
}
action(uu_profileL2Miss, "\um", desc="Profile the demand miss") {
- ++L2cache.demand_misses;
+ L2cache.profileDemandMiss();
}
action(uu_profileL2Hit, "\uh", desc="Profile the demand hits") {
- ++L2cache.demand_hits;
+ L2cache.profileDemandHit();
}
action(zz_stallAndWaitMandatoryQueue, "\z", desc="Send the head of the mandatory queue to the back of the queue.") {
int getNumBlocks();
Addr getAddressAtIdx(int);
- Scalar demand_misses;
- Scalar demand_hits;
+ void profileDemandHit();
+ void profileDemandMiss();
}
structure (WireBuffer, inport="yes", outport="yes", external = "yes") {
p.start_index_bit, p.ruby_system),
tagArray(p.tagArrayBanks, p.tagAccessLatency,
p.start_index_bit, p.ruby_system),
- cacheMemoryStats(this),
- ADD_STAT(m_demand_hits, "Number of cache demand hits"),
- ADD_STAT(m_demand_misses, "Number of cache demand misses"),
- ADD_STAT(m_demand_accesses, "Number of cache demand accesses",
- m_demand_hits + m_demand_misses),
- ADD_STAT(m_sw_prefetches, "Number of software prefetches"),
- ADD_STAT(m_hw_prefetches, "Number of hardware prefetches"),
- ADD_STAT(m_prefetches, "Number of prefetches",
- m_sw_prefetches + m_hw_prefetches),
- ADD_STAT(m_accessModeType, "")
+ cacheMemoryStats(this)
{
m_cache_size = p.size;
m_cache_assoc = p.assoc;
m_block_size = p.block_size; // may be 0 at this point. Updated in init()
m_use_occupancy = dynamic_cast<ReplacementPolicy::WeightedLRU*>(
m_replacementPolicy_ptr) ? true : false;
-
- m_sw_prefetches
- .flags(Stats::nozero);
-
- m_hw_prefetches
- .flags(Stats::nozero);
-
- m_prefetches
- .flags(Stats::nozero);
-
- m_accessModeType
- .init(RubyRequestType_NUM)
- .flags(Stats::pdf | Stats::total);
-
- for (int i = 0; i < RubyAccessMode_NUM; i++) {
- m_accessModeType
- .subname(i, RubyAccessMode_to_string(RubyAccessMode(i)))
- .flags(Stats::nozero)
- ;
- }
}
void
"transaction"),
ADD_STAT(htmTransAbortReadSet, "Read set size of a aborted transaction"),
ADD_STAT(htmTransAbortWriteSet, "Write set size of a aborted "
- "transaction")
+ "transaction"),
+ ADD_STAT(m_demand_hits, "Number of cache demand hits"),
+ ADD_STAT(m_demand_misses, "Number of cache demand misses"),
+ ADD_STAT(m_demand_accesses, "Number of cache demand accesses",
+ m_demand_hits + m_demand_misses),
+ ADD_STAT(m_sw_prefetches, "Number of software prefetches"),
+ ADD_STAT(m_hw_prefetches, "Number of hardware prefetches"),
+ ADD_STAT(m_prefetches, "Number of prefetches",
+ m_sw_prefetches + m_hw_prefetches),
+ ADD_STAT(m_accessModeType, "")
{
numDataArrayReads
.flags(Stats::nozero);
.init(8)
.flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan);
+ m_sw_prefetches
+ .flags(Stats::nozero);
+
+ m_hw_prefetches
+ .flags(Stats::nozero);
+
+ m_prefetches
+ .flags(Stats::nozero);
+
+ m_accessModeType
+ .init(RubyRequestType_NUM)
+ .flags(Stats::pdf | Stats::total);
+
+ for (int i = 0; i < RubyAccessMode_NUM; i++) {
+ m_accessModeType
+ .subname(i, RubyAccessMode_to_string(RubyAccessMode(i)))
+ .flags(Stats::nozero)
+ ;
+ }
}
// assumption: SLICC generated files will only call this function
DPRINTF(HtmMem, "htmCommitTransaction: read set=%u write set=%u\n",
htmReadSetSize, htmWriteSetSize);
}
+
+void
+CacheMemory::profileDemandHit()
+{
+ cacheMemoryStats.m_demand_hits++;
+}
+
+void
+CacheMemory::profileDemandMiss()
+{
+ cacheMemoryStats.m_demand_misses++;
+}
\ No newline at end of file
void htmCommitTransaction();
public:
- struct CacheMemoryStats : public Stats::Group
- {
- CacheMemoryStats(Stats::Group *parent);
-
- Stats::Scalar numDataArrayReads;
- Stats::Scalar numDataArrayWrites;
- Stats::Scalar numTagArrayReads;
- Stats::Scalar numTagArrayWrites;
-
- Stats::Scalar numTagArrayStalls;
- Stats::Scalar numDataArrayStalls;
-
- // hardware transactional memory
- Stats::Histogram htmTransCommitReadSet;
- Stats::Histogram htmTransCommitWriteSet;
- Stats::Histogram htmTransAbortReadSet;
- Stats::Histogram htmTransAbortWriteSet;
- };
-
int getCacheSize() const { return m_cache_size; }
int getCacheAssoc() const { return m_cache_assoc; }
int getNumBlocks() const { return m_cache_num_sets * m_cache_assoc; }
*/
bool m_use_occupancy;
- public:
- CacheMemoryStats cacheMemoryStats;
- Stats::Scalar m_demand_hits;
- Stats::Scalar m_demand_misses;
- Stats::Formula m_demand_accesses;
+ private:
+ struct CacheMemoryStats : public Stats::Group
+ {
+ CacheMemoryStats(Stats::Group *parent);
- Stats::Scalar m_sw_prefetches;
- Stats::Scalar m_hw_prefetches;
- Stats::Formula m_prefetches;
+ Stats::Scalar numDataArrayReads;
+ Stats::Scalar numDataArrayWrites;
+ Stats::Scalar numTagArrayReads;
+ Stats::Scalar numTagArrayWrites;
- Stats::Vector m_accessModeType;
+ Stats::Scalar numTagArrayStalls;
+ Stats::Scalar numDataArrayStalls;
+
+ // hardware transactional memory
+ Stats::Histogram htmTransCommitReadSet;
+ Stats::Histogram htmTransCommitWriteSet;
+ Stats::Histogram htmTransAbortReadSet;
+ Stats::Histogram htmTransAbortWriteSet;
+
+ Stats::Scalar m_demand_hits;
+ Stats::Scalar m_demand_misses;
+ Stats::Formula m_demand_accesses;
+
+ Stats::Scalar m_sw_prefetches;
+ Stats::Scalar m_hw_prefetches;
+ Stats::Formula m_prefetches;
+
+ Stats::Vector m_accessModeType;
+ } cacheMemoryStats;
+
+ public:
+ // These function increment the number of demand hits/misses by one
+ // each time they are called
+ void profileDemandHit();
+ void profileDemandMiss();
};
std::ostream& operator<<(std::ostream& out, const CacheMemory& obj);