Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12596

Change subject: systemc: Implement sc_time::to_string.
......................................................................

systemc: Implement sc_time::to_string.

This is just another way to call sc_time::print, but it returns a
string instead of printing to a stream.

Change-Id: Idc90c539127e6153af9511bfe5f258b870362330
---
M src/systemc/core/sc_time.cc
1 file changed, 4 insertions(+), 2 deletions(-)



diff --git a/src/systemc/core/sc_time.cc b/src/systemc/core/sc_time.cc
index 74345d0..69d58e5 100644
--- a/src/systemc/core/sc_time.cc
+++ b/src/systemc/core/sc_time.cc
@@ -27,6 +27,7 @@
  * Authors: Gabe Black
  */

+#include <sstream>
 #include <vector>

 #include "base/logging.hh"
@@ -211,8 +212,9 @@
 const std::string
 sc_time::to_string() const
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return "";
+    std::ostringstream ss;
+    print(ss);
+    return ss.str();
 }

 bool

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12596
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: Idc90c539127e6153af9511bfe5f258b870362330
Gerrit-Change-Number: 12596
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to