Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/12458
Change subject: systemc: Report an error if n <= 0 in wait(int n).
......................................................................
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
---
M src/systemc/core/sc_module.cc
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc
index 44e442d..6be3818 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -575,6 +575,10 @@
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();
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12458
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I035cfad279be3859242919a95598f191d5d06165
Gerrit-Change-Number: 12458
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev