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

C - Omit struct in hierarchy for blocks with block-prefix: False #55

Merged

Conversation

stefanlippuner
Copy link
Contributor

👋

This is a small change to adapt the C struct output to match the other outputs more closely in case block-prefix: False is defined for a block. E.g. The C defines for the register address already omit the name of the block in this case.

It turns this output

#ifndef __ASSEMBLER__
struct my_reg {

  /* [0x4]: BLOCK Interrupt registers */
  struct irq_regs {
    /* [0x0]: REG (ro) Interrupt status. */
    uint32_t irq_status;

    /* [0x4]: REG (rw) Interrupt enable. */
    uint32_t irq_enable;
  } irq_regs;

into this:

#ifndef __ASSEMBLER__
struct my_reg {
  /* [0x4]: BLOCK Interrupt registers */
  /* [0x0]: REG (ro) Interrupt status. */
  uint32_t irq_status;

  /* [0x4]: REG (rw) Interrupt enable. */
  uint32_t irq_enable;

Let me know if I should add a testcase for this.

@tgingold-cern
Copy link
Owner

Yes, it is always nice to add a testcase, to avoid regressions.

@stefanlippuner
Copy link
Contributor Author

I've added the existing blkprefix3 testcase to also generate a C header file. I also wanted to enable blkprefix4 but that fails to compile because it's missing a different header file.

@tgingold-cern tgingold-cern merged commit b5746a7 into tgingold-cern:master Jul 18, 2024
2 checks passed
@tgingold-cern
Copy link
Owner

Great. 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.

2 participants