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
Run yosys stackoverflow.v -p hierarchy while commenting out some of the 512 levels of nesting (with stackoverflow.v being the example from YoWASP/yosys#37) and observe time plus stack usasge, for example with valgrind --tool=drd --main-stacksize=16777216 --show-stack-usage=yes.
and so on, there's a lot of deep copies of nodes. There's also a lot of memory spent on parser-constructed AstNodes. Edited massif.log. The sizeof(AstNode) is 288B according to a dump I did some weeks back. This means we need 85 AstNodes per ternary nesting level.
...right, of course. valgrind --tool=massif --heap=no --stacks=yes ./yosys garbage/stackoverflow.v -p "hierarchy" says we get up to 1,335,808 bytes of stack, but can't attribute it to its sources. perf shows that AstNode::detectSignWidthWorker takes up 90% of the runtime.
Version
Yosys 0.39+1 (git sha1 f7153573c, ccache clang++ 14.0.6 -O0 -fPIC)
On which OS did this happen?
Linux
Reproduction Steps
Run
yosys stackoverflow.v -p hierarchy
while commenting out some of the 512 levels of nesting (withstackoverflow.v
being the example from YoWASP/yosys#37) and observe time plus stack usasge, for example withvalgrind --tool=drd --main-stacksize=16777216 --show-stack-usage=yes
.Expected Behavior
Time is linear in input size.
Actual Behavior
Time is quadratic in input size:
(link to the spreadsheet)
LibreOffice Calc provides the following polynomial fit:
Also, using 24.5K per nesting level seems excessive and results in issues such as YoWASP/yosys#37.
The text was updated successfully, but these errors were encountered: