From: Gabe Black Date: Sat, 1 Sep 2018 23:37:55 +0000 (-0700) Subject: systemc: Report an error if n <= 0 in wait(int n). X-Git-Tag: v19.0.0.0~1673 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c639e171abae185a6e0aa0bb908c0e1e37547b7;p=gem5.git systemc: Report an error if n <= 0 in wait(int n). This is in the spec, and tested by one of the regression tests. Change-Id: I035cfad279be3859242919a95598f191d5d06165 Reviewed-on: https://gem5-review.googlesource.com/c/12458 Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc index 44e442d00..6be3818da 100644 --- a/src/systemc/core/sc_module.cc +++ b/src/systemc/core/sc_module.cc @@ -575,6 +575,10 @@ wait() void wait(int n) { + if (n <= 0) { + std::string msg = csprintf("n = %d", n); + SC_REPORT_ERROR("(E525) wait(n) is only valid for n > 0", msg.c_str()); + } for (int i = 0; i < n; i++) wait(); }