LibreVNA/FPGA/VNA
Roger Henderson 1ea012aa57 implement FPGA-based CDS to avoid BRAM overflow
Move CDS phase computation from per-point config storage to FPGA logic.
The FPGA now computes the 180° phase shift internally (M/2) and loops
twice per point when CDS is enabled. This keeps config memory at 96 bits
instead of 112, avoiding BRAM overflow on the Spartan 6.

FPGA changes:
- Add CDS_ENABLED input to Sweep module (controlled via SPI register 6)
- Compute source_phase = M/2 for 180° shift when cds_phase=1
- State machine loops through all stages twice per point when CDS enabled
- RESULT_INDEX now includes cds_phase bit: stage[2:0] & point[11:0] & cds_phase

Firmware changes:
- Add FPGA::SetCDSEnabled() to control CDS via register 6 bit 11
- Update SamplingResult to include cdsPhase field (1 bit)
- Simplify VNA.cpp: FPGA handles phase switching, MCU combines results

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:19:57 +13:00
..
ipcore_dir implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
DFT.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
Flattop.dat Window coefficient files added 2020-10-29 20:07:41 +01:00
Hann.dat Window coefficient files added 2020-10-29 20:07:41 +01:00
Kaiser.dat Window coefficient files added 2020-10-29 20:07:41 +01:00
MAX2871.vhd add per-point source PLL phase adjustment support 2026-01-31 16:57:10 +13:00
MCP33131.vhd WIP: rework 2.LO + add dwell time 2025-01-02 19:16:53 +01:00
ResetDelay.vhd Basic DFT spectrum analysis working 2020-11-08 14:38:31 +01:00
Sampling.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
spi_slave.vhd Working dwell time feature 2025-01-03 14:36:10 +01:00
SPIConfig.vhd implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
Sweep.vhd implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
Synchronizer.vhd FPGA project adapted to new pinout 2020-08-30 16:19:18 +02:00
Test_DFT.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
Test_MAX2871.vhd FPGA project adapted to new pinout 2020-08-30 16:19:18 +02:00
Test_MCP33131.vhd improve MCP33131 sample timing 2024-02-26 15:37:07 +01:00
Test_PLL.vhd FPGA project adapted to new pinout 2020-08-30 16:19:18 +02:00
Test_Sampling.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
Test_SinCos.vhd FPGA project adapted to new pinout 2020-08-30 16:19:18 +02:00
Test_SPI.vhd Working dwell time feature 2025-01-03 14:36:10 +01:00
Test_SPICommands.vhd Working dwell time feature 2025-01-03 14:36:10 +01:00
Test_Window.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
Test_Windowing.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00
top.bin implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
top.ucf Working dwell time feature 2025-01-03 14:36:10 +01:00
top.vhd implement FPGA-based CDS to avoid BRAM overflow 2026-02-01 21:19:57 +13:00
VNA.gise fix order of LO1 and source unlock LEDs 2025-01-05 18:15:30 +01:00
VNA.xise WIP: rework 2.LO + add dwell time 2025-01-02 19:16:53 +01:00
window.vhd Windowing option added to sampling 2020-09-16 16:13:06 +02:00
Windowing.vhd Use full multiplier bitwidth for windowing + increased number of DFT bins 2020-11-08 14:38:31 +01:00