Skip to content

Regs: Single-source the compute_op encoding in SystemRDL - #176

Merged
DanielKellerM merged 2 commits into
develfrom
regs/compute-op-enum
Aug 12, 2026
Merged

Regs: Single-source the compute_op encoding in SystemRDL#176
DanielKellerM merged 2 commits into
develfrom
regs/compute-op-enum

Conversation

@DanielKellerM

@DanielKellerM DanielKellerM commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

The compute op encoding now has exactly one source: the compute_op encode enum in idma_reg.rdl (member descs carry the byte-ratio documentation).

Everything else derives from it:

  • idma_pkg::compute_op_eutil/gen_compute_svh.py renders the enum into target/rtl/include/idma/compute.svh (width taken from the 4-bit field, descs become member comments), which idma_pkg.sv includes in place of the hand-written enum. Generated alongside tracer.svh, checked in on deploy branches.
  • SW headers — peakrdl raw-header emits COMPUTE_OP__MXQUANT ... into the C header and compute_op_e into the SV addrmap pkg, so integrators derive the op codes instead of hand-mirroring them.

The regblock hwif is unchanged (compute_op.value stays logic [3:0]). Validated on the regenerated RTL: tb_idma_reg_frontend passes in all three configs, tb_idma_mxquant ALL PASS at every DataWidth. Follow-up to #170.

@DanielKellerM
DanielKellerM requested a review from micprog as a code owner August 12, 2026 10:10
Copilot AI lite review requested due to automatic review settings August 12, 2026 10:10

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.

Declare the compute op encoding as an RDL enum (encode= on compute_cfg.compute_op)
instead of listing the values in the field desc. The encoding becomes machine-
readable: peakrdl raw-header emits it into the C header (COMPUTE_OP__MXQUANT ...)
and the SV addrmap pkg (compute_op_e), so SW integrators derive the op codes from
the reg contract instead of hand-mirroring idma_pkg::compute_op_e. The regblock
hwif is unchanged (compute_op.value stays logic [3:0]).
The compute op encoding now has one source: the compute_op encode enum in
idma_reg.rdl. util/gen_compute_svh.py renders it into
target/rtl/include/idma/compute.svh (member descs become comments, enum width
from the field width), which idma_pkg.sv includes in place of the hand-written
enum. Generated alongside tracer.svh and checked in on deploy branches.
@DanielKellerM DanielKellerM changed the title Regs: Encode compute_op as a SystemRDL enum Regs: Single-source the compute_op encoding in SystemRDL Aug 12, 2026
@DanielKellerM
DanielKellerM merged commit 6b386a8 into devel Aug 12, 2026
12 of 13 checks passed
@DanielKellerM
DanielKellerM deleted the regs/compute-op-enum branch August 12, 2026 12:13
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