Skip to content
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

Refactor FlatModule.gather from stack to heap overflow #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kshaa
Copy link

@kshaa kshaa commented Apr 1, 2022

I ran into the same error as mentioned in issue #98 and saw that there's a proposition to fix it by refactoring FlatModule.gather from a recursive function to a loop, because it seems tail recursive-ish, this PR does exactly that.

Unfortunately it seems that gather isn't completely tail recursive (one condition leads to a recursive call and then afterwards modifies inputs) so I just left that part recursive and refactored all the other parts. However in my use case it seemed that this condition that can't be refactored wasn't the one causing a stack overflow, so in essence the patch is worthy and does fix at least some of the badly performing use cases.

TL;DR - This patch allows using more RAM on beefy netlists before everything crashes and burns. I.e. a stack overflow has been refactored into a heap overflow (or into a successful case if there's enough RAM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant