summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/systemc/core/sc_module.cc4
1 files changed, 4 insertions, 0 deletions
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();
}