Skip to content

Commit c79df7c

Browse files
Johann Klammersteveicarus
Johann Klammer
authored andcommitted
fix failing VPI callbacks the vpip_cur_task was left dangling
1 parent 6e5558e commit c79df7c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

vvp/vpi_callback.cc

+2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ void sync_cb::run_run()
316316
if (cur->cb_data.cb_rtn != 0) {
317317
assert(vpi_mode_flag == VPI_MODE_NONE);
318318
vpi_mode_flag = sync_flag? VPI_MODE_ROSYNC : VPI_MODE_RWSYNC;
319+
vpip_cur_task = dynamic_cast<__vpiSysTaskCall*>(cur->cb_data.obj);
319320
(cur->cb_data.cb_rtn)(&cur->cb_data);
321+
vpip_cur_task = 0;
320322
vpi_mode_flag = VPI_MODE_NONE;
321323
}
322324

vvp/vpi_tasks.cc

+1
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ void vpip_execute_vpi_call(vthread_t thr, vpiHandle ref)
978978
else if (sysfunc_vec4*func_vec4 = dynamic_cast<sysfunc_vec4*>(ref)) {
979979
vthread_push_vec4(thr, func_vec4->return_value());
980980
}
981+
vpip_cur_task = 0;
981982
}
982983

983984
/*

0 commit comments

Comments
 (0)