ProjectsFPGA & Digital Design

Ruska

A polyphonic synthesizer whose entire audio path runs in FPGA fabric. Eight voices, each with two DDS oscillators and its own envelope, share one filter core and are mixed to stereo I²S; Linux on the Zynq only sends control.

Status
Validated on hardwareThe eight-voice design has been driven from a USB-MIDI keyboard on a Zynq-7010 board in operator-attended sessions. Listening quality and audio captures are not yet documented.
Role
Sole repository author — architecture, VHDL, verification flow, control software.
Period
2026 – present
  • 8 voices × 2 DDS oscillators
  • 1 shared sine ROM, 1 shared multiplier
  • WNS +1.433 ns at 100 MHz

Evidence ledger

Every claim carries the strongest evidence that currently exists for it. Planned work is listed as planned.

  • Measured on hardwareEight-voice design (M7 bitstream, 904,014 bytes) loaded on the board and driven from a USB-MIDI keyboard for a 120 s session: 223 note-on and 222 note-off events plus panic were acknowledged by the PL, none unacknowledged, 0 USB errors, safe stop confirmed.
  • Measured on hardwareParameter control (M8B): a keyboard controller mapped to filter cutoff; 407 parameter writes acknowledged in the final run, 0 errors.
  • Synthesized / implementedFull eight-voice design with parameter registers implemented through Datum on Vivado 2019.2: setup WNS +1.433 ns, hold WHS +0.035 ns, 0 of 15,176 endpoints failing, no unconstrained paths.
  • Synthesized / implementedShared-resource voice engine (M3A probe): one sine ROM in one RAMB36 and one multiplier in one DSP48E1 serve all voices; 2,285 LUT, about 76 % below the estimate for replicating the ROM per oscillator.
  • SimulatedVoice allocator checked by directed tests, 4,000 random events and a mutation suite in which 26 of 26 deliberate faults were detected.
  • SimulatedCodec-paced I²S output path verified end to end down to the serial wire, with a bit-exact Python replay of the simulated trace; TPT low-pass filter core likewise bit-exact against a model.
  • SimulatedAXI4-Lite register control plane (bridge, register file, versioned register map) with a system testbench and mutation checks.
  • PlannedFront-panel TFT user interface. A wiring and power audit exists on paper; nothing is connected yet.

Key: Measured on hardware · Synthesized / implemented · Simulated · Planned

Engineering challenge

A synthesizer’s signal path is usually software on a CPU or DSP. Ruska asks what changes when the whole audio path is dedicated hardware with a fixed, data-independent schedule — and the processor is reduced to a control plane. The constraint that makes this interesting is resource sharing: eight voices with two oscillators each would, if naively replicated, consume far more logic than a small Zynq-7010 offers.

Approach

Every voice keeps only its own state (a 32-bit phase register per oscillator, envelope and filter state). The expensive parts are shared and statically time-multiplexed: one sine lookup table in block RAM and one multiplier serve all oscillators on a schedule fixed at design time. One frame of the eight-voice engine takes 41 clocks, 32 of them multiplier slots, independent of the data. A cycle-budget model, kept in the repository and checked in simulation, ties the schedule to the audio sample period.

Architecture

  1. Control (ARM Linux)

    • USB-MIDI daemonC · PS
    • Event interfacehandshake + acknowledge
  2. Allocation

    • Voice allocator8 voices · steal rules · sustain
  3. Synthesis

    • 2 × DDS per voiceshared sine ROM
    • ADSR per voice
  4. Filter

    • TPT low-passone shared core, per-voice state
  5. Output

    • Stereo mixerper-voice pan / level
    • I²S transmittercodec-paced
  6. Analog

    • Audio codecDAC
Fig. 1 · Signal and control path of the eight-voice design. Conceptual diagram — drawn from the project's architecture and cycle-budget documents.

Solid outlines are fabric (VHDL); the dashed block runs on the ARM cores. All audio samples stay inside the FPGA.

Implementation notes

  • Fixed-point DSP. A shared fixed-point package defines widths and rounding; the sine table is a generated, committed constant package, so every tool (GHDL, Vivado) sees identical contents. Synthesis placed it in a single RAMB36 and the block-RAM contents were checked against the package.
  • One configuration per board. A profile selects part, clock, sample rate, voice count and widths. Core modules take generics only and never import the profile; a script checks the profile names against the build specification.
  • Voice allocator. Lowest free voice first; same-note retrigger; when all voices are busy, the oldest releasing voice is stolen, then the oldest sustained, then the oldest held. A stolen voice goes through a two-tick gate-low gap so the new note starts from the current envelope level — no click, no phase reset. Sustain pedal, all-notes-off and panic are handled in hardware.
  • Control path. Each event is a request/acknowledge handshake, so the PS can never overrun the PL. The PL exposes a busy signal that holds the acknowledge while the allocator is working; a daemon that gets no acknowledge enters a safe stop (panic, mute, disarm).
  • Clock domains. The I²S path is codec-paced; the clocking decision and its alternatives are recorded as architecture decision records in the repository.
  • Builds are orchestrated by Datum, so every bitstream traces back to a source bundle and a timing gate.

Verification and results

Simulation uses GHDL in a pinned Docker image with self-checking testbenches (make test). Where an expected value can be computed independently, a Python model replays the simulated trace bit for bit. The allocator suite is mutation-tested: faults are injected on purpose to confirm the testbench would notice them.

On hardware, sessions were run stage by stage with explicit gates: the bitstream hash is pinned, clock and PLL registers are read back before anything is loaded, and nothing touches flash. These sessions establish that the control path works end to end — events reach the PL, are acknowledged, and the device returns to a safe state — and that timing closed with positive slack.

Limitations and next steps

  • Single board target (Zynq-7010); a vendor-neutral simulation profile exists, but other FPGAs are not built.
  • Vivado 2019.2 only.
  • The control plane is being migrated from an event mailbox to a versioned AXI4-Lite register interface with a control service; this is in simulation, not validated on hardware.
  • Planned: a TFT front panel, effects, and a cents-based detune that does not need a per-sample multiplier.

Media

Real board photographs, oscilloscope captures and audio demonstrations will be added when recorded. Until then this page shows only a conceptual diagram, labelled as such.