Make callCbs() public.

VerilatedVpi::callCbs() can be used by the user to signal
simulation-related callbacks, e.g.
VerilatedVpi::callCbs(cbStartOfSimulation).

The information if any callbacks have been called may be important to
drive an evaluation until no further changes are observed.

Signed-off-by: Lukasz Dalek <[email protected]>
Signed-off-by: Philipp Wagner <[email protected]>
Signed-off-by: Stefan Wallentowitz <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
This commit is contained in:
Philipp Wagner
2019-09-21 07:43:20 -04:00
committed by Wilson Snyder
parent 96725b3431
commit d7b6b53c4d
2 changed files with 11 additions and 1 deletions
+8 -1
View File
@@ -390,8 +390,9 @@ public:
}
return ~VL_ULL(0); // maxquad
}
static void callCbs(vluint32_t reason) {
static bool callCbs(vluint32_t reason) VL_MT_UNSAFE_ONE {
VpioCbList& cbObjList = s_s.m_cbObjLists[reason];
bool called = false;
for (VpioCbList::iterator it=cbObjList.begin(); it!=cbObjList.end();) {
if (VL_UNLIKELY(!*it)) { // Deleted earlier, cleanup
it = cbObjList.erase(it);
@@ -400,7 +401,9 @@ public:
VerilatedVpioCb* vop = *it++;
VL_DEBUG_IF_PLI(VL_DBG_MSGF("- vpi: reason_callback %d %p\n", reason, vop););
(vop->cb_rtnp()) (vop->cb_datap());
called = true;
}
return called;
}
static void callValueCbs() VL_MT_UNSAFE_ONE {
assertOneCheck();
@@ -521,6 +524,10 @@ void VerilatedVpi::callValueCbs() VL_MT_UNSAFE_ONE {
VerilatedVpiImp::callValueCbs();
}
bool VerilatedVpi::callCbs(vluint32_t reason) VL_MT_UNSAFE_ONE {
return VerilatedVpiImp::callCbs(reason);
}
//======================================================================
// VerilatedVpiImp implementation