From: Gabe Black Date: Sat, 22 Sep 2018 15:05:16 +0000 (-0700) Subject: systemc: Simplify sc_time_stamp(). X-Git-Tag: v19.0.0.0~1564 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c56d8adfe5c1f9cb28842a0b9f83873db1ab22f;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/12974 Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc index 735fb0c1b..e9df6a1e0 100644 --- a/src/systemc/core/sc_main.cc +++ b/src/systemc/core/sc_main.cc @@ -250,12 +250,8 @@ sc_stop() 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; }