From dd31ad4fad3880ae8bda6172fd9303d719250be5 Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Fri, 6 Nov 2015 10:49:32 -0800 Subject: return -1 on simulation timeout --- src/main/resources/top.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main') 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; + } } -- cgit v1.2.3