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

Add ability to graft sub-trees of a design from other headers #20

Open
amykyta3 opened this issue Jan 4, 2025 · 0 comments
Open

Add ability to graft sub-trees of a design from other headers #20

amykyta3 opened this issue Jan 4, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@amykyta3
Copy link
Member

amykyta3 commented Jan 4, 2025

Issue

Currently there is no good way for hierarchical header re-use. If a sub-design exports a header, and a separate header is generated at a top-level, this can create namespace collisions (#8)

Provide a mechanism so that a top-level header can intelligently re-use and reference an existing sub-design's header.

Proposed mechanism

Upon generation of the top-level header, a user can provide contextual information about what is eligible to be grafted:

  • SystemRDL type-name of nodes that are eligible to be grafted
  • Optional C struct type name to reference when grafting

When generating the top-level header, struct and define definitions for any nodes that match the user-provided type name will be skipped. Instances of grafted nodes will either use the user-provided struct type name, or the expected type name based on existing type name generation semantics.

Since nodes can be parameterized or augmented via dynamic assignments, a user-provided type name can be either the fully mangled type name, or the original generic type name from RDL source. The exporter will check the fully mangled type name for matching first.

Restrictions

In order to limit complexity, and encourage best user practices in RDL, grafting will be limited to:

  • addrmap, regfile, and mem nodes
  • Can only graft types that are declared in the global RDL namespace. Internal definitions and anonymous definitions will not be graftable.
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

1 participant