mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
Emit model implementation as loose methods. (#3006)
This patch introduces the concept of 'loose' methods, which semantically are methods, but are declared as global functions, and are passed an explicit 'self' pointer. This enables these methods to be declared outside the class, only when they are needed, therefore removing the header dependency. The bulk of the emitted model implementation now uses loose methods.
This commit is contained in:
@@ -74,7 +74,7 @@ void VlWorkerThread::workerLoop() {
|
||||
if (VL_UNLIKELY(m_exiting.load(std::memory_order_acquire))) break;
|
||||
|
||||
if (VL_LIKELY(work.m_fnp)) {
|
||||
work.m_fnp(work.m_evenCycle, work.m_sym);
|
||||
work.m_fnp(work.m_selfp, work.m_evenCycle);
|
||||
work.m_fnp = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user