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

[FIRRTL] Make memory matadata work with layers #7789

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

seldridge
Copy link
Member

Extend the existing notion of how memory metadata is generated to work for memories that are under layers. Use an interpretation of the "design" excluding layers. In effect, memories which are under layers now generate metadata as if that instantiation was in the test harness.

I note that the current behavior here is inconsistent. The metadata generation behavior is different for a memory which is partially in the design (it has instances which are in the design and not in the design) compared to a memory which is wholly not in the design. However, this is the exact same behavior as before this change.

The details of what happens here are somewhat complex. For documentation of the current behavior, see the tests that accompany this commit.

In the future, this behavior should be changed to be dramatically simpler.

Extend the existing notion of how memory metadata is generated to work for
memories that are under layers.  Use an interpretation of the "design"
excluding layers.  In effect, memories which are under layers now generate
metadata as if that instantiation was in the test harness.

I note that the current behavior here is inconsistent.  The metadata
generation behavior is different for a memory which is partially in the
design (it has instances which are in the design and not in the design)
compared to a memory which is wholly not in the design.  However, this is
the exact same behavior as before this change.

The details of what happens here are somewhat complex.  For documentation
of the current behavior, see the tests that accompany this commit.

In the future, this behavior should be changed to be dramatically simpler.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@seldridge seldridge requested review from prithayan, mikeurbach and rwy7 and removed request for darthscsi November 9, 2024 01:26
Copy link
Contributor

@prithayan prithayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, I think as a followup we can drop memories with an empty path, from the metadata entries.
Also thanks for your previous cleanup of this pass and the lit tests.

// are then _not_ in the design, give them unresolvable distinct attribute
// paths. The LowerClasses pass will later treat these as "optimized away"
// and create an empty path.
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realize this behavior existed. As far as I can tell, any downstream tool parsing the OMIR would reject such an optimized away empty path, so maybe its safe to assume this case is not executed in any real world design. Thanks for documenting it, in a followup PR I can try to drop such a memory from the metadata.

@seldridge seldridge merged commit 9374d4c into main Nov 11, 2024
4 checks passed
@seldridge seldridge deleted the dev/seldridge/layers-CreateSiFiveMetadata branch November 11, 2024 16:30
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.

2 participants