summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Jung <jungma@eit.uni-kl.de>2017-08-17 15:44:49 +0200
committerMatthias Jung <jungma@eit.uni-kl.de>2017-09-11 08:21:11 +0000
commit7fc5d4c36a090fc62c78ad427e8d9a1115121ee4 (patch)
treebaedf47dac9a448fc01c75fdefd46276db86066b
parenta50bcfb436da42dbd6005da681ed91bb768684f4 (diff)
downloadgem5-7fc5d4c36a090fc62c78ad427e8d9a1115121ee4.tar.xz
tlm: Don't set SystemC time resolution
Some simulators already set the time resolution of SystemC. By coupling gem5 by means of SystemC with an other tool this can lead to problems: When the resolution is set twice the simulation will not work. Therefore, the line is changed to an assertion that checks if the time resolution of the SystemC simulation is set to gem5's value of 1ps. Change-Id: I8aafab9dd593eb4697a3c7f69ce181fd9cdd05c4 Reviewed-on: https://gem5-review.googlesource.com/4520 Reviewed-by: Paul Rosenfeld <prosenfeld@micron.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
-rw-r--r--util/tlm/src/sim_control.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/tlm/src/sim_control.cc b/util/tlm/src/sim_control.cc
index a96daf2c8..fae8db0a4 100644
--- a/util/tlm/src/sim_control.cc
+++ b/util/tlm/src/sim_control.cc
@@ -86,7 +86,8 @@ Gem5SimControl::Gem5SimControl(sc_core::sc_module_name name,
Trace::setDebugLogger(&logger);
Gem5SystemC::setTickFrequency();
- sc_core::sc_set_time_resolution(1, sc_core::SC_PS);
+ assert(sc_core::sc_get_time_resolution()
+ == sc_core::sc_time(1,sc_core::SC_PS));
Gem5SystemC::Module::setupEventQueues(*this);
initSignals();