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

Make type of register value in CHeaderGenerator configurable #1121

Merged
merged 1 commit into from
May 18, 2023

Conversation

C-Elegans
Copy link
Contributor

When generating a header file using the CHeaderGenerator, if you try to specify an alternative regType (such as uint32_t), the header it generated would include the following:

/**
  * @union       ap_config_reg_t
  * @address     0x0100
  * @brief       Configuration Register
  */
typedef union {
    u32 val;
    struct {
        uint32_t func_en   :  1; //RW, reset: 0x1, Function enable
        uint32_t reserved_0 : 31; //NA, Reserved
    } reg;
} ap_config_reg_t;

The members of the union would have their type set correctly, but the non-union member of the struct would not.

This PR changes it to generate the following:

/**
  * @union       ap_config_reg_t
  * @address     0x0100
  * @brief       Configuration Register
  */
typedef union {
    uint32_t val;
    struct {
        uint32_t func_en   :  1; //RW, reset: 0x1, Function enable
        uint32_t reserved_0 : 31; //NA, Reserved
    } reg;
} ap_config_reg_t;

@andreasWallner andreasWallner merged commit 5b49036 into SpinalHDL:dev May 18, 2023
13 checks passed
@andreasWallner
Copy link
Collaborator

Thanks!

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.

None yet

2 participants