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 ResizeEnums transform #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

i509VCB
Copy link
Contributor

@i509VCB i509VCB commented Jan 31, 2025

The MSPM0 SVDs have enums which are larger than needed. An example of this is the STAT register for the MSPM0C110x where after eliminating variants not present in the technical manual manual (see #58), there are 2 bits of unused space which are reserved.

Example:

  # STAT used on C110x has a field size of 2 bits
  - !ResizeEnums
    enum: STAT
    bit_size: 2

Along side resizing the enum, uses of the enum have the bit size changed as well. The transform also validates the following:

  • The new size is not 0 (why would you do this?)
  • That the enum variants can be represented in the range of valid values for the bit size (e.g., no value of 4 for a 2-bit enum with a maximum value of 3)
  • If the enum has grown in size, that no field overlaps are created as a result of the resize.

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.

1 participant