40 #include "params/StackDistProbe.hh" 45 lineSize(p->line_size),
46 disableLinearHists(p->disable_linear_hists),
47 disableLogHists(p->disable_log_hists),
50 fatal_if(p->system->cacheLineSize() > p->line_size,
51 "The stack distance probe must use a cache line size that is " 52 "larger or equal to the system's cahce line size.");
60 const StackDistProbeParams *
p(
61 dynamic_cast<const StackDistProbeParams *>(
params()));
64 using namespace Stats;
67 .
init(p->linear_hist_bins)
69 .
desc(
"Reads linear distribution")
73 .
init(p->log_hist_bins)
75 .
desc(
"Reads logarithmic distribution")
79 .
init(p->linear_hist_bins)
81 .
desc(
"Writes linear distribution")
85 .
init(p->log_hist_bins)
87 .
desc(
"Writes logarithmic distribution")
92 .
desc(
"Number of requests with infinite stack distance")
123 int sd_lg2 = sd == 0 ? 1 :
floorLog2(sd);
135 StackDistProbeParams::create()
const FlagsType pdf
Print the percent of the total that this entry represents.
const bool disableLogHists
std::pair< uint64_t, bool > calcStackDistAndUpdate(const Addr r_address, bool addNewNode=true)
Process the given address:
void regStats() override
Callback to set stat parameters.
Histogram & init(size_type size)
Set the parameters of this histogram.
Base class for memory system probes accepting Packet instances.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Stats::Histogram readLinearHist
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
static constexpr uint64_t Infinity
A convenient way of refering to infinity.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Stats::SparseHistogram readLogHist
Stats::Histogram writeLinearHist
const Params * params() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
virtual const std::string name() const
const bool disableLinearHists
SparseHistogram & init(size_type size)
Set the parameters of this histogram.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
virtual void regStats()
Callback to set stat parameters.
void handleRequest(const ProbePoints::PacketInfo &pkt_info) override
Callback to analyse intercepted Packets.
Stats::SparseHistogram writeLogHist
const FlagsType nozero
Don't print if this is zero.
StackDistProbe(StackDistProbeParams *params)
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
A struct to hold on to the essential fields from a packet, so that the packet and underlying request ...