# gibblelab/fpga architecture

> Architecture diagram of the GitHub repository gibblelab/fpga, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gibblelab/fpga
- Repository: https://github.com/gibblelab/fpga

## Overview

MCFS is a many-channel FPGA control system: configured analog/digital I/O feeds servo and signal-processing functions, which produce analog and digital outputs. The README documents the system capabilities and hardware/software roles, but no HDL excerpts were supplied; therefore internal call-level wiring is not asserted. The HDL nodes represent documented capabilities and tree-listed implementation modules, not inspected source behavior.

Main entry points: [`MCFS_HD/Sources/hdl/CavPID.v`](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/CavPID.v) (PID servos), [`MCFS_HD/Sources/hdl/top.sv`](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/top.sv) (FPGA firmware), [`Serial Control Interface`](https://github.com/gibblelab/fpga/tree/main/Serial%20Control%20Interface) (Servo parameters), [`MCFS_HD/Sources/hdl/SlowDACs.sv`](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/SlowDACs.sv) (Slow DAC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_io["Signal I/O"]
  node_fast_adc["Fast ADC<br/>[FastADCsDDR.v]"]
  node_slow_adc["Slow ADC<br/>[SlowADCs.sv]"]
  node_digital_io["Digital I/O<br/>[serialLine.v]"]
  node_fast_dac["Fast DAC<br/>[FastDACs.v]"]
  node_slow_dac["Slow DAC<br/>[SlowDACs.sv]"]
end

subgraph group_control["Control Processing"]
  node_servo["PID servos<br/>[CavPID.v]"]
  node_temp_servo["Temperature servos<br/>[TempServos.v]"]
  node_modulation["Modulation<br/>[dithSwitch.v]"]
  node_lockin["Lock-in detection<br/>[lockIn.v]"]
  node_signal_processing["Signal processing<br/>[DBS.v]"]
end

subgraph group_platform["FPGA Platform"]
  node_top["FPGA firmware<br/>[top.sv]"]
  node_baseboard["I/O baseboard"]
  node_power["Power supply"]
end

subgraph group_configuration["User Configuration"]
  node_parameter_files["Servo parameters"]
  node_waveform_parameters["Waveform parameters"]
end

node_operator(("System operator"))

node_operator -->|"adjusts gains"| node_parameter_files
node_operator -->|"sets waveform"| node_waveform_parameters
node_fast_adc -.->|"inputs signals"| node_servo
node_slow_adc -.->|"inputs signals"| node_servo
node_servo -.->|"drives outputs"| node_fast_dac
node_servo -.->|"drives outputs"| node_slow_dac
node_temp_servo -.->|"controls temperature"| node_slow_dac
node_modulation -.->|"supports detection"| node_lockin
node_signal_processing -.->|"provides filtering"| node_servo
node_top -->|"interfaces hardware"| node_baseboard
node_parameter_files -.->|"configures firmware"| node_top
node_waveform_parameters -.->|"configures firmware"| node_top
node_power -.->|"supplies power"| node_baseboard

click node_fast_adc "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/FastADCsDDR.v"
click node_slow_adc "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/SlowADCs.sv"
click node_digital_io "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/serialLine.v"
click node_servo "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/CavPID.v"
click node_temp_servo "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/TempServos.v"
click node_modulation "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/dithSwitch.v"
click node_lockin "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/lockIn.v"
click node_signal_processing "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/DBS.v"
click node_fast_dac "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/FastDACs.v"
click node_slow_dac "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/SlowDACs.sv"
click node_top "https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/top.sv"
click node_baseboard "https://github.com/gibblelab/fpga/tree/main/Mercury_AD_BaseBoard"
click node_power "https://github.com/gibblelab/fpga/tree/main/Power_Supply"
click node_parameter_files "https://github.com/gibblelab/fpga/tree/main/Serial%20Control%20Interface"
click node_waveform_parameters "https://github.com/gibblelab/fpga/tree/main/Serial%20Control%20Interface"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fast_adc,node_slow_adc,node_digital_io,node_fast_dac,node_slow_dac toneBlue
class node_servo,node_temp_servo,node_modulation,node_lockin,node_signal_processing toneAmber
class node_top,node_baseboard,node_power toneMint
class node_parameter_files,node_waveform_parameters toneRose
class node_operator toneIndigo
```

## Components

### Signal I/O

- [Fast ADC](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/FastADCsDDR.v): `MCFS_HD/Sources/hdl/FastADCsDDR.v`
- [Slow ADC](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/SlowADCs.sv): `MCFS_HD/Sources/hdl/SlowADCs.sv`
- [Digital I/O](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/serialLine.v): `MCFS_HD/Sources/hdl/serialLine.v`
- [Fast DAC](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/FastDACs.v): `MCFS_HD/Sources/hdl/FastDACs.v`
- [Slow DAC](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/SlowDACs.sv): `MCFS_HD/Sources/hdl/SlowDACs.sv`

### Control Processing

- [PID servos](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/CavPID.v): `MCFS_HD/Sources/hdl/CavPID.v`
- [Temperature servos](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/TempServos.v): `MCFS_HD/Sources/hdl/TempServos.v`
- [Modulation](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/dithSwitch.v): `MCFS_HD/Sources/hdl/dithSwitch.v`
- [Lock-in detection](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/lockIn.v): `MCFS_HD/Sources/hdl/lockIn.v`
- [Signal processing](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/DBS.v): `MCFS_HD/Sources/hdl/DBS.v`

### FPGA Platform

- [FPGA firmware](https://github.com/gibblelab/fpga/blob/main/MCFS_HD/Sources/hdl/top.sv): `MCFS_HD/Sources/hdl/top.sv`
- [I/O baseboard](https://github.com/gibblelab/fpga/tree/main/Mercury_AD_BaseBoard): `Mercury_AD_BaseBoard`
- [Power supply](https://github.com/gibblelab/fpga/tree/main/Power_Supply): `Power_Supply`

### User Configuration

- [Servo parameters](https://github.com/gibblelab/fpga/tree/main/Serial%20Control%20Interface): `Serial Control Interface`
- [Waveform parameters](https://github.com/gibblelab/fpga/tree/main/Serial%20Control%20Interface): `Serial Control Interface`

### Other components

- **System operator**

## Connections

- System operator → Servo parameters: adjusts gains (evidence: `README.md`)
- System operator → Waveform parameters: sets waveform (evidence: `README.md`)
- Fast ADC → PID servos: inputs signals
- Slow ADC → PID servos: inputs signals
- PID servos → Fast DAC: drives outputs
- PID servos → Slow DAC: drives outputs
- Temperature servos → Slow DAC: controls temperature
- Modulation → Lock-in detection: supports detection
- Signal processing → PID servos: provides filtering
- FPGA firmware → I/O baseboard: interfaces hardware (evidence: `README.md`)
- Servo parameters → FPGA firmware: configures firmware
- Waveform parameters → FPGA firmware: configures firmware
- Power supply → I/O baseboard: supplies power
