summaryrefslogtreecommitdiff
path: root/src/systemc/utils
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-22 07:30:28 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:31:12 +0000
commitdc599a0176f12b6fe17084258a1ec8adef6774d8 (patch)
treecbad1692e6898cd2acba7fe1f99b8045e9813b8e /src/systemc/utils
parentebe9b301adceedbd95bc210910181cfca7ad7b30 (diff)
downloadgem5-dc599a0176f12b6fe17084258a1ec8adef6774d8.tar.xz
systemc: Print an Info when setting a tracefile's time unit.
This matches Accellera's output for the tests. Change-Id: Ie67fd673a980b8ca2fdcd8f357ff7993a9091221 Reviewed-on: https://gem5-review.googlesource.com/c/12972 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/utils')
-rw-r--r--src/systemc/utils/tracefile.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/systemc/utils/tracefile.cc b/src/systemc/utils/tracefile.cc
index 20091c307..25d7ea6f3 100644
--- a/src/systemc/utils/tracefile.cc
+++ b/src/systemc/utils/tracefile.cc
@@ -35,6 +35,7 @@
#include "base/logging.hh"
#include "base/output.hh"
#include "sim/core.hh"
+#include "systemc/core/time.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/utils/functions.hh"
@@ -58,6 +59,18 @@ TraceFile::set_time_unit(double d, ::sc_core::sc_time_unit tu)
{
timeUnitValue = d;
timeUnitUnit = tu;
+
+ double secs = d * TimeUnitScale[tu];
+ for (tu = ::sc_core::SC_SEC; tu > ::sc_core::SC_FS;
+ tu = (::sc_core::sc_time_unit)(tu - 1)) {
+ if (TimeUnitScale[tu] <= secs)
+ break;
+ }
+
+ uint64_t i = static_cast<uint64_t>(secs / TimeUnitScale[tu]);
+ std::ostringstream ss;
+ ss << i << " " << TimeUnitNames[tu] << " (" << _os->name() << ")";
+ SC_REPORT_INFO("(I703) tracing timescale unit set", ss.str().c_str());
}
void