From 35382b58012cca277ce2873a46d7f701cd3aad3b Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 16 Nov 2007 14:19:32 -0800 Subject: [PATCH] At EOS only save the simulation time if it is asked for. This was causing a core dump for a number of the vpi test cases. The problem was that they did not need the simulation time, so it was being set to NULL. The problem was the EndOfSimulation callback was always setting cb_data.time to the current time. A big problem when the pointer was NULL. The solution is to only set the time when the pointer is not NULL --- vvp/vpi_callback.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vvp/vpi_callback.cc b/vvp/vpi_callback.cc index aadcebf37..7f1f12f9d 100644 --- a/vvp/vpi_callback.cc +++ b/vvp/vpi_callback.cc @@ -338,7 +338,9 @@ void vpiPostsim(void) { while (EndOfSimulation) { cur = EndOfSimulation; EndOfSimulation = cur->next; - vpip_time_to_timestruct(cur->cb_data.time, schedule_simtime()); + /* Only set the time if it is not NULL. */ + if (cur->cb_data.time) + vpip_time_to_timestruct(cur->cb_data.time, schedule_simtime()); (cur->cb_data.cb_rtn)(&cur->cb_data); delete_vpi_callback(cur); }