Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12972 )

Change subject: systemc: Print an Info when setting a tracefile's time unit.
......................................................................

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 <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/utils/tracefile.cc
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/systemc/utils/tracefile.cc b/src/systemc/utils/tracefile.cc
index 20091c3..25d7ea6 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 @@
 {
     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

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12972
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie67fd673a980b8ca2fdcd8f357ff7993a9091221
Gerrit-Change-Number: 12972
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to