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

Change subject: systemc: Implement + and - for sc_time, and sc_max_time.
......................................................................

systemc: Implement + and - for sc_time, and sc_max_time.

Change-Id: I294b63840e42e2afdef198229adc60ddbb60b9a1
---
M src/systemc/core/sc_time.cc
1 file changed, 7 insertions(+), 8 deletions(-)



diff --git a/src/systemc/core/sc_time.cc b/src/systemc/core/sc_time.cc
index f51b158..43d3900 100644
--- a/src/systemc/core/sc_time.cc
+++ b/src/systemc/core/sc_time.cc
@@ -28,6 +28,7 @@
  */

 #include "base/logging.hh"
+#include "base/types.hh"
 #include "python/pybind11/pybind.hh"
 #include "systemc/ext/core/sc_time.hh"

@@ -239,17 +240,15 @@
 }

 const sc_time
-operator + (const sc_time &, const sc_time &)
+operator + (const sc_time &a, const sc_time &b)
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return sc_time();
+    return sc_time::from_value(a.value() + b.value());
 }

 const sc_time
-operator - (const sc_time &, const sc_time &)
+operator - (const sc_time &a, const sc_time &b)
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return sc_time();
+    return sc_time::from_value(a.value() - b.value());
 }

 const sc_time
@@ -305,8 +304,8 @@
 const sc_time &
 sc_max_time()
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return *(const sc_time *)nullptr;
+    static const sc_time MaxScTime = sc_time::from_value(MaxTick);
+    return MaxScTime;
 }

 void

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12040
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: I294b63840e42e2afdef198229adc60ddbb60b9a1
Gerrit-Change-Number: 12040
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