Gabe Black has submitted this change and it was merged. (
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
Reviewed-on: https://gem5-review.googlesource.com/c/12596
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/sc_time.cc
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
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: 7
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