Dies ist die offizielle Projektstruktur und Anleitung für deinen hybriden Synthesizer mit dem MKR Vidor 4000, basierend auf:
- FPGA-Design in Amaranth (Python HDL)
- Synthese via Quartus Prime Lite
- Mikrocontroller (SAMD21) via PlatformIO/Arduino
- Kommunikation per VidorMailbox
VidorSynth/
├── platformio.ini # PlatformIO-Projekt für SAMD21
├── src/
│ └── main.cpp # Arduino-Interface mit FPGA
├── fpga/
│ ├── top.py # Haupt-FPGA-Design in Amaranth
│ ├── wave_roms.py # vordefinierte Wavetables
│ ├── lfo.py # LFO-Modul
│ ├── blend_unit.py # Logik für Operatoren zwischen OSCs
│ ├── vidor4000.pcf # Pin-Mapping für Quartus
│ ├── requirements.txt # Python-Abhängigkeiten
│ └── build/ # Generierte Dateien & Bitstream
│ ├── top.v # Verilog-Ausgabe
│ ├── top.qsf # Quartus-Konfig
│ └── top.sof # Bitstream (nach Synthese)
cd fpga
python -m venv .venv
source .venv/bin/activate # oder .venv\Scripts\activate auf Windows
pip install -r requirements.txtamaranthpython -m amaranth.cli top.py -t quartus -p vidor4000.pcf -o build/topDadurch entstehen:
top.v→ Verilog-Codetop.qsf→ Pin-Constraints für Quartus
- Quartus Prime Lite öffnen
build/top.qpfladen- "Start Compilation" ausführen
- Ergebnis:
top.sof(Bitstream)
Optional: Flash mit Arduino IDE (Sketch mit FPGA.loadBitstream(...))
# platformio.ini
[env:mkrvidor4000]
platform = atmelsam
board = mkrvidor4000
framework = arduino
monitor_speed = 115200
lib_deps =
VidorPeripheralsBeispiel main.cpp:
#include <VidorPeripherals.h>
#include <VidorMailbox.h>
void setup() {
FPGA.begin();
VidorMailbox.begin();
uint32_t val = 0x42;
VidorMailbox.write(0x10, &val, 1);
}
void loop() {}top.pyenthält alle Submodule und Registerstruktur- Kommunikation erfolgt über
VidorMailbox.write(addr, &val, 1) - FPGA und SAMD teilen sich Speicher (Shared Register Bus)
docs/für technische Beschreibung der Register, Wellenformen, Modulationsstrukturtestbench/für FPGA-Test mit z. B. nMigen-Simulatorenexamples/für kombinierte PIO-Tests (MIDI, OSC, Envelope etc.)