Skip to content

Shorten mangled name #1608

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

Open
taichi-ishitani opened this issue May 8, 2025 · 2 comments · May be fixed by #1614
Open

Shorten mangled name #1608

taichi-ishitani opened this issue May 8, 2025 · 2 comments · May be fixed by #1614
Labels
tools Tools feature

Comments

@taichi-ishitani
Copy link
Contributor

Mangled name for a generic component with many generic parameters is difficult to read it because it is very long.
For exaxmple:

Veryl

package pzcorebus_pkg::<
  PROFILE             : pzcorebus_common_pkg::pzcorebus_profile,
  ID_WIDTH            : u16                                    ,
  ADDRESS_WIDTH       : u16                                    ,
  DATA_WIDTH          : u16                                    ,
  UNIT_DATA_WIDTH     : u16                                    ,
  USE_BYTE_ENABLE     : bool                                   ,
  ATOMIC_COMMAND_WIDTH: u16                                    ,
  MESSAGE_CODE_WIDTH  : u16                                    ,
  RQEUEST_INFO_WIDTH  : u16                                    ,
  RESPONSE_INFO_WIDTH : u16                                    ,
  MAX_DATA_WIDTH      : u16                                    ,
  RESPONSE_BOUNDARY   : u16                                    ,
> for pzcorebus_proto_pkg {

Generated SV

package pzbcm___pzcorebus_pkg__pzcorebus_profile_MEMORY_H__16__32__256__32__true__8__8__0__0__256__4096;

I think it is useful to shorten such mangled name.

taichi-ishitani added a commit to taichi-ishitani/veryl that referenced this issue May 12, 2025
@taichi-ishitani taichi-ishitani linked a pull request May 12, 2025 that will close this issue
@dalance dalance added the tools Tools feature label May 13, 2025
taichi-ishitani added a commit to taichi-ishitani/veryl that referenced this issue May 13, 2025
taichi-ishitani added a commit to taichi-ishitani/veryl that referenced this issue May 13, 2025
@dalance
Copy link
Collaborator

dalance commented May 14, 2025

I agree this concept, but I have some consideration points.

  • This should be optional, or by default?
  • Index based name is unstable, from the point of view of stability, hash based name may be better? (e.g. prj___PkgA__a138s9fg)
  • In the generated code, the coment which shows the original parameter or long mangled name may be useful
// prj::PkgA::<4, 5, 6, 7>
package prj___PkgA__1;

taichi-ishitani added a commit to taichi-ishitani/veryl that referenced this issue May 14, 2025
taichi-ishitani added a commit to taichi-ishitani/veryl that referenced this issue May 14, 2025
@taichi-ishitani
Copy link
Contributor Author

I updated the PR.

  • Use hash value instead of instance index
  • Print the original instance name as comment

Users can't know the orignal parameters from the shortened generic instace name so I think this feature should be optional.

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

Successfully merging a pull request may close this issue.

2 participants