summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-22 21:37:11 -0700
committerGabe Black <gabeblack@google.com>2018-09-25 23:59:14 +0000
commit6184742caf7f80a8b2763bfc31c65789b5dab801 (patch)
treef7a4ba929413c6462213b22b4dc73718f3699c5c
parentfb8ce429b339016188996d624608c91bb0afda68 (diff)
downloadgem5-6184742caf7f80a8b2763bfc31c65789b5dab801.tar.xz
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 <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/core/sc_main.cc4
1 files changed, 4 insertions, 0 deletions
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);
}
}