Skip to content

Register frontend: C header generation - #158

Open
da-gazzi wants to merge 2 commits into
pulp-platform:develfrom
mosaic-soc:pr/c-headers
Open

Register frontend: C header generation#158
da-gazzi wants to merge 2 commits into
pulp-platform:develfrom
mosaic-soc:pr/c-headers

Conversation

@da-gazzi

Copy link
Copy Markdown
Contributor
  • Add make target idma_sw_all to generate target/sw/idma_reg{32,64}_${N}d_[raw_]regs.h for each generated register frontend.
  • 2 headers are generated: the one without raw in the name uses the PeakRDL c-header plugin to create a struct-based header, the one with raw is generated with the raw-header plugin. The raw version is (with the current version of raw-header) somewhat incomplete as the masks for sub-register bitfields have to be generated/hardcoded externally.
  • The deploy CI job calls this target and deploy.py is amended to edit the appropriate .gitignore; C headers are also checked into deploy branches
  • uv.lock and pyproject.toml amended so the c-header plugin is part of the environment

- This target generates C headers in `target/sw` with both the `raw-header` and `c-header` PeakRDL plugins
- Also added to `deploy` CI job
@da-gazzi
da-gazzi changed the base branch from master to devel July 13, 2026 08:31
- the PeakRDL `c-header` plugin generates structs with `__attribute__((__packed__))` which ensures proper packing of fields but can also cause the compiler to emit byte loads/stores to access 32-bit registers, which is definitely not what we want. The `unpacked` version of the C header has the attribute removed.
- The `idma_sw_clean` target had a typo and didn't actually clean anything, this is fixed now.
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