mirror of
https://github.com/verilator/verilator.git
synced 2026-09-08 10:33:20 +02:00
Fix VPI timed callbacks to be one-shot, pull5.
Signed-off-by: Matthew Ballance <[email protected]> Signed-off-by: Wilson Snyder <[email protected]>
This commit is contained in:
committed by
Wilson Snyder
parent
7a413a121d
commit
f63dfd7028
@@ -416,7 +416,9 @@ public:
|
||||
for (VpioTimedCbs::iterator it=s_s.m_timedCbs.begin(); it!=s_s.m_timedCbs.end(); ) {
|
||||
if (VL_UNLIKELY(it->first <= time)) {
|
||||
VerilatedVpioCb* vop = it->second;
|
||||
++it; // iterator may be deleted by callback
|
||||
VpioTimedCbs::iterator last_it = it;
|
||||
++it; // Timed callbacks are one-shot
|
||||
s_s.m_timedCbs.erase(last_it);
|
||||
VL_DEBUG_IF_PLI(VL_DBG_MSGF("- vpi: timed_callback %p\n", vop););
|
||||
(vop->cb_rtnp()) (vop->cb_datap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user