Apply a patch from Aleksey Morozov to fix a bug that he identified

and reproduced.  It is the same as Bug #331 -
"XSpice skips digital output point" except that it applies to the
instance queue, not the event queue.
This commit is contained in:
Giles Atkinson 2023-05-07 18:27:32 +01:00
parent 1cd15e382e
commit 6c420525d0
1 changed files with 15 additions and 6 deletions

View File

@ -479,17 +479,26 @@ static void EVTbackup_inst_queue(
} }
inst_queue->next_time = next_time; inst_queue->next_time = next_time;
/* Update the modified list by looking for any queued events */ /* Update the modified list by looking for events that were processed
/* with posted time > last_time */ * or queued in the current timestep.
*/
for(i = 0, j = 0; i < num_modified; i++) { for(i = 0, j = 0; i < num_modified; i++) {
inst_index = inst_queue->modified_index[i]; inst_index = inst_queue->modified_index[i];
inst = *(inst_queue->last_step[inst_index]); inst = *(inst_queue->last_step[inst_index]);
while(inst) { if (inst_queue->current[inst_index] ==
if(inst->posted_time > inst_queue->last_time) inst_queue->last_step[inst_index]) {
break; /* Nothing now removed from the queue,
inst = inst->next; * but it may have been modified by an addition.
*/
while (inst) {
if (inst->posted_time > inst_queue->last_time)
break;
inst = inst->next;
}
} }
if(! inst) { if(! inst) {