From: Matthias Jung Date: Thu, 17 Aug 2017 13:44:49 +0000 (+0200) Subject: tlm: Don't set SystemC time resolution X-Git-Tag: v19.0.0.0~2636 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fc5d4c36a090fc62c78ad427e8d9a1115121ee4;p=gem5.git 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 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- 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();