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

[minor][abi] Document type alias lowering #117

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

Conversation

uenoku
Copy link
Contributor

@uenoku uenoku commented Jul 6, 2023

Add sentence for type alias in abi

@@ -142,6 +142,10 @@ payload as the first field and a packed bit vector as a second field. The
padding for each payload is set to ensure all padded payloads have the same bit
width as required by Verilog packed unions.

Type aliases shall be lowered to Verilog `typedef`{.verilog} with their inner types
recursively following these rules. Type aliases will be dropped if inner types are
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure we want to encode dropping in the ABI. This would imply, maybe incorrectly, that if they have any name it is a bug. Perhaps "changes to the structure of a type will result in changes to the name of a type". Width/type/reset inference is actually a situation where we probably want to mutate the type but preserve it's name or at least of that option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm also a little leery of putting anything into the ABI for this. Aren't these aliases basically hints, and nothing is to be relied upon at the ABI level?

Should we say "there is no reliable mapping from type aliases to the emitted verilog, they are treated as hints only"?

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