Skip to main content

PeakRDL-fw-hdl

A PeakRDL export plug-in that turns a SystemRDL register model into a Featherweight-HDL register description — the SystemVerilog class form built on fw_reg_block #(W) / fw_reg #(T).

The output is class-level model source, not RTL and not a UVM RAL model: it is consumed both by simulation testbenches and by fw-hdl's own synthesis front end, which lowers it to a register-block module.

Install

pip install peakrdl-fw-hdl[cli]

Use

peakrdl fw-hdl my_ip.rdl -o my_ip_reg_pkg.sv

In goes SystemRDL:

reg dma_ch_csr {
    field { sw = rw; hw = r; }                ch_en[0:0];
    field { sw = r;  hw = w; }                busy[10:10];
    field { sw = r;  hw = w; onread = rclr; } int_done[21:21];
};

addrmap dma_regs {
    dma_ch_csr csr @ 0x0;
};

Out comes the fw-hdl idiom:

package dma_reg_pkg;
    import fw_hdl_pkg::*;

    typedef struct packed {
        bit [9:0] reserved_31_22; // 31:22 RESERVED
        bit       int_done;       // 21 ROC
        bit [9:0] reserved_20_11; // 20:11 RESERVED
        bit       busy;           // 10 RO
        bit [8:0] reserved_9_1;   // 9:1 RESERVED
        bit       ch_en;          // 0 RW
    } dma_ch_csr_t;

    class dma_regs extends fw_reg_block #(32);
        fw_reg #(dma_ch_csr_t) csr; // 0x0000

        function new(string name);
            super.new(name);
            csr = new("csr", this, 'h0,
                      .sw_wmask(dma_ch_csr__sw_wmask()),
                      .hw_wmask(dma_ch_csr__hw_wmask()),
                      .rclr_mask(dma_ch_csr__rclr_mask()));
        endfunction

        static function dma_ch_csr_t dma_ch_csr__sw_wmask();
            return '{ ch_en:1, default:'0 };
        endfunction
        // ... hw_wmask, rclr_mask
    endclass
endpackage: dma_reg_pkg

SystemRDL says more than fw-hdl's four behavior words (reset, sw_wmask, hw_wmask, rclr_mask) can express. Everything that does not fit is reported at the field that caused it, with a stable message code, and annotated in the generated source — never silently changed. --strict turns those reports into errors.

Documentation

  • docs/ — installation, usage, the normative mapping reference, and the limitations table
  • docs/design.md — why the mapping is what it is
  • Featherweight HDL — the register class library this targets

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakrdl_fw_hdl-0.1.0.tar.gz (84.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peakrdl_fw_hdl-0.1.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file peakrdl_fw_hdl-0.1.0.tar.gz.

File metadata

  • Download URL: peakrdl_fw_hdl-0.1.0.tar.gz
  • Upload date:
  • Size: 84.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for peakrdl_fw_hdl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6248553d10f2cc45ff368aaa761b3af780756595e635025e7905d4dc5490f31b
MD5 3edd147790a59eaf13eb68954205ce97
BLAKE2b-256 b4a3902e0cfcadc24bc5e44d9d9708948dd68a7877e08e1434d5ea87f3c7b4b2

See more details on using hashes here.

File details

Details for the file peakrdl_fw_hdl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: peakrdl_fw_hdl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for peakrdl_fw_hdl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9610753cb642f5f3de0dfef01669abcfec53a039d7589d168a0776b62a874eb1
MD5 2c18f7b95501b0525660f3a568c68be4
BLAKE2b-256 98b035f4e7b444fbad94f51d907a3e94e5327b68eab1b2b3ee783ada9039f047

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page