You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have logic related to splitting large expressions into multiple lines, as well as spilling expressions into wires. This is split between both ExportVerilog and PrepareForEmission. We should clean this up, and handle splitting and spilling into wires in PrepareForEmission.
Currently, PrepareForEmission does two things here: first, it looks at variadic expressions, and spills them to their own wire in the top-level module body, when that is possible:
// If we're in a procedural region, we move on to the next op in the
// block. The expression splitting and canonicalization below will
// happen after we recurse back up. If we're not in a procedural region,
// the expression can continue being worked on.
if (isProceduralRegion) {
++opIterator;
continue;
}
}
}
Then, it splits up the variadic expressions into a binary tree of expressions, which makes it easier to break them up into multiple lines in ExportVerilog:
// Lower this operation to a balanced binary tree of the same operation.
SmallVector<Operation *> newOps;
auto result = lowerFullyAssociativeOp(op, op.getOperands(), newOps);
op.getResult(0).replaceAllUsesWith(result);
op.erase();
// Make sure we revisit the newly inserted operations.
opIterator = Block::iterator(newOps.front());
continue;
}
We should improve and combine this logic. The checking for what is "too large" should be considering the entire expression tree, and inserting splits and wires according to the defined expression term limit. It should also keep the (sub-)expressions neat, so that ExportVerilog can easily break them into multiple lines, which may require further splitting into a binary tree as is done now.
After we've finished that, we can remove the old large expression spilling logic from ExportVerilog once and for all: #2802
The text was updated successfully, but these errors were encountered:
We have logic related to splitting large expressions into multiple lines, as well as spilling expressions into wires. This is split between both ExportVerilog and PrepareForEmission. We should clean this up, and handle splitting and spilling into wires in PrepareForEmission.
Currently, PrepareForEmission does two things here: first, it looks at variadic expressions, and spills them to their own wire in the top-level module body, when that is possible:
circt/lib/Conversion/ExportVerilog/PrepareForEmission.cpp
Lines 474 to 491 in 286c483
Then, it splits up the variadic expressions into a binary tree of expressions, which makes it easier to break them up into multiple lines in ExportVerilog:
circt/lib/Conversion/ExportVerilog/PrepareForEmission.cpp
Lines 493 to 513 in 286c483
We should improve and combine this logic. The checking for what is "too large" should be considering the entire expression tree, and inserting splits and wires according to the defined expression term limit. It should also keep the (sub-)expressions neat, so that ExportVerilog can easily break them into multiple lines, which may require further splitting into a binary tree as is done now.
After we've finished that, we can remove the old large expression spilling logic from ExportVerilog once and for all: #2802
The text was updated successfully, but these errors were encountered: