From 6184742caf7f80a8b2763bfc31c65789b5dab801 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 22 Aug 2018 21:37:11 -0700 Subject: 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 --- src/systemc/core/sc_main.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/systemc') 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); } } -- cgit v1.2.3