skillfed

peakrdl-cheader

Generate C Header files from a SystemRDL register model

peakrdl-cheader v1.1.0 231.5K downloads/30d#9,085 on PyPI16
Copyleft license LGPLv3 Active released

What it is and what it does

PeakRDL C Header is a code generator that converts SystemRDL register specifications into C header files. It sits on top of the systemrdl-compiler to parse hardware register definitions and uses jinja2 templates to produce C code. The package is designed for hardware-software co-development workflows where register layouts defined in SystemRDL need to be exposed to C firmware or driver code.

The tool is part of the broader PeakRDL ecosystem and targets developers working with register-level hardware abstractions. It automates the error-prone manual translation of register specifications into C headers, ensuring consistency between hardware documentation and software code. The package is production-stable, actively maintained, and has no known security vulnerabilities.

Use it for:

  • Generate C headers from SystemRDL register models for embedded firmware development
  • Automate register definition synchronization between hardware specs and C driver code
  • Create consistent register access structures for SoC bring-up and validation
  • Integrate register code generation into hardware-software build pipelines

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates C header files from SystemRDL register models, converting hardware register specifications into C code suitable for software development.

Yes. The package is production-stable, actively maintained, has low install friction, and solves a real problem in hardware-software co-development. The LGPLv3 copyleft license is standard for open-source tools and poses no barrier for most use cases. Install it if you work with SystemRDL register models and need C headers.

Install

peakrdl-cheader on PyPI

pip

pip install peakrdl-cheader

uv

uv add peakrdl-cheader

poetry

poetry add peakrdl-cheader

Installing peakrdl-cheader

Before you install

Low install friction with a pure Python wheel. Actively maintained as of March 2026 with recent commits. Depends on systemrdl-compiler and jinja2, both stable and widely available.

License in practice

Licensed under LGPLv3 (copyleft). You may use and modify the package freely, but any derivative work must also be licensed under LGPLv3 and source code must be made available.

Quickstart

pip install peakrdl-cheader

from peakrdl.cheader import CHeaderCompiler
from systemrdl import RDLCompiler

rdl = RDLCompiler()
rdl.compile_file('registers.rdl')
compiler = CHeaderCompiler(rdl.root)
compiler.write('output.h')

Requires a valid SystemRDL input file and systemrdl-compiler to parse it; jinja2 is used internally for template rendering.

Verify before relying

  • Whether the package supports incremental compilation or batch processing of multiple register models
  • What C standard or dialect the generated headers target
  • Whether generated headers include register access macros or only struct definitions

Package facts

License LGPLv3 (copyleft)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — systemrdl-compiler, jinja2
Maintenance actively maintained — 139 days since the last release
Last repo commit
First released
Downloads 231,501/month — #9,085 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: peakrdl_cheader-1.1.0-py3-none-any.whl

Keywords: SystemRDL, PeakRDL, CSR, compiler, tool, registers, generator, C, header, software

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering :: Electronic Design Automation (EDA)

Tags

systemrdl to c header generatorregister model c code generationhardware register c headerssystemrdl compiler plugincsr c header generationregister definition c output
hardware-descriptioncode-generationregister-modeling

More Electronic Design Automation (EDA) packages