Deleted Added
sdiff udiff text old ( 12334:e0ab29a34764 ) new ( 14205:197360deaa20 )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright

--- 138 unchanged lines hidden (view full) ---

148
149void
150Text::end()
151{
152 ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
153 stream->flush();
154}
155
156bool
157Text::noOutput(const Info &info)
158{
159 if (!info.flags.isSet(display))
160 return true;
161
162 if (info.prereq && info.prereq->zero())
163 return true;

--- 199 unchanged lines hidden (view full) ---

363
364 if (!info.subdescs[i].empty())
365 desc = info.subdescs[i];
366}
367
368void
369DistPrint::init(const Text *text, const Info &info)
370{
371 name = info.name;
372 separatorString = info.separatorString;
373 desc = info.desc;
374 flags = info.flags;
375 precision = info.precision;
376 descriptions = text->descriptions;
377}
378
379void

--- 126 unchanged lines hidden (view full) ---

506void
507Text::visit(const ScalarInfo &info)
508{
509 if (noOutput(info))
510 return;
511
512 ScalarPrint print;
513 print.value = info.result();
514 print.name = info.name;
515 print.desc = info.desc;
516 print.flags = info.flags;
517 print.descriptions = descriptions;
518 print.precision = info.precision;
519 print.pdf = NAN;
520 print.cdf = NAN;
521
522 print(*stream);
523}
524
525void
526Text::visit(const VectorInfo &info)
527{
528 if (noOutput(info))
529 return;
530
531 size_type size = info.size();
532 VectorPrint print;
533
534 print.name = info.name;
535 print.separatorString = info.separatorString;
536 print.desc = info.desc;
537 print.flags = info.flags;
538 print.descriptions = descriptions;
539 print.precision = info.precision;
540 print.vec = info.result();
541 print.total = info.total();
542 print.forceSubnames = false;

--- 58 unchanged lines hidden (view full) ---

601
602 Result total = 0.0;
603 for (off_type j = 0; j < info.y; ++j) {
604 yvec[j] = info.cvec[iy + j];
605 tot_vec[j] += yvec[j];
606 total += yvec[j];
607 }
608
609 print.name = info.name + "_" +
610 (havesub ? info.subnames[i] : std::to_string(i));
611 print.desc = info.desc;
612 print.vec = yvec;
613 print.total = total;
614 print(*stream);
615 }
616
617 // Create a subname for printing the total
618 vector<string> total_subname;
619 total_subname.push_back("total");
620
621 if (info.flags.isSet(::Stats::total) && (info.x > 1)) {
622 print.name = info.name;
623 print.subnames = total_subname;
624 print.desc = info.desc;
625 print.vec = VResult(1, info.total());
626 print.flags = print.flags & ~total;
627 print(*stream);
628 }
629}
630

--- 51 unchanged lines hidden (view full) ---

682{
683 init(text, info);
684}
685
686/* Initialization function */
687void
688SparseHistPrint::init(const Text *text, const Info &info)
689{
690 name = info.name;
691 separatorString = info.separatorString;
692 desc = info.desc;
693 flags = info.flags;
694 precision = info.precision;
695 descriptions = text->descriptions;
696}
697
698/* Grab data from map and write to output stream */

--- 55 unchanged lines hidden ---