40 Commits

Author SHA1 Message Date
cah
f2901c6366 docs: add OpenLane hardening results and critical path analysis
Documents 4 hardening runs with timing/area/DRC results. Identifies
SYNDROME state as critical path bottleneck (222 logic levels, 49 ns)
and proposes 2-stage pipeline fix to meet 50 MHz target.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:03:35 -07:00
cah
3e797fd5ab fix: sync Yosys-compatible sat_add/sat_sub from chip_ignite
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:18:19 -07:00
cah
a83f05cf82 fix: sync Yosys-compatible packed LLR interface from chip_ignite
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 21:08:49 -07:00
cah
6cc13829c8 fix: sync cn_min_sum iverilog compatibility fix from chip_ignite
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:54:21 -07:00
cah
ab9ef9ca30 test: add vector-driven Verilator testbench with Python model cross-check
Add gen_verilator_vectors.py to convert test_vectors.json into hex files
for $readmemh, and tb_ldpc_vectors.sv to drive 20 test vectors through
the RTL decoder and verify bit-exact matching against the Python model.

All 11 converged vectors pass with exact decoded word, convergence flag,
and zero syndrome weight. All 9 non-converged vectors match the Python
model's decoded word, iteration count, and syndrome weight exactly.

Three RTL bugs fixed in ldpc_decoder_core.sv during testing:
- Magnitude overflow: -32 (6'b100000) negation overflowed 5-bit field
  to 0; now clamped to max magnitude 31
- Converged flag persistence: moved clearing from IDLE to INIT so host
  can read results after decode completes
- msg_cn2vn zeroing: bypass stale array reads on first iteration
  (iter_cnt==0) to avoid Verilator scheduling issues with large 3D
  array initialization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:50:09 -07:00
cah
1520f4da5b chore: add simulation artifacts to gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:06:25 -07:00
cah
b7449a6191 fix: RTL bugs in decoder core + add standalone Verilator testbench
RTL fixes:
- Skip unconnected columns (H_BASE=-1) in LAYER_READ/WRITE/SYNDROME
- Set unconnected VN->CN messages to +MAX (not 0) to avoid
  corrupting min-sum minimum computation
- Add SYNDROME_DONE state to fix timing race on syndrome_ok
- Fix VERSION_ID hex literal (0xLD01 -> 0x1D01)

Testbench verifies VERSION register read and clean all-zero decode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:05:52 -07:00
cah
3372f84a3a test: add standalone Verilator testbench for LDPC decoder
Add tb/tb_ldpc_decoder.sv with Wishbone read/write tasks, version
register test, and all-zero codeword decode test. Add tb/Makefile
with lint and sim targets.

Fix two RTL bugs found during testbench bring-up:
- ldpc_decoder_core.sv: skip unconnected H_BASE columns (shift=-1)
  in LAYER_READ, LAYER_WRITE, and SYNDROME states to prevent
  out-of-bounds array access and belief corruption
- ldpc_decoder_core.sv: fix syndrome_ok timing race by adding
  SYNDROME_DONE state so the registered result is available before
  the early-termination decision
- wishbone_interface.sv: fix VERSION_ID typo (0xLD01 -> 0x1D01)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:00:41 -07:00
cah
74baf3cd05 feat: add test vector generation for RTL verification
Improve generate_test_vectors() to use mixed SNR levels (high SNR for
first half, nominal for second half) ensuring a mix of converged and
non-converged test cases. Add gen_firmware_vectors.py converter that
reads test_vectors.json and produces packed LLR data matching the
RTL wishbone interface format (5 LLRs per 32-bit word, 6-bit two's
complement).

Generated 20 vectors: 11 converged, 9 non-converged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:36:26 -07:00
cah
9a28e30bed docs: add detailed implementation plan for ChipFoundry contest
20 tasks across 8 weeks covering RTL integration, verification,
OpenLane hardening, firmware, PCBA, and final submission.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:10:38 -07:00
cah
db06a8a481 docs: add ChipFoundry contest submission design
Approach A (minimal viable submission) as execution plan,
Approaches B and C documented as aspirational roadmap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:03:55 -07:00
cah
d39b133c76 docs: frame sync runs as PicoRV32 firmware, zero extra RTL
Reuses existing syndrome_wt register and converged flag.
No additional hardware needed on the ASIC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:47:49 -07:00
cah
623e5e2e26 docs: add frame synchronization section to project report
Adds section 7 covering preamble-less frame sync using syndrome
screening, which was missing from the original report.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 21:54:49 -07:00
cah
87b84f8c75 docs: add project report with architecture diagrams
Comprehensive report for FPGA partner covering:
- System architecture and channel model
- LDPC decoder hardware blocks
- Code optimization journey (5.23 -> 1.03 photons/slot)
- SC-LDPC threshold saturation results
- RTL implementation plan and area estimates

Includes 10 figures: system architecture, channel model,
degree distributions, FER curves, threshold progressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 21:45:35 -07:00
cah
b4d5856bf9 data: add SC-LDPC results and comprehensive comparison plots
SC-LDPC threshold saturation results:
- SC original staircase: 2.28 photons/slot (vs 4.76 uncoupled)
- SC DE-optimized: 1.03 photons/slot (vs 3.21 uncoupled)
- Shannon limit: 0.47 photons/slot (remaining gap: 3.4 dB)

Add CLI to sc_ldpc.py (threshold, fer-compare, full subcommands).
Add threshold progression, SC threshold bars, and SC FER plots.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:35:50 -07:00
cah
41e2ef72ec feat: add SC-LDPC density evolution with threshold computation
Implement position-aware density evolution for SC-LDPC codes:
- sc_density_evolution(): flooding-schedule DE tracking per-position
  error rates, demonstrating the wave decoding effect
- compute_sc_threshold(): binary search for SC-LDPC threshold

Uses flooding schedule (not layered) to avoid belief divergence
from cross-position message interference in the coupled chain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:45:21 -07:00
cah
49c494401b data: add Z=128 pipeline results and comparison plots
Run FER validation at Z=128 with normalized min-sum (alpha=0.875).
Best alpha found via sweep: 0.875 (threshold 2.90 photons/slot).
Z=128 matrix achieves girth=8 vs girth=6 at Z=32.
Add Z=128 vs Z=32 FER comparison plot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:08:07 -07:00
cah
5f69de6cb8 feat: add windowed SC-LDPC decoder
Implement windowed_decode() for SC-LDPC codes using flooding
min-sum with sliding window of W positions. Supports both
normalized and offset min-sum modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:08:06 -07:00
cah
5b6ad4d3f2 feat: add SC-LDPC chain construction
Implement spatially-coupled LDPC code construction with:
- split_protograph(): split base matrix edges into w components
- build_sc_chain(): build full SC-LDPC H matrix with L positions
- sc_encode(): GF(2) Gaussian elimination encoder for SC chain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:49:57 -07:00
cah
6bffc6cb5f feat: add Z=128 support for matrix construction and validation
Make validate_matrix() and run_full_pipeline() accept z parameter
instead of using hardcoded Z=32. Thread cn_mode/alpha to validation.
Add --z/--cn-mode/--alpha CLI options to full pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:49:55 -07:00
cah
30b4d95be2 feat: add alpha optimization for normalized min-sum
Add optimize_alpha() function that sweeps hardware-friendly alpha
values to find the best DE threshold with normalized min-sum.
Add alpha-sweep CLI subcommand and --z/--cn-mode/--alpha options
to the full pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:41:58 -07:00
cah
e657e9baf1 feat: add normalized min-sum to density evolution engine
Thread cn_mode and alpha parameters through the entire DE pipeline:
de_cn_update_vectorized(), density_evolution_step(), run_de(),
compute_threshold(), and compute_threshold_for_profile().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:37:57 -07:00
cah
b04813fa7c feat: add normalized min-sum CN update mode
Add cn_mode ('offset'/'normalized') and alpha parameters to
min_sum_cn_update() in ldpc_sim.py and generic_decode() in
ldpc_analysis.py. Normalized mode scales magnitudes by alpha
(default 0.75) instead of subtracting a fixed offset, which
is better suited for low-rate codes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:35:28 -07:00
cah
eb255af067 data: add density evolution optimization results
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 06:07:14 -07:00
cah
ca651f4f30 feat: add FER validation and CLI for density evolution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 06:03:19 -07:00
cah
f30f972dab feat: add PEG base matrix constructor with shift optimization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 06:01:57 -07:00
cah
a09c5f20e1 feat: add degree distribution optimizer with exhaustive search
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:53:23 -07:00
cah
f5b3e318c4 feat: add threshold computation via binary search
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:27:33 -07:00
cah
d0453e0583 feat: add Monte Carlo density evolution engine
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:17:06 -07:00
cah
53347ead1c chore: add .gitignore with worktree and Python exclusions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:14:51 -07:00
cah
6d59f853c4 Add comprehensive analysis results document
Covers all five studies: rate comparison, base matrix quality,
quantization sweep, Shannon gap, and frame synchronization.
Includes interpretation, recommendations, and reproduction steps.

Key findings: 9 dB gap to Shannon, matrix degree distribution is
the primary bottleneck, 6-bit quantization validated, frame sync
tractable at ~30 us acquisition cost.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 05:01:26 -07:00
cah
b8bff512a4 Add implementation plan for frame sync and code analysis
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:58:56 -07:00
cah
1967ae90e4 Fix matrix rank issues and run all code analyses
- Fixed improved staircase: below-diagonal connections preserve full
  parity rank (col7->row0 s3, col1->row4 s15)
- Fixed PEG matrix: staircase backbone with cross-connections,
  all parity cols dv>=2, VN degrees [7,3,3,3,2,2,2,2]
- Clean up VN degree display (remove np.int64 wrapper)
- Ran all four analyses with 200 frames per point

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:56:37 -07:00
cah
ad7cb5098c feat: add code analysis tool with rate, matrix, quantization, and Shannon analyses
Implements four LDPC code analyses for photon-starved optical channels:
- Rate sweep: compare FER across 1/2, 1/3, 1/4, 1/6, 1/8 IRA staircase codes
- Matrix comparison: original staircase vs improved staircase vs PEG ring
- Quantization sweep: 4-16 bit and float precision impact on FER
- Shannon gap: binary-input Poisson channel capacity limits via binary search

Core infrastructure includes generic IRA staircase builder, GF(2) Gaussian
elimination encoder for non-triangular matrices, parameterized layered
min-sum decoder with variable check degree, and BFS girth computation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:46:39 -07:00
cah
c427dfdd3d feat: add frame synchronization prototype with tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:40:07 -07:00
cah
af6055242e test: add validation tests for existing LDPC model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:32:16 -07:00
cah
5f69e2cbec Add design doc for frame sync and code analysis
Covers frame synchronization prototype (acquisition + re-sync)
and four code analysis studies: rate comparison, base matrix
quality, quantization sweep, and Shannon gap computation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:42:32 -07:00
cah
18333e32f5 Update RTL base matrix to match working Python model
IRA staircase structure: col 0 = info (dv=7), cols 1-7 = parity (dv=1-2).
RTL decoder core still needs CN update rework for variable degree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:56:48 -07:00
cah
b7b76da46e Fix encoder and decoder - working LDPC simulation
- Fixed cyclic shift convention (QC-LDPC P_s is left shift, not right)
- Fixed encoder to solve rows sequentially (row 0 first for p1, then 1-6)
- Fixed decoder to only gather connected columns per CN (staircase has dc=2-3)
- Fixed LLR sign convention: positive = bit 0 more likely
- Decoder validates at lam_s >= 4 photons/slot (~90% frame success)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:56:15 -07:00
cah
b93a6f5769 Initial LDPC optical decoder project scaffold
Rate-1/8 QC-LDPC decoder for photon-starved optical communication.
Target: Efabless chipIgnite (SkyWater 130nm, Caravel harness).

- RTL: decoder top, core (layered min-sum), Wishbone interface
- Python behavioral model with Poisson channel simulation
- 7x8 base matrix, Z=32, n=256, k=32

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:47:40 -07:00