Skip to content

Conversation

dancrossnyc
Copy link
Contributor

At OxCon, Ry and I briefly spoke about how to gracefully accommodate the need to inject additional data into rsf so that, for example, one could specify how to format a field, as some AMD registers report things like power or voltage or current in odd units (such as eights of a volt or similar) and it would be nice to normalize those into a standard unit. One could image doing this with something like a snippet of rhai code, but then how would one inject that into an rsf specification?

Ry suggested using attributes; this introduces a familiar #[attr(id = "string")] syntax and corresponding parser support for such constucts.

@rcgoodfellow
Copy link
Collaborator

Thanks Dan! Are you planning on using RSF interfaces from Rust? If so we should probably add attributes methods to the Rust code generators for blocks, registers and enums, <field_name>_attributes for fields and <element_name>_attributes block elements.

@dancrossnyc
Copy link
Contributor Author

I believe this is done; PTAL.

@dancrossnyc
Copy link
Contributor Author

Oops, there's a build failure. Huh; that's really weird. Ok, let me dig into that.

At OxCon, Ry and I briefly spoke about how to gracefully
accommodate the need to inject additional data into rsf so
that, for example, one could specify how to format a field, as
some AMD registers report things like power or voltage or
current in odd units (such as eights of a volt or similar) and
it would be nice to normalize those into a standard unit.  One
could image doing this with something like a snippet of rhai
code, but then how would one inject that into an rsf
specification?

Ry suggested using attributes; this introduces a familiar
`#[attr(id = "string")]` syntax and corresponding parser support
for such constucts.
@dancrossnyc
Copy link
Contributor Author

Oops, there's a build failure. Huh; that's really weird. Ok, let me dig into that.

Yup. I neglected to run tests with the "test generated code" feature. Should be fixed now. My bad!

Copy link
Collaborator

@rcgoodfellow rcgoodfellow left a comment

Choose a reason for hiding this comment

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

Thanks!

@dancrossnyc dancrossnyc merged commit 84bbcfd into main Oct 20, 2025
2 checks passed
@dancrossnyc dancrossnyc deleted the attributes branch October 20, 2025 17:04
@dancrossnyc
Copy link
Contributor Author

Thanks, Ry!

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