From: Gabe Black Date: Thu, 23 Aug 2018 04:37:11 +0000 (-0700) Subject: systemc: Check for time overflow in sc_start. X-Git-Tag: v19.0.0.0~1735 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6184742caf7f80a8b2763bfc31c65789b5dab801;p=gem5.git systemc: Check for time overflow in sc_start. A regression tests checks this situation. Change-Id: I7716bf7c8cf219c372ab9722fc0ad52e7e674b17 Reviewed-on: https://gem5-review.googlesource.com/12256 Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc index 39f6e174b..ea243bf61 100644 --- a/src/systemc/core/sc_main.cc +++ b/src/systemc/core/sc_main.cc @@ -194,6 +194,10 @@ sc_start(const sc_time &time, sc_starvation_policy p) ::sc_gem5::scheduler.oneCycle(); } else { Tick now = ::sc_gem5::scheduler.getCurTick(); + if (MaxTick - now < time.value()) { + SC_REPORT_ERROR("(E544) simulation time value overflow, " + "simulation aborted", ""); + } ::sc_gem5::scheduler.start(now + time.value(), p == SC_RUN_TO_TIME); } }