From ffcf3b24d9f348ef45cde1c15cc79ccc72c823bc Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Mon, 18 Dec 2023 11:37:39 +0000 Subject: [PATCH] Improve efficiency and irreversible CM support in EVTcall_hybrids() by halting calls to code models as soon as the timestep is chenged. This should have been included in 508fad0f55dcda3545305d6582c367ef7dca06ac. --- src/xspice/evt/evtcall_hybrids.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xspice/evt/evtcall_hybrids.c b/src/xspice/evt/evtcall_hybrids.c index a45f2506e..7b1988e87 100644 --- a/src/xspice/evt/evtcall_hybrids.c +++ b/src/xspice/evt/evtcall_hybrids.c @@ -45,6 +45,7 @@ NON-STANDARD FEATURES #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" +#include "ngspice/mif.h" #include "ngspice/evt.h" #include "ngspice/evtproto.h" @@ -74,6 +75,12 @@ void EVTcall_hybrids( /* Call EVTload for all hybrids */ - for(i = 0; i < num_hybrids; i++) + for(i = 0; i < num_hybrids; i++) { EVTload_with_event(ckt, hybrids[i], MIF_STEP_PENDING); + if (g_mif_info.breakpoint.current < ckt->CKTtime) { + /* An XSPICE instance rejected the time-step. */ + + break; + } + } }