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

Set abbreviated Node.type_name for long parameterized types #198

Open
erang20 opened this issue Jan 7, 2024 · 1 comment
Open

Set abbreviated Node.type_name for long parameterized types #198

erang20 opened this issue Jan 7, 2024 · 1 comment
Labels
feature New feature or request

Comments

@erang20
Copy link

erang20 commented Jan 7, 2024

RDL parameterized types translate to Node.type that contains the list of parameters and their values. For example:

regfile some_regfile #(
    longint unsigned PARAM_A,
    longint unsigned PARAM_B,
) {
...
}

Might be instantiated as a Node with type_name = some_regfile_PARAM_A_200_PARAM_B_300

The list of parameters might be very long in some cases, so it would be helpful to add an option (e.g. max_node_type_param_lengh to abbreviate a long parameters list to a 32 bit hash hex, e.g. some_regfile_2d8fa187 instead of a very long type name.

@amykyta3
Copy link
Member

Agree that type names can get pretty absurdly verbose. I have been noticing the same in some of the designs I have been involved in.

The current type name generation is actually according to what the SystemRDL spec defines (Section 5.1.1.4). I also extended the semantics for this to cover dynamic assignments.

I was actually thinking of addressing this in a similar way you suggested - to provide an option to generate shortened hashed type names. This is important since some languages that PeakRDL exports to may have a character limit on identifiers that is quite easy to reach with this behavior.

Since this is something that would be changed in the compiler, I will migrate this issue there.

@amykyta3 amykyta3 transferred this issue from SystemRDL/PeakRDL-ipxact Jan 12, 2024
@amykyta3 amykyta3 added the feature New feature or request label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

No branches or pull requests

2 participants