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

Change subject: systemc: Simplify sc_time_stamp().
......................................................................

systemc: Simplify sc_time_stamp().

sc_time is now inherently based on properly scaled Ticks, so there's no
reason to try to scale it to be in picoseconds, especially since the
scaling factor may be unreliable if the timescale hasn't been fixed
yet.

Change-Id: I28baeb9792e81e1d00f6f37672df435766311864
---
M src/systemc/core/sc_main.cc
1 file changed, 2 insertions(+), 6 deletions(-)



diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc
index 735fb0c..e9df6a1 100644
--- a/src/systemc/core/sc_main.cc
+++ b/src/systemc/core/sc_main.cc
@@ -250,12 +250,8 @@
 const sc_time &
 sc_time_stamp()
 {
-    static sc_time tstamp;
-    Tick tick = ::sc_gem5::scheduler.getCurTick();
-    //XXX We're assuming the systemc time resolution is in ps.
-    // If tick is zero, the time scale may not be fixed yet, and
-    // SimClock::Int::ps may be zero.
-    tstamp = sc_time::from_value(tick ? tick / SimClock::Int::ps : 0);
+    static sc_time tstamp(1.0, SC_SEC);
+    tstamp = sc_time::from_value(::sc_gem5::scheduler.getCurTick());
     return tstamp;
 }


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