The controls are organized in a traditional three-tier layout.
Tier 1 (hardware access): Verilog code targeted at the XC2S150 FPGA that lies at the center of the custom hardware. Includes a direct digital frequency synthesizer (DDS), a low-latency vector PI feedback control loop, four-channel vector waveform capture, and support for on-board housekeeping circuitry.
Tier 2 (network presentation): C code targeted at a 32-bit microcontroller, which has a direct connection to both the FPGA and to Ethernet. This layer is itself divided into a HAL (hardware abstraction layer) to mediate access to the FPGA registers, a driver to organize all the application-specific computations (including a waveform curve fit that determines cavity detuning), and a toy network access protocol.
Tier 3 (operator interface): A Tcl program that exchanges data with tier 2, and gives the operator a virtual control panel for the hardware.
In the production SNS installation, the toy network access protocol and tier 3 are replaced with EPICS. The code given here is dramatically smaller and simpler than EPICS, yet gives enough functionality to demonstrate proper operation of an RF cavity.
The SNS facility now uses three generations of LLRF control hardware. This package supports all of them, although support for the first ("MEBT") system is yet untested. It may also be adaptable to future LLRF projects at LBNL, other National Labs, and worldwide.