summaryrefslogtreecommitdiff
path: root/src/systemc/core/time.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-27 01:20:28 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:38:49 +0000
commit34a9b8628f2a0b001a57deed73f887c92d5ffef6 (patch)
tree89f1732dfcf980e5b1c30c7355999cded6c1c90a /src/systemc/core/time.cc
parent5bdeb1a432430dcb265cef77fa9365eceddce7d7 (diff)
downloadgem5-34a9b8628f2a0b001a57deed73f887c92d5ffef6.tar.xz
systemc: Add a non-standard sc_time constructor and from_string.
The sc_time constructor was being called, but because of implicit type conversions, a const char * was being treated as a bool and totally unrelated constructor was being called. This change adds and implements the missing but non-standard constructor. It also implements the from_string function which uses that constructor. Change-Id: I21e7e40fd1a8d1c579b1abdc2036d016501f510c Reviewed-on: https://gem5-review.googlesource.com/c/13191 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/time.cc')
-rw-r--r--src/systemc/core/time.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/systemc/core/time.cc b/src/systemc/core/time.cc
index 4c9086447..587d8cbf4 100644
--- a/src/systemc/core/time.cc
+++ b/src/systemc/core/time.cc
@@ -43,6 +43,15 @@ const char *TimeUnitNames[] = {
[::sc_core::SC_SEC] = "s"
};
+const char *TimeUnitConstantNames[] = {
+ [::sc_core::SC_FS] = "SC_FS",
+ [::sc_core::SC_PS] = "SC_PS",
+ [::sc_core::SC_NS] = "SC_NS",
+ [::sc_core::SC_US] = "SC_US",
+ [::sc_core::SC_MS] = "SC_MS",
+ [::sc_core::SC_SEC] = "SC_SEC"
+};
+
double TimeUnitScale[] = {
[::sc_core::SC_FS] = 1.0e-15,
[::sc_core::SC_PS] = 1.0e-12,