Zen Peripherals · dev / verification IP · brief · 2026-11-04

Bring up a block's registers in firmware before the RTL exists

Zen CSR-Sim is a register-map simulation and firmware bring-up tool. You describe a block's control/status registers in YAML, write its init firmware in C, compile that C for real with a RISC-V toolchain, and single-step it on a built-in instruction-set simulator — watching every register, field, and bit change live, with a routable LED bank for output. It is a dev/verification tool, not synthesizable RTL. Product / integrator view; every number is sourced from the Zen CSR-Sim datasheet or marked TBC.

1. CSR-Sim in one paragraph

Almost every block has a register bank, and firmware bring-up usually waits for RTL or silicon. CSR-Sim removes that wait. You define the register file once in YAML — regfile → registers → fields, each field carrying its own access class — then author the block's init sequence in C using the provided CSR32(addr) accessor. CSR-Sim compiles that C for real with riscv64-unknown-elf-gcc -march=rv32i, links it at 0x8000_0000, and runs the image one instruction at a time on a wedged-in RV32I simulator. Loads and stores into the register address range are intercepted and driven into a field-accurate CSR model, so control, status, and write-1-clear bits behave exactly as the map says. Every instruction is recorded, so you scrub the trace — PC, disassembly, register reads/writes, live bits — and route any field or bit to an LED bank to watch it change.

RV32Ireal riscv64 gcc compile + ISS
rw / ro / w1cper-field access semantics
YAMLruntime-loadable register map
VPD co-simA/B vs TLM or Verilated RTL
your inputsYAML + C compilerv32i gcc runRV32I ISS visualizetrace + LEDs CSR model MMIO intercept
Figure 1. CSR-Sim pipeline: your YAML register map and C firmware feed a real RISC-V compile, the image runs on the RV32I ISS one instruction at a time, MMIO is intercepted into the field-accurate CSR model, and the live register/LED view scrubs the recorded trace.
Firmware starts in parallel with the hardware. Because the register map is a structured YAML contract and the firmware is real compiled RISC-V, a team can write and prove a block's bring-up sequence before any RTL or silicon exists — then re-run it unchanged against the real design later.
Functional, not cycle-accurate. The "clock" is one instruction; CSR-Sim models programming-model behavior, not timing. It is not a signoff simulator — use it to validate register semantics and firmware sequences, then cross-check against TLM or RTL over the co-sim path.

2. What it is, at a glance

ElementDetailStatus
CSR-def YAMLregfile → registers → fields; per-field access; runtime-loadable, server-validatedexists
Field access classesrw/wo control, ro status, w1c write-1-clear; one register mixes freelyexists
Real firmware compileriscv64-unknown-elf-gcc -march=rv32i + crt0, linked 0x8000_0000, flat imageexists
RV32I ISSsteps the image; MMIO loads/stores intercepted into the CSR modelexists
Instruction-step traceplay / step / scrub; PC, disassembly, CSR reads/writes per stepexists
Live register viewcontrol / status / w1c coloring; 32-bit strip per registerexists
Routable LED bankroute any field or bit to LEDs (walking-one demos)exists
VPD co-sim backendserves a block's CSR model over the co-sim wire for TLM/RTL A/Bexists
Throughput (instr/sec, max trace)interactive-tool-class; absolute rates not characterizedTBC

Sources: Zen CSR-Sim product datasheet; as-built tool.

3. How a client uses it

  1. Define — write or upload the block's CSR-def YAML (regfile → registers → fields, each field with its access class and reset); it is validated before use, with no restart.
  2. Author — edit the init/bring-up firmware in C in the browser editor, using the CSR32(addr) accessor to read and write registers.
  3. Compile + run — compile the C for real to an RV32I image and step it one instruction at a time; MMIO accesses drive the field-accurate CSR model.
  4. Visualize + scrub — watch registers, fields, and bits update live, route fields/bits to the LED bank, and scrub back and forth through the recorded instruction trace.
  5. Cross-check — drive the same CSR model over the VPD co-sim wire to A/B the firmware against TLM or Verilated RTL on the real register semantics.

4. Verification & provenance

Sources read

Sources: Zen CSR-Sim product datasheet (overview, features, applications, functional overview, register-map schema, performance, verification, licensing); as-built tool.