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

Name collision when using multiple cheaders which share common RDL objects #8

Open
AlexLao512 opened this issue Jan 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@AlexLao512
Copy link

AlexLao512 commented Jan 17, 2024

We are running into a problem that is exposed when we export a bunch of headers for bus slaves that all have a common regfile. If we export an entire bus structures register map as a single header, it is not a problem because the common regfile struct has a _<random_string> tacked on as a post-fix.

Essentially what we have is a bunch of registers that's are the same for every one of our custom bus slaves. These are for slave identification at runtime, cross-checking version codes for SW/HW API compatibility, etc.

We import this regfile from a different .rdl file and instance the regfile at address 0 of every bus slave.

The problem occurs when I export individual headers for each bus slave. I cannot include several of these headers in a single C project due to the name collision of the identical structs generated for each slave in each header.

I don't know a good way of fixing this. Maybe we can have a command line argument for generating all included regfiles as a seperate .h file?

@amykyta3
Copy link
Member

I see - you have common components that are re-used across multiple IPs, and that is causing type name collisions.

One way to work around may be to use --type-style hier. That will name your types using a hierarchical naming scheme rather than attempting to re-use types of the same kind.

Another mechanism could be that the tool adds a user-defined prefix to everything. Not particularly elegant, but it would help give control to de-conflict this

@amykyta3 amykyta3 changed the title Problem with using multiple cheaders which share imported regfiles Name collision when using multiple cheaders which share common RDL objects Dec 14, 2024
@amykyta3 amykyta3 added the enhancement New feature or request label Dec 14, 2024
@amykyta3
Copy link
Member

amykyta3 commented Jan 4, 2025

Actually, I hate my prior suggestion of prefixing. That is a hack that is ugly, and doesn't truly solve what you probably want which is hierarchical type re-use.

I opened a separate feature request that should provide an enhancement that would solve this issue, and more: #20

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

No branches or pull requests

2 participants