40#include "params/StackDistProbe.hh"
48 lineSize(
p.line_size),
49 disableLinearHists(
p.disable_linear_hists),
50 disableLogHists(
p.disable_log_hists),
54 fatal_if(
p.system->cacheLineSize() >
p.line_size,
55 "The stack distance probe must use a cache line size that is "
56 "larger or equal to the system's cahce line size.");
61 : statistics::
Group(parent),
62 ADD_STAT(readLinearHist, statistics::units::Count::get(),
63 "Reads linear distribution"),
64 ADD_STAT(readLogHist, statistics::units::Ratio::get(),
65 "Reads logarithmic distribution"),
66 ADD_STAT(writeLinearHist, statistics::units::Count::get(),
67 "Writes linear distribution"),
68 ADD_STAT(writeLogHist, statistics::units::Ratio::get(),
69 "Writes logarithmic distribution"),
70 ADD_STAT(infiniteSD, statistics::units::Count::get(),
71 "Number of requests with infinite stack distance")
73 using namespace statistics;
75 const StackDistProbeParams &
p =
76 dynamic_cast<const StackDistProbeParams &
>(parent->
params());
79 .
init(
p.linear_hist_bins)
83 .
init(
p.log_hist_bins)
87 .
init(
p.linear_hist_bins)
91 .
init(
p.log_hist_bins)
Base class for memory system probes accepting Packet instances.
static constexpr uint64_t Infinity
A convenient way of refering to infinity.
std::pair< uint64_t, bool > calcStackDistAndUpdate(const Addr r_address, bool addNewNode=true)
Process the given address:
gem5::StackDistProbe::StackDistProbeStats stats
const bool disableLogHists
const bool disableLinearHists
void handleRequest(const probing::PacketInfo &pkt_info) override
Callback to analyse intercepted Packets.
StackDistProbe(const StackDistProbeParams ¶ms)
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Histogram & 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.
SparseHistogram & init(size_type size)
Set the parameters of this histogram.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
static constexpr T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
const Params & params() const
const FlagsType pdf
Print the percent of the total that this entry represents.
const FlagsType nozero
Don't print if this is zero.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
statistics::Scalar infiniteSD
statistics::Histogram writeLinearHist
statistics::SparseHistogram readLogHist
statistics::Histogram readLinearHist
statistics::SparseHistogram writeLogHist
StackDistProbeStats(StackDistProbe *parent)
A struct to hold on to the essential fields from a packet, so that the packet and underlying request ...