Hi!
I've had a problem when I've made little mistake using cm_event_queue().
I've called model in time == TIME and time < TIME.
There was no warning or errors in terminal.
So,
How about printing errors from file cmevt.c ?
change this :
/* If breakpoint time <= current event time, return error */ if(time <= g_mif_info.circuit.evt_step) { g_mif_info.errmsg = "ERROR - cm_event_queue() - Event time cannot be <= current time\n"; return(MIF_ERROR); }
to this:
/* If breakpoint time <= current event time, return error */ if(time <= g_mif_info.circuit.evt_step) { g_mif_info.errmsg = "ERROR - cm_event_queue() - Event time cannot be <= current time\n; printf("ERROR - cm_event_queue() - Event time cannot be <= current time\nInstance: %s\n", g_mif_info.instance->MIFname); return(MIF_ERROR); }
Maybe, it makes sense to print other hidden errors? Especially in debug mode.
Thanks,
Bohdan
By the way.
Generic xspice adc_bridge. It switches between ANALOG and EVENT by making cm_event_queue(current_time).
Isn't it an error?
Console output after printing errors:
I don't see anything out of the order (with ngspice-29).
There are two events for each positive sinewave half, as expected.
(Making in_low and in_high slightly different doesn't change this).
-marcel
Hi, Marcel!
It will work , but there will be hidden errors in g_mif_info structure.
It's not about in_low or in_high.
Did you change cmevt.c as described in main message?( It requires rebuild of ngspice )
Just now checked on 31+ (pre-master ):
It is caused by next lines of generic adc_bridge:
It means that we are calling model in time == TIME , which is an error in order to cmevt.c:244-249
Last edit: Bohdan Tkhir 2020-01-10
On 2020-01-10 09:46, Bohdan Tkhir wrote:
Did you intentionally make in_low == in_high to provoke this error?
-marcel
No, It's not about in_low == in_high, you can set anything you want
(Replied to this question extensively in comment above).
Here is an error reporting mechanism that never reports an error.
Raising priority as it has just cost me hours of debugging time. Needs fixing, but is it limited to XSPICE? Check for use of macros in inpmacs.h.