How casper-astro/tutorials_devel works
Project Type & Purpose
• This is a “multi-platform tutorial” repository for the CASPER FPGA Toolflow.
• It bundles:
– Core libraries (casperfpga, mlib_devel submodules)
– Sphinx documentation (docs/)
– Platform directories (snap/, roach2/, skarab/, red_pitaya/, alveo/, rfsoc/) each containing:
· mlib_devel (submodule of DSP library code)
· Tutorial designs (*.slx, *.py, *.fpg, *.dtbo)
· startsg scripts for launching the MATLAB front-end
· Example Python drivers
Main Components & Their Relationships
a. User Environment (Developer Workstation)
– Virtual environment or bare Python/MATLAB install
– Shell / CLI to run activate_platform.sh and startsg
b. Core Libraries
– casperfpga (Python API to communicate with boards)
– mlib_devel (DSP library for CASPER toolflow)
c. Platform Modules (one per board)
– Each platform folder (e.g. snap/, roach2/, etc.)
– Contains mlib_devel (checked-out submodule) + startsg scripts + tutorials
d. Toolflow Front-End (MATLAB + Simulink)
– Reads platform’s startsg.local for board specifics
– Loads design files (*.slx) and DSP blocks from mlib_devel
– Exports bitstream (.fpg) and optionally device tree overlay (.dtbo)
e. Python Control Layer
– Uses casperfpga to connect to the hardware over Ethernet/PCIe
– Runs tutorial scripts (*.py) for data capture, plotting, etc.
f. Hardware Boards
– Actual FPGA hardware (SNAP, ROACH2, SKARAB, etc.)
– Receives bitstream and streams ADC/DAC data, network packets, etc.
g. Documentation Site
– Sphinx sources in docs/
– Builds HTML tutorials covering the above workflow
1. User invokes ./activate_platform <platform> → checks out platform’s mlib_devel.
2. User runs cd <platform>/ & ./startsg startsg.local → launches MATLAB front-end.
3. MATLAB toolflow (Simulink + mlib_devel) → synthesizes & generates .fpg/.dtbo.
4. User runs Python tutorial (e.g. snap/tut_spec/snap_tut_spec.py) → uses casperfpga.
5. Python API → communicates (Ethernet/PCIe) → FPGA board → streams data back.
6. Results → plots & logs on user workstation.
Highlighted Architectural Patterns
• Plugin-style per-platform directories—each self-contained.
• Clear layering: Core libs → MATLAB/Simulink front-end → bitstream → Python API → hardware.
• Documentation decoupled from code; built via Sphinx.