Do not set a breakpoint at current time,

as this may lead to trigger a "breakpoint in the past"
message and stop the simulation, depending on double
precision details during comparison.
This commit is contained in:
Holger Vogt 2023-08-14 15:38:25 +02:00
parent 9ee9f9262b
commit 7dd44f12e0
1 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,13 @@ CKTsetBreak(CKTcircuit *ckt, double time)
printf("[t:%e] \t want breakpoint for t = %e\n", ckt->CKTtime, time);
#endif
if (AlmostEqualUlps(time, ckt->CKTtime, 3)) {
#ifdef TRACE_BREAKPOINT // #if (1)
fprintf(stderr, "Warning: Setting a new breakpoint at %e is ignored,\n as current time is %e\n", time, ckt->CKTtime);
#endif
return (OK);
}
if(ckt->CKTtime > time) {
SPfrontEnd->IFerrorf (ERR_PANIC, "breakpoint in the past - HELP!");
return(E_INTERN);