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

internal_stats: astnode (sizeof) #4595

Merged
merged 1 commit into from
Sep 11, 2024
Merged

internal_stats: astnode (sizeof) #4595

merged 1 commit into from
Sep 11, 2024

Conversation

widlarizer
Copy link
Collaborator

What are the reasons/motivation for this change?

Requested by @povik. We'd like to see how much of the memory usage of Yosys between passes is directly due to AstNodes. This doesn't count overhead of initialized vectors and such.

Explain how this is achieved.

Adding a counter adjusted on AstNode construction/destruction

If applicable, please suggest to reviewers how they can test the change.

yosys -p "read_verilog tests/sim/dffe.v; internal_stats -json"

@povik povik merged commit 3457270 into main Sep 11, 2024
37 checks passed
@Ravenslofty
Copy link
Collaborator

This should have used the scratchpad...

@povik
Copy link
Member

povik commented Sep 11, 2024

Wouldn’t that be inefficient accessing the scratchpad with every construction/destruction?

@Ravenslofty
Copy link
Collaborator

I'm not proposing astnodes is a scratchpad variable, I'm proposing that astnodes_count() is a scratchpad variable.

@povik
Copy link
Member

povik commented Sep 11, 2024

But scratchpad is a static key-value store. We would need to periodically update it, or extend what scratchpad is.

In any case we can go back and redo this.

@mmicko mmicko deleted the emil/internal_stats-astnode branch September 17, 2024 09:29
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.

3 participants