Skip to content

build(sw): derive iDMA register header from PeakRDL c-header#281

Draft
DanielKellerM wants to merge 1 commit into
pulp-platform:mainfrom
DanielKellerM:sw/idma-rdl-c-header
Draft

build(sw): derive iDMA register header from PeakRDL c-header#281
DanielKellerM wants to merge 1 commit into
pulp-platform:mainfrom
DanielKellerM:sw/idma-rdl-c-header

Conversation

@DanielKellerM

@DanielKellerM DanielKellerM commented Jun 25, 2026

Copy link
Copy Markdown

What

Adapts Cheshire SW to iDMA's SystemRDL/PeakRDL register flow:

  • sw.mk: drop the regtool --cdefines rule on the (now removed) idma_reg64_2d.hjson. Generate regs/idma.h with PeakRDL c-header directly from iDMA's RDL source ($(IDMA_ROOT)/src/frontend/reg/idma_reg.rdl), exactly like Cheshire already generates cheshire.h from its own RDL.
  • dma.h: port off the regtool macro names (*_REG_OFFSET, *_BIT) to offsetof() on the generated idma_reg64_2d_t struct plus the PeakRDL bit-position macros (*_bp).

Why

iDMA removed the hjson register description in its SystemRDL migration, so regtool can no longer generate regs/idma.h. Rather than copying a pre-generated header, this leverages Cheshire's existing PeakRDL flow — consistent with cheshire.h and the rest of the SystemRDL-based register generation.

Verified end-to-end

Real Cheshire make + RISC-V toolchain against an RDL-era iDMA:

  • make generates sw/include/regs/idma.h from iDMA's RDL (idma_reg64_2d_t struct + IDMA_REG64_2D__*_bp macros).
  • dma_1d.spm.elf, dma_2d.spm.elf, dma_slink.spm.elf all compile and link.
  • Register offsets match the old regtool map exactly (conf=0x0, dst_addr=0xD0, strides 0x100/0x108, reps=0x110, ND bit=10).

Depends on / TODO before merge

  • Bump the (transitive) idma Bender dependency to any RDL-era iDMA (post-SystemRDL; e.g. the common-cells-v2 branch for Gwaihir). Only iDMA's RDL source is needed — no special iDMA build target.
  • Regenerate the committed sw/include/regs/idma.h after the bump.

@DanielKellerM DanielKellerM force-pushed the sw/idma-rdl-c-header branch from 00c042c to 116badf Compare June 25, 2026 11:55
iDMA dropped the hjson register flow in its SystemRDL/PeakRDL migration,
so regtool can no longer generate regs/idma.h. Consume iDMA's generated
PeakRDL c-header instead and port dma.h off the regtool macro names to
offsetof() on the generated struct plus the PeakRDL bit-position macros.

Requires an iDMA version that ships the c-header target (pulp-platform/iDMA#144).
@DanielKellerM DanielKellerM force-pushed the sw/idma-rdl-c-header branch from 116badf to 90f414f Compare June 25, 2026 12:02
@DanielKellerM DanielKellerM marked this pull request as ready for review June 25, 2026 12:08
Copilot AI review requested due to automatic review settings June 25, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@DanielKellerM DanielKellerM marked this pull request as draft June 25, 2026 12:08
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