mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Add --localize-max-size option and optimization (#5072).
This commit is contained in:
+6
-3
@@ -63,9 +63,12 @@ class LocalizeVisitor final : public VNVisitor {
|
||||
|
||||
// METHODS
|
||||
bool isOptimizable(AstVarScope* nodep) {
|
||||
return !nodep->user1() || // Not marked as not optimizable, or ...
|
||||
(nodep->varp()->varType() == VVarType::BLOCKTEMP
|
||||
&& m_accessors(nodep).size() == 1); // .. a block temp used in a single CFunc
|
||||
return ((!nodep->user1() // Not marked as not optimizable, or ...
|
||||
// .. a block temp used in a single CFunc
|
||||
|| (nodep->varp()->varType() == VVarType::BLOCKTEMP
|
||||
&& m_accessors(nodep).size() == 1))
|
||||
// and under size limit
|
||||
&& nodep->varp()->dtypep()->widthTotalBytes() <= v3Global.opt.localizeMaxSize());
|
||||
}
|
||||
|
||||
static bool existsNonLeaf(const std::unordered_set<AstCFunc*>& funcps) {
|
||||
|
||||
Reference in New Issue
Block a user