Go to the documentation of this file.
41 #if defined(__APPLE__)
42 #define _GLIBCPP_USE_C99 1
66 constexpr
auto Nan = std::numeric_limits<float>::quiet_NaN();
76 : mystream(false), stream(NULL), descriptions(false), spaces(false)
103 panic(
"stream already set!");
108 fatal(
"Unable to open output stream for writing\n");
115 panic(
"stream already set!");
118 stream =
new std::ofstream(file.c_str(), std::ios::trunc);
120 fatal(
"Unable to open statistics file for writing\n");
132 ccprintf(*
stream,
"\n---------- Begin Simulation Statistics ----------\n");
138 ccprintf(*
stream,
"\n---------- End Simulation Statistics ----------\n");
164 assert(!
path.empty());
183 std::stringstream
val;
185 if (!std::isnan(value)) {
187 val.precision(precision);
188 else if (value == rint(value))
191 val.unsetf(std::ios::showpoint);
192 val.setf(std::ios::fixed);
216 bool enable_descriptions, std::string _desc,
217 bool enable_units, std::string unit_str,
265 void operator()(std::ostream &stream,
bool oneLine =
false)
const;
285 std::stringstream pdfstr, cdfstr;
287 if (!std::isnan(
pdf))
290 if (!std::isnan(
cdf))
299 if (
spaces || pdfstr.rdbuf()->in_avail())
301 if (
spaces || cdfstr.rdbuf()->in_avail())
353 print.
pdf = _total ? 0.0 : Nan;
354 print.
cdf = _total ? 0.0 : Nan;
537 std::stringstream namestr;
544 namestr <<
"-" <<
high;
546 print.
name = namestr.str();
644 bool havesub =
false;
677 yvec[
j] = info.
cvec[iy +
j];
678 tot_vec[
j] += yvec[
j];
694 total_subname.push_back(
"total");
781 MCounter::const_iterator it;
783 std::stringstream namestr;
786 namestr <<(*it).first;
787 print.
name = namestr.str();
788 print.
value = (*it).second;
804 initText(
const std::string &filename,
bool desc,
bool spaces)
807 static bool connected =
false;
#define fatal(...)
This implements a cprintf based fatal() function.
SparseHistPrint(const Text *text, const SparseHistInfo &info)
std::vector< std::string > subdescs
std::string separatorString
int precision
The display precision.
const Info * prereq
A pointer to a prerequisite Stat.
virtual std::string getUnitString() const =0
double Result
All results are doubles.
virtual size_type size() const =0
std::vector< std::string > subnames
Names and descriptions of subfields.
virtual bool zero() const =0
virtual const VResult & result() const =0
void beginGroup(const char *name) override
const FlagsType nozero
Don't print if this is zero.
void operator()(std::ostream &stream) const
const std::string to_string(sc_enc enc)
Data structure of sparse histogram.
void update(Result val, Result total)
std::vector< std::string > y_subnames
const FlagsType nonan
Don't print if this is NAN.
std::string csprintf(const char *format, const Args &...args)
void init(const Text *text, const Info &info)
void setup(std::string _name, Flags _flags, int _precision, bool enable_descriptions, std::string _desc, bool enable_units, std::string unit_str, bool enable_spaces)
std::string separatorString
OutputStream * findOrCreate(const std::string &name, bool binary=false)
Flags flags
The formatting flags.
std::vector< Result > VResult
vector of results.
void ccprintf(cp::Print &print)
virtual Result result() const =0
const FlagsType pdf
Print the percent of the total that this entry represents.
std::vector< std::string > subdescs
std::stack< std::string > path
std::ostream * stream() const
Get the output underlying output stream.
VCounter cvec
Local storage for the entry values, used for printing.
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
const units::Base * unit
The unit of the stat.
std::string ValueToString(Result value, int precision)
const FlagsType display
Print this stat.
void init(const Text *text, const Info &info)
void visit(const ScalarInfo &info) override
const FlagsType cdf
Print the cumulative percentage of total upto this entry.
virtual Result total() const =0
void operator()(std::ostream &stream) const
void printUnits(std::ostream &stream) const
virtual Result total() const =0
void operator()(std::ostream &stream, bool oneLine=false) const
bool valid() const override
BasePrint(bool _spaces=false)
const std::string & name()
std::list< Info * > & statsList()
void open(std::ostream &stream)
std::vector< std::string > subdescs
const SparseHistData & data
DistPrint(const Text *text, const DistInfo &info)
virtual size_type size() const =0
const FlagsType oneline
Print all values on a single line.
std::string desc
The description of the stat.
General container for distribution data.
bool noOutput(const Info &info)
double Counter
All counters are of 64-bit values.
std::string statName(const std::string &name) const
std::vector< std::string > subnames
static std::string separatorString
The separator string used for vectors, dist, etc.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const FlagsType total
Print the total.
std::string separatorString
Output * initText(const std::string &filename, bool desc, bool spaces)
std::vector< std::string > subnames
Names and descriptions of subfields.
void operator()(std::ostream &stream) const
std::vector< std::string > subnames
Names and descriptions of subfields.
std::string name
The name of the stat.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:51 for gem5 by doxygen 1.8.17