mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Add V3VariableOrder pass
A separate V3VariableOrder pass is now used to order module variables before Emit. All variables are now ordered together, without consideration for whether they are ports, signals form the design, or additional internal variables added by Verilator (which used to be ordered and emitted as separate groups in Emit). For single threaded models, this is performance neutral. For multi-threaded models, the MTask affinity based sorting was slightly modified, so variables with no MTask affinity are emitted last, otherwise the MTask affinity sets are sorted using the TSP sorter as before, but again, ports, signals, and internal variables are not differentiated. This yields a 2%+ speedup for the multithreaded model on OpenTitan.
This commit is contained in:
+2
-2
@@ -114,7 +114,7 @@ void EmitCBaseVisitor::emitCFuncDecl(const AstCFunc* funcp, const AstNodeModule*
|
||||
if (!funcp->ifdef().empty()) puts("#endif // " + funcp->ifdef() + "\n");
|
||||
}
|
||||
|
||||
void EmitCBaseVisitor::emitVarDecl(const AstVar* nodep, const string& prefixIfImp, bool asRef) {
|
||||
void EmitCBaseVisitor::emitVarDecl(const AstVar* nodep, bool asRef) {
|
||||
const AstBasicDType* const basicp = nodep->basicp();
|
||||
bool refNeedParens = VN_IS(nodep->dtypeSkipRefp(), UnpackArrayDType);
|
||||
|
||||
@@ -199,7 +199,7 @@ void EmitCBaseVisitor::emitVarDecl(const AstVar* nodep, const string& prefixIfIm
|
||||
&& name.substr(name.size() - suffix.size()) == suffix;
|
||||
if (beStatic) puts("static VL_THREAD_LOCAL ");
|
||||
}
|
||||
puts(nodep->vlArgType(true, false, false, prefixIfImp, asRef));
|
||||
puts(nodep->vlArgType(true, false, false, "", asRef));
|
||||
puts(";\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user