summaryrefslogtreecommitdiff
path: root/src/main/resources/top.cpp
diff options
context:
space:
mode:
authorHenry Cook2015-11-06 10:49:32 -0800
committerHenry Cook2015-11-06 10:49:32 -0800
commitdd31ad4fad3880ae8bda6172fd9303d719250be5 (patch)
tree0720013a5389431d8f0995b56af37f46a201f49a /src/main/resources/top.cpp
parentcc9845a05ddb013408643180be007530496fffc9 (diff)
return -1 on simulation timeout
Diffstat (limited to 'src/main/resources/top.cpp')
-rw-r--r--src/main/resources/top.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/resources/top.cpp b/src/main/resources/top.cpp
index 8951032e..756b5531 100644
--- a/src/main/resources/top.cpp
+++ b/src/main/resources/top.cpp
@@ -78,14 +78,14 @@ int main(int argc, char** argv) {
if (tfp) tfp->close();
#endif
- if (main_time >= timeout)
+ if (main_time >= timeout) {
cout << "Simulation terminated by timeout at cycle " << main_time << endl;
- else
+ return -1;
+ } else {
cout << "Simulation completed at cycle " << main_time << endl;
-
- int error = top->io__024error;
- cout << "Simulation return value: " << error << endl;
-
- return error;
+ int error = top->io__024error;
+ cout << "Simulation return value: " << error << endl;
+ return error;
+ }
}