Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/12255 )
Change subject: systemc: Handle sc_time_stamp before any sc_time is
constructed.
......................................................................
systemc: Handle sc_time_stamp before any sc_time is constructed.
The time resolution won't yet be fixed, so the scaling factor will
still be set to zero.
Change-Id: I1d1e58316ee05cc477a31ce90e2bbf56dcbc65c3
Reviewed-on: https://gem5-review.googlesource.com/12255
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/sc_main.cc
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc
index 47ca2e3..39f6e17 100644
--- a/src/systemc/core/sc_main.cc
+++ b/src/systemc/core/sc_main.cc
@@ -235,7 +235,9 @@
static sc_time tstamp;
Tick tick = ::sc_gem5::scheduler.getCurTick();
//XXX We're assuming the systemc time resolution is in ps.
- tstamp = sc_time::from_value(tick / SimClock::Int::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);
return tstamp;
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12255
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: I1d1e58316ee05cc477a31ce90e2bbf56dcbc65c3
Gerrit-Change-Number: 12255
Gerrit-PatchSet: 9
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