From b128508841803e0ddb53c18b55e5b1f36b6e96b5 Mon Sep 17 00:00:00 2001 From: gatk555 Date: Sun, 14 Jan 2024 21:50:41 +0000 Subject: [PATCH] vvp: enable main event queue before executing cbStartOfSimulation callbacks. Before the start of simulation, functor update events resulting from initial value propagation are added to the initialisation event queue (schedule_init_list). Once simulation has started, they are added to the main event queue (sched_list). The cbStartOfSimulation callbacks are executed after the initialisation event queue has been emptied. Currently, if these callbacks generate further functor update events, those events are added to the initialisation event queue, but that queue is not looked at again. Instead, make sure any new events are added to the main event queue. This issue and proposed fix was reported by gatk555 in PR #1065. --- vvp/schedule.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vvp/schedule.cc b/vvp/schedule.cc index 961aa36e6..c9d117ef5 100644 --- a/vvp/schedule.cc +++ b/vvp/schedule.cc @@ -1147,6 +1147,8 @@ void schedule_simulate(void) delete cur; } + sim_started = true; + if (verbose_flag) { vpi_mcd_printf(1, " ...execute StartOfSim callbacks\n"); } @@ -1154,8 +1156,6 @@ void schedule_simulate(void) // Execute start of simulation callbacks vpiStartOfSim(); - sim_started = true; - signals_capture(); if (verbose_flag) {