-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow on moderately deep ternary expression #37
Comments
Unlimited: no. Bigger: yes, I'll bump the stack size. |
I want to point out that a 512 level deep unbalanced ternary expression is not "moderately deep", but rather "so deep that it will only appear in generated code, and even then rarely". In any case, I've been looking at the Yosys stack usage and under Valgrind's DRD it appears to be 24K per nesting level, or about 2.4M per 100 levels. I'll increase stack size to 8M, which |
I filed YosysHQ/yosys#4562 to track the rather poor performance of Yosys on such expressions. |
The next build of YoWASP Yosys on Test PyPI should have a stack size of 8M. Let me know if you need a backport of this change to the latest release branch (which would be Yosys 0.44). Also, code generators typically must split expressions into multiple chunks to avoid this kind of issue. For example, Verilator does this to avoid nesting issues in C++ compilers. You will probably need to implement the same behavior, even if only to avoid the quadratic slowdown I've demonstrated in YosysHQ/yosys#4562. |
When generating code deep ternary, a stack overflow happens for moderate sequence of ternary.
Is there a way to have bigger/unlimited stacks for yowasp-yosys ?
Using from python:
yowasp-runtime==1.53
yowasp-yosys==0.44.0.0.post760
Code example:
The text was updated successfully, but these errors were encountered: