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

RDL naming convention enforcement and updates #302

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

nathanaelhuffman
Copy link
Collaborator

Working with @mkeeter we're adding some improvements to the RDL generation and I've made some naming convention enforcement to help facilitate programatic consumption of the generated artifacts.

New Features:

  • added "orig_type_name" to top level addrmap json so that the instance name can be linked with the actual hardware generated .json. Remember, we may have multiple copies of the same "hw" with different instance names.
  • added "addr_span_bytes" to the top level addrmap json to give a hint to sw tool generation how many registers we have specified. Note that there's a missing feature from SystemRDL spec that would allow reserving undefined register space, so we're stuck telling sizes that are based only on what we've defined. From a hw implementation perspective, it's certainly safe to assume the peripheral owns up to the next power of 2 here, and possibly with a floor of 256byte addresses.

New Enforcement:

  • To provide some naming consistency, we're now enforcing that buck2 rdl targets end with "_rdl" so that it's easier to reason about, and then enforce that output file names (which are user-specified) conform to the expected patterns for software consumption. There are more improvements to be made here RDL addr map name enforcement when doing buck builds #301 but this is a functional start.

The new enforcement regime required doing some updates to various things as seen in this PR as well.

# We're particular about this since we want to enforce certain naming standards b/c
# some collateral is consumed programmatically down-stream by say sw generation tools
# We could provide a knob to relax this if needed
if not ctx.attrs.name.endswith("_rdl"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am a fan of this!

@nathanaelhuffman nathanaelhuffman merged commit 6cf9b3f into main Mar 6, 2025
8 checks passed
@nathanaelhuffman nathanaelhuffman deleted the ndh/rdl-conventions branch March 6, 2025 20:28
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.

2 participants