Spin FV-1 Emulator
A software emulator and test bench for the Spin Semiconductor FV-1 audio DSP.
Abstract
This project started as an attempt to build a software emulator for the Spin Semiconductor FV-1 audio DSP commonly found in guitar pedals and all sorts of digital audio effects hardware.
The goal was to emulate the actual FV-1 processor and its instruction set rather than just make another DSP effects library that happens to run FV-1 style effects.
Well... it works now!!
FV-1 Lab 1.0.2 is currently released for Linux, macOS and Windows.
https://github.com/Roth-Amplification-Ltd/Spin-FV-1-Emulator
Latest release:
https://github.com/Roth-Amplification-Ltd/Spin-FV-1-Emulator/releases/tag/v1.0.2
You can load SpinASM programs, assembled FV-1 programs and EEPROM banks, run them against WAV files, test signals or realtime audio and inspect what is going on inside the virtual chip.
Current Status
The desktop emulator/testbench is now feature complete.
FV-1 Lab includes:
- FV-1 instruction emulation
- ACC / PACC / LR
- 32 general purpose registers
- ADC / DAC registers
- POT0 / POT1 / POT2
- 24-bit DSP arithmetic
- saturation and coefficient handling
- 32K delay memory
- SIN/COS LFOs
- RAMP LFOs
- CHO
- SKP
- LOG / EXP
- SpinASM compilation
- raw program loading
- EEPROM bank loading
- WAV input/output
- realtime audio
- virtual POT controls
- oscilloscope
- spectrum analyzer
- spectrogram
- audio recording
- Delay RAM inspection
- register inspection
- instruction stepping
- resource analysis
- hardware validation tools
Linux and Windows use the Qt FV-1 Lab frontend while macOS has its own native SwiftUI frontend.
The actual emulator core and SDK are platform independent.
The Standalone SpinASM Compiler
The SpinASM compiler has also been split out into its own project.
open-spin-fv1
https://github.com/Roth-Amplification-Ltd/open-spin-fv-1-compiler
Latest release:
https://github.com/Roth-Amplification-Ltd/open-spin-fv-1-compiler/releases/tag/v0.2.0
It is a native C++20 SpinASM compiler that can be used from the command line or embedded into another project.
Prebuilt versions are available for:
- Linux x86_64
- Linux ARM64
- macOS Intel
- macOS Apple Silicon
- Windows x86_64
- Windows ARM64
FV-1 Lab contains a pinned copy of the compiler so it can still build completely offline, but CI verifies that copy against the standalone compiler project so the two can't quietly drift apart.
Compiler Accuracy
A bunch of reverse engineering work has also gone into figuring out how the original Spin Semiconductor SpinAsm 1.1.31 compiler actually behaves.
Differential testing against the real compiler uncovered a couple things my original implementation had wrong including fixed point rounding behavior and unconditional SKP syntax.
The current audited program corpus is 9/9 byte identical against the genuine SpinAsm 1.1.31 compiler.
That doesn't mean I've proven every possible weird SpinASM program yet, which is why the standalone compiler is still in the 0.x series.
Before I call the compiler 1.0.0 I want to torture test basically every opcode, argument boundary, parser case and other stupid thing I can think of against the real compiler.
How The Emulator Works
At a high level it is still basically:
Audio Input -> ADC Registers -> FV-1 Program -> DAC Registers -> Audio Output
For every virtual audio sample the emulator loads the input into the FV-1 ADC registers, executes the program, updates the processor state and delay memory and collects whatever the program writes to DACL and DACR.
Then it does the whole thing again.
Simple enough in theory!!!!!
The fun part has always been making all the little details behave like the actual chip.
Instruction Set
The emulator currently implements the FV-1 instruction set including:
- RDAX / WRAX
- RDFX / LDAX
- WRLX / WRHX
- MULX
- RDA / WRA / WRAP
- RMPA
- SOF
- LOG / EXP
- SKP / NOP
- WLDS / WLDR
- JAM
- CHO
- AND / OR / XOR / NOT
- CLR
- MAXX / ABSA
The instruction execution model is regression tested and there is also an independent reference implementation used for differential testing against the production...
Read more »
AVR
Francesco Nano
Martin
Eric Badger