Skip to content

Add general Cyclone IV bitstream-RE tooling + routing-codec data - #1

Open
labeth wants to merge 1 commit into
14sea:mainfrom
labeth:contrib/coverage-fuzzing-iostd
Open

Add general Cyclone IV bitstream-RE tooling + routing-codec data#1
labeth wants to merge 1 commit into
14sea:mainfrom
labeth:contrib/coverage-fuzzing-iostd

Conversation

@labeth

@labeth labeth commented Jul 22, 2026

Copy link
Copy Markdown

General-purpose additions to the fuzzing/mining toolkit, placed per repo convention (scripts in fuzz/, data in results/, notes in docs/). Target-specific reverse-engineering was deliberately kept out — this is only the reusable-for-any-Cyclone-IV pieces.

What's here

Tooling (fuzz/)

  • quartus_grind.py — a memory-safe Quartus compile scheduler: a RAM gate + watchdog + OOM-safe /proc kill, so bulk CRAM mining can run unattended on a small box without OOM-crashing it.
  • dense_fill.py — a snake-chain column-fill route-forcing payload; it saturates a LAB column to force many distinct wires per compile (far more bits/compile than a 2-LUT pair).
  • iostd_codec_mine.py — an IOB I/O-standard / drive / slew codec miner (variant-vs-reference diff to cancel routing). Shipped as a method plus a documented honest negative (see below).
  • config.py — one-line generalization: WORK_DIR honors $FUZZ_WORK_DIR so isolated parallel campaigns don't share a work dir.

Data (results/) + notes (docs/)

  • rcf_wire_cells.json — 102 routing wires → CRAM cells across the 5 switch classes (RCF back-annotation). Solid positive routing-codec data.
  • iostd_specimens.jsonl — the raw specimens behind the iostd negative, committed so a better alignment can be re-analyzed without re-mining.
  • docs/mined_codec_data.md — notes on both data files.

Honesty note (the iostd miner)

The I/O-standard codec miner is included as a method and a negative result, not an over-claim: the electrical bits are not cleanly position-invariant, and the small "invariant" core turned out to be a min-offset normalization artifact. The raw specimens are committed so someone with a better alignment idea can pick it up.

Provenance

Cleared a 4-lens adversarial review (privacy / correctness / license+accuracy / value+honesty) and a no-Quartus functional test (the analyzer reproduces on the shipped data). One fuzz/config.py line changed; everything else is additive.

Happy to adjust placement/naming or split this into smaller PRs if you'd prefer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LHRcDS2uPMxKLED57kziom

Curated general-purpose additions (target-specific RE deliberately kept out),
placed per repo convention (scripts in fuzz/, data in results/, notes in docs/):
- fuzz/quartus_grind.py: memory-safe Quartus compile scheduler (RAM gate + watchdog
  + OOM-safe /proc kill) — lets bulk CRAM mining run unattended on a small box.
- fuzz/iostd_codec_mine.py: IOB I/O-standard/drive/slew codec miner (variant-vs-ref
  diff cancels routing). Ships as method + a documented HONEST NEGATIVE: the
  electrical bits are not cleanly position-invariant, and the small 'invariant'
  core is a min-offset normalisation artifact.
- fuzz/dense_fill.py: snake-chain column-fill route-forcing payload.
- fuzz/config.py: WORK_DIR honors $FUZZ_WORK_DIR (isolated parallel campaigns).
- results/rcf_wire_cells.json: 102 routing wires -> CRAM cells across 5 switch
  classes (RCF back-annotation) — solid positive routing-codec data.
- results/iostd_specimens.jsonl: raw specimens behind the iostd negative, committed
  so a better alignment is re-analyzable without re-mining.
- docs/mined_codec_data.md: notes on both data files.

Cleared a 4-lens adversarial review (privacy / correctness / license+accuracy /
value+honesty) and a no-Quartus functional test (analyze reproduces on shipped data).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant