From 3b8270b82bfbdba29e98498e483847253888b2fc Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Mon, 11 Apr 2022 11:59:41 +0200 Subject: [PATCH] #241 Fix Murax/Briey TB timeouts --- src/test/cpp/briey/main.cpp | 2 -- src/test/cpp/common/framework.h | 7 +++++-- src/test/cpp/murax/main.cpp | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/cpp/briey/main.cpp b/src/test/cpp/briey/main.cpp index c0e165a..bebe880 100644 --- a/src/test/cpp/briey/main.cpp +++ b/src/test/cpp/briey/main.cpp @@ -466,8 +466,6 @@ int main(int argc, char **argv, char **env) { uint64_t duration = timer_end(startedAt); cout << endl << "****************************************************************" << endl; - cout << "Had simulate " << workspaceCycles << " clock cycles in " << duration*1e-9 << " s (" << workspaceCycles / (duration*1e-9) << " Khz)" << endl; - cout << "****************************************************************" << endl << endl; exit(0); diff --git a/src/test/cpp/common/framework.h b/src/test/cpp/common/framework.h index 42c1f34..ed419ad 100644 --- a/src/test/cpp/common/framework.h +++ b/src/test/cpp/common/framework.h @@ -127,7 +127,6 @@ public: class success : public std::exception { }; -static uint32_t workspaceCycles = 0; template class Workspace{ public: @@ -180,7 +179,7 @@ public: #endif } - Workspace* run(uint32_t timeout = 5000){ + Workspace* run(double timeout = 1e6){ // init trace dump #ifdef TRACE @@ -205,6 +204,10 @@ public: if(p->wakeEnable && p->wakeDelay < delay) delay = p->wakeDelay; + if(time*timeToSec > timeout){ + printf("Simulation timeout triggered (%f)\n", time*timeToSec); + fail(); + } if(delay == ~0l){ fail(); } diff --git a/src/test/cpp/murax/main.cpp b/src/test/cpp/murax/main.cpp index 9738e84..735875f 100644 --- a/src/test/cpp/murax/main.cpp +++ b/src/test/cpp/murax/main.cpp @@ -54,12 +54,10 @@ int main(int argc, char **argv, char **env) { printf("BOOT\n"); timespec startedAt = timer_start(); - MuraxWorkspace().run(100e6); + MuraxWorkspace().run(1e9); uint64_t duration = timer_end(startedAt); cout << endl << "****************************************************************" << endl; - cout << "Had simulate " << workspaceCycles << " clock cycles in " << duration*1e-9 << " s (" << workspaceCycles / (duration*1e-9) << " Khz)" << endl; - cout << "****************************************************************" << endl << endl; exit(0);