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.
- CSR-Sim (model · ISS · compile)
- your firmware C + CSR-def YAML
- field-accurate CSR model
2. What it is, at a glance
| Element | Detail | Status |
|---|---|---|
| CSR-def YAML | regfile → registers → fields; per-field access; runtime-loadable, server-validated | exists |
| Field access classes | rw/wo control, ro status, w1c write-1-clear; one register mixes freely | exists |
| Real firmware compile | riscv64-unknown-elf-gcc -march=rv32i + crt0, linked 0x8000_0000, flat image | exists |
| RV32I ISS | steps the image; MMIO loads/stores intercepted into the CSR model | exists |
| Instruction-step trace | play / step / scrub; PC, disassembly, CSR reads/writes per step | exists |
| Live register view | control / status / w1c coloring; 32-bit strip per register | exists |
| Routable LED bank | route any field or bit to LEDs (walking-one demos) | exists |
| VPD co-sim backend | serves a block's CSR model over the co-sim wire for TLM/RTL A/B | exists |
| Throughput (instr/sec, max trace) | interactive-tool-class; absolute rates not characterized | TBC |
Sources: Zen CSR-Sim product datasheet; as-built tool.
3. How a client uses it
- 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. - Author — edit the init/bring-up firmware in C in the browser editor, using the
CSR32(addr)accessor to read and write registers. - 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.
- 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.
- 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
- End-to-end pipeline: real C → RV32I compile, ISS execution, and field-accurate CSR decode were exercised against a default GPIO block — a worked bring-up that sets control fields and walks an LED output — confirming the compile/run/visualize path.
- Co-sim: the
rw/ro/w1csemantics were enforced end-to-end across the VPD socket against a GPIO block —CSRSIM-VPD: PASS. The frontend compiles under strict TypeScript and is served by the backend. - Provenance: originated in Zen's visualizer line and transferred into the Zen Peripherals IP portfolio in 2026. Shipped as a dev/verification kit — register-map syntax, backend model/ISS/compiler, server, visualizer SPA, examples, and the co-sim adapter. Internal soft-license by default; license-ready for external delivery.
Sources read
Sources: Zen CSR-Sim product datasheet (overview, features, applications, functional overview, register-map schema, performance, verification, licensing); as-built tool.