mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 08:33:38 +02:00
Compute MTask affinity in V3VariableOrder (#4991)
Instead of carrying around MTask affinity from scheduling, compute it in V3VariableOrder (where it is used), by tracing through the code. This simplifies some code and has the benefit of handling variables introduced after scheduling. It's worth a few % speed at run-time, and the new implementation of V3VariableOrder is slightly more efficient, though the speed/space is still dominated by the TSP sort.
This commit is contained in:
@@ -2464,22 +2464,6 @@ AstExecGraph* V3Order::createParallel(const OrderGraph& orderGraph, const std::s
|
||||
|
||||
// Add this logic to the per-mtask order
|
||||
mtaskStates[mtaskId].m_logics.push_back(movep->logicp());
|
||||
|
||||
// Since we happen to be iterating over every logic node,
|
||||
// take this opportunity to annotate each AstVar with the id's
|
||||
// of mTaskGraphp that consume it and produce it. We'll use this
|
||||
// information in V3EmitC when we lay out var's in memory.
|
||||
const OrderLogicVertex* const logicp = movep->logicp();
|
||||
for (const V3GraphEdge* edgep = logicp->inBeginp(); edgep; edgep = edgep->inNextp()) {
|
||||
const OrderVarVertex* const vVtxp = edgep->fromp()->cast<const OrderVarVertex>();
|
||||
if (!vVtxp) continue;
|
||||
vVtxp->vscp()->varp()->addMTaskId(mtaskId);
|
||||
}
|
||||
for (const V3GraphEdge* edgep = logicp->outBeginp(); edgep; edgep = edgep->outNextp()) {
|
||||
const OrderVarVertex* const vVtxp = edgep->top()->cast<const OrderVarVertex>();
|
||||
if (!vVtxp) continue;
|
||||
vVtxp->vscp()->varp()->addMTaskId(mtaskId);
|
||||
}
|
||||
}
|
||||
|
||||
// Create the AstExecGraph node which represents the execution
|
||||
|
||||
Reference in New Issue
Block a user