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
This commit is contained in:
Cary R 2007-11-16 14:19:32 -08:00 committed by Stephen Williams
parent 3765f5f421
commit 35382b5801
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}