Skip to content

Document the FPGA/Verilog backend design (RustHDL/RHDL emission) - #597

Merged
0-jake-0 merged 1 commit into
nextfrom
claude/wired-graph-code-generation-ycjfif
Jul 28, 2026
Merged

Document the FPGA/Verilog backend design (RustHDL/RHDL emission)#597
0-jake-0 merged 1 commit into
nextfrom
claude/wired-graph-code-generation-ycjfif

Conversation

@0-jake-0

Copy link
Copy Markdown
Contributor

What

Adds next/docs/fpga-hdl-backend-decision.md — an exploratory design for a third backend behind the wired-graph front-end of wired-graph-codegen-decision.md (#596): traverse the wired graph, emit RHDL, which emits Verilog, so a graph's hot path (feed handler, signal pipeline) runs on an FPGA while the same wiring backtests in software. Cross-links the two docs both ways.

Docs-only; no code changes. Status recorded in the doc: exploratory, not scheduled — gated strictly behind the software generator's gates plus a hand-written de-risk spike.

What the doc records

  • Crate survey: rust-hdl (frozen at 0.46.0, July 2023) vs rhdl (the active pre-release rewrite whose #[kernel] functions compile a Rust subset via its RHIF IR to Verilog — no closures/references). Verdict: prototype on rhdl, ship the emitted Verilog as the toolchain-portable interface.
  • Why the mapping is unusually good: the Op pattern is accidentally RTL-shaped (a concept table: tick → valid strobe, Op::State → registers, active edge → valid gating, feedback → registered loop, historical mode → simulation testbench), and func! quotation is exactly the bridge rhdl's no-closure kernels need — quoted bodies splice through as #[kernel] fns with captures as literals, and rhdl's frontend becomes the eligibility checker.
  • A worked example end to end: wiring → generated RHDL sketch → idealized Verilog → simulation parity test, showing the filter closure arriving single-sourced while delta needs a hand-written RTL twin.
  • The three walls, accepted and documented: fixed-width type dialect (a stricter eligibility tier), per-op RTL twins reintroducing simulation-held drift (with single-sourced scalar-op kernels as the flagship hope), and dependency maturity.
  • The gate: a few-days hand-written spike (3–4 op twins, one toy graph, simulate against the interpreted run) that answers the two load-bearing uncertainties before any emitter exists.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SunAG7Q5ErqhaZBVtK5qv8


Generated by Claude Code

Adds fpga-hdl-backend-decision.md: an exploratory design for emitting
hardware from the same wired-graph front-end as the software generator
(wired-graph-codegen-decision.md) — generate RHDL, which generates
Verilog, so a graph's hot path runs on an FPGA while the same wiring
backtests in software.

Records:
- the survey of the two target crates (rust-hdl, frozen at 0.46; rhdl,
  the active pre-release rewrite whose #[kernel] subset forbids closures)
  and why rhdl is the prototyping vehicle with emitted Verilog as the
  portable shipped interface;
- the concept mapping (tick -> valid strobe, Op::State -> registers,
  active edge -> valid gating, feedback -> registered loop, historical
  mode -> simulation testbench) and why func! quotation is exactly the
  bridge rhdl's no-closure kernels need;
- a worked example end to end: wiring -> generated RHDL sketch ->
  idealized Verilog -> simulation parity test, showing the filter closure
  arriving single-sourced while delta needs a hand-written RTL twin;
- the three walls (fixed-width dialect, per-op twins reintroducing
  simulation-held drift, dependency maturity) and the hand-written
  de-risk spike that gates any emitter work.

Cross-links both ways with wired-graph-codegen-decision.md; sequenced
strictly behind the software generator's gates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SunAG7Q5ErqhaZBVtK5qv8
@0-jake-0
0-jake-0 merged commit c3a503a into next Jul 28, 2026
4 of 5 checks passed
@0-jake-0
0-jake-0 deleted the claude/wired-graph-code-generation-ycjfif branch July 28, 2026 22:55
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.

2 participants