# IP Catalog The IPs (intellectual-property modules) shipped with Sparkle. ## Compute - [`BitNet.md`](BitNet.md), [`BitNet_FPGA_Status.md`](BitNet_FPGA_Status.md), [`BitNet_LTL_Investigation.md`](BitNet_LTL_Investigation.md) — BitNet 1.58-bit ternary-weight transformer accelerator. FPGA synthesis status; bug-localization case study. - [`YOLOv8.md`](YOLOv8.md), [`YOLOv8_RTL_Plan.md`](YOLOv8_RTL_Plan.md), [`YOLOv8_TODO.md`](YOLOv8_TODO.md) — 15-module CNN object detector, fully synthesisable. - [`H264.md`](H264.md) — H.264 frame encoder + MP4 muxer. ## CPU + SoC - [`RV32.md`](RV32.md) — RISC-V RV32IMA SoC with picorv32 compatibility, multi-cycle pipeline, Sv32 MMU. Boots Linux 6.6 on the JIT. - [`Drone_SoC_Status.md`](Drone_SoC_Status.md) — drone control SoC with Vivado synthesis results. - [`Humanoid_SoC_Status.md`](Humanoid_SoC_Status.md) — humanoid robotics SoC. ## Reading the evidence columns Three different kinds of evidence appear in the tables below. They are **not** interchangeable, and this page does not re-audit each IP; a cell says what the IP's own page or tests record. 1. **Properties of a pure specification** (the "Lean theorems" column): theorems about the pure Lean spec or a Lean model of the protocol/arithmetic, for example a Lyapunov bound or a protocol invariant. They say nothing by themselves about the Signal DSL circuit or its Verilog. 2. **Source → IR theorems**: a kernel-checked statement that the IR module `#synthesizeVerilog`'s compiler returns computes what the Signal declaration computes. Only circuits accepted by the verified entries (`#ved_u1` and the experimental ones) have this, shape by shape; the support matrix is [../VED.md](../VED.md), the guarantee is [../reference/PublicAPI.md](../reference/PublicAPI.md). 3. **JIT / co-simulation / vector tests**: the "Details" column (`*-test` executables, iverilog round trips, NIST/RFC vectors) compares the circuit with a reference on chosen inputs. They find bugs; they are not proofs. A "—" in the theorem column means none is recorded here, not that the IP is untested. ## All IPs ### Compute accelerators & CPUs | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**BitNet b1.58**](BitNet.md) | LLM inference accelerator with Lean proofs about its pure spec (not a source→IR proof of the whole design). Ternary weights, Q16.16 datapath, dual architecture (1-cycle vs 12-cycle). Standalone [FPGA fit + LTL investigation](BitNet_FPGA_Status.md) | 60+ theorems | Full | 202K / 99K cells | | [**YOLOv8n-WorldV2**](YOLOv8.md) | Open-vocabulary object detection. INT4/INT8 quantized, 15 modules, CLIP text embeddings | Golden validation | Full | Backbone + Neck + Head | | [**RV32IMA SoC**](RV32.md) | RISC-V CPU — boots Linux 6.6.0. 4-stage pipeline, Sv32 MMU, UART, CLINT. JIT at 14.2M cyc/s (1.63x Verilator). 102 formal proofs | 102 theorems | Full | 122 registers | | [**SV→Sparkle Transpiler**](RV32.md#svsparkle-transpiler) | Parse Verilog → JIT simulation. LiteX SoC at 18.1M cyc/s (1.72x Verilator). Reverse synthesis with an equivalence proof of the transformation (2.14x speedup, zero sorry). 8-core parallel 11.9x Verilator. Timer oracle 9,900x. `OracleReduction` type class, 44 tests | 20+ theorems | JIT | 44 tests | ### [Networking stack](Networking.md) (new — PR #66) Full UART → SLIP → IPv4 → TCP → HTTP round-trip, live on Tang Nano 50K. `lake exe usb-webserver-jit-test` runs a GET request end-to-end in seconds. See [`docs/ip-catalog/Networking.md`](Networking.md) for the full layer-stack breakdown, bring-up notes, and sim entry points. | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**UART / SLIP**](../../IP/Net/UART.lean) | 8-N-1 UART RX/TX (configurable `bitDiv`) + RFC 1055 SLIP framer/deframer. Bring-up doc for Tang Nano 50K | — | Full | LUT 2% | | [**IPv4 / ARP / ICMP**](../../IP/Net/IPv4.lean) | RFC 791 IPv4 parser + emitter, ARP requester + responder, ICMP echo. Byte-exact against reference | 5+ theorems | Full | iverilog round-trip | | [**TCP**](../../IP/Net/TCP.lean) | Header + connection state machine + loopback. Includes retransmit / dup-ACK path | 3 theorems | Full | Cycle-accurate sim | | [**HTTP/1.0**](../../IP/Net/HTTP.lean) | Emitter + parser + iverilog loopback (`gotRequest` at cycle 48 in sim) | — | Full | GET/POST | | [**USB Web server**](../../IP/Net/UsbWebServer.lean) | End-to-end pipeline (UART→SLIP→IPv4→TCP→HTTP and back). Emits `HTTP/1.0 200 OK\r\n\r\nHello, Sparkle!` on any `GET` | — | Full | Tang Nano 50K, LUT 2%, BRAM 0% | | [**memcached ASCII server**](../../IP/Net/MemcachedServer.lean) | Tier-1 (`get` / `set` / `add` / `delete`, key ≤ 8 B / value ≤ 16 B), BRAM-backed KV store + byte-stream FSM. Byte-exact against Lean reference oracle | 2 theorems | Full | LUT 1% / BRAM 25% / Fmax ≈ 57 MHz | | [**Ethernet framing**](../../IP/Net/Ethernet.lean) | MAC framer + RX / TX header extract + payload streaming. DMAC / SMAC / EtherType recovery cycle-accurate | — | Full | iverilog round-trip | | [**CRC32**](../../IP/Net/CRC32.lean) | Bit-serial IEEE 802.3 CRC-32 engine. Reference vs HW parity checked in `crc32-jit-test` | — | Full | 1 byte / cycle | ### Control & estimation (new — PR #109) | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**Control suite**](Control.md) | PID (anti-windup), LQR, IIR biquads at swept precisions, steady-state Kalman + H∞ (same RTL, different constants), time-varying Kalman with on-chip Riccati + width-generic Q divider | ℝ Lyapunov / ISS / dissipation certificates transported to fixed point (Mathlib sidecar `proofs/`, zero `sorry`) | Full (+ iverilog & JIT co-sim) | Tutorial [Ch 12](../tutorial/md/Ch12_ControlPrecision.md) | The stability story: design over ℝ, prove `V(x⁺) ≤ ρ·V(x)` with Mathlib, treat quantization as a bounded disturbance (ISS), and get an unbounded kernel-checked ultimate bound on the *integer* datapath — plus the counterexample (a naively quantized resonator whose emitted Verilog sustains a period-6 limit cycle). Precision selection is a theorem (`Vbound f = c/4^f`; 13 fractional bits is exactly the threshold for the demo budget). The ℝ⇒Float falsification front-end (`proofs/SparkleProofs/Retype/`, via [retype](https://github.com/Verilean/retype)) kills wrong certificate candidates in milliseconds before any `nlinarith` time is spent. ### Bus & interconnect | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**AXI4-Lite Bus**](RV32.md) | AXI4-Lite slave/master with proofs about its protocol model. Protocol compliance (valid persistence, deadlock-free), synthesizable | 14 theorems | Full | 23 sim tests | | [**AXI4 Full**](../../IP/Bus/AXI4/) | Multi-beat burst read/write + interleaving | — | Full | tested against RV32 SoC | | [**PCIe TLP**](../../IP/Bus/PCIe.lean) | Header emit + parse (Memory Read/Write, config space) + HFT loopback structural check | — | Full | 12-byte TLP round-trip | | [**CAN / CAN-FD / CANopen / DroneCAN**](../../IP/Bus/CAN.lean) | Automotive bus stack (bit-stuffing, CRC, arbitration, error frames). DroneCAN HW node included | — | Full | serial-bus / avionics-bus tests | | [**LIN / I²C / SPI**](../../IP/Bus/LIN.lean) | Master + slave HW for the common embedded serial protocols | — | Full | `serial-bus-test` | | [**SBUS / CRSF**](../../IP/Bus/SBUS.lean) | Radio-control receiver protocols (drone control links) | — | Full | drone bring-up | | [**MIL-STD-1553B**](../../IP/Bus/MIL1553.lean) | Avionics dual-redundant bus (Manchester encode/decode, RT/BC/BM) | — | Full | `avionics-bus-test` | ### Crypto & wallets | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**AES / AES-GCM / GHASH**](../../IP/Crypto/Codec/AES.lean) | AES-128/192/256 + GCM AEAD + hardware GHASH. Byte-exact against NIST test vectors | — | Full | `ghash-hw-test`, hardware GF(2¹²⁸) | | [**SHA-256 / SHA-512 / Keccak-256**](../../IP/Crypto/SHA256.lean) | Byte-exact hash primitives + HW pipeline (SHA-256) | — | Sim + HW SHA-256 | NIST vectors | | [**Ed25519 / X25519**](../../IP/Crypto/Proof/Ed25519Sign.lean) | Ed25519 sign/verify + X25519 scalar mult (RFC 7748). Field theorems | 5+ theorems | Sim + **HW signer** | RFC 8032 vectors | | [**P-256 / secp256k1 ECDSA**](../../IP/Crypto/Proof/P256ECDSA.lean) | NIST P-256 + secp256k1 ECDSA (Bitcoin/Ethereum curve) | — | Sim + **HW signer** | wycheproof | | [**HW signers (secp256k1 / BLS12-381 / Ed25519)**](../../IP/Crypto/Secp256k1ECDSAHW.lean) | Security-focused HW **signing** datapaths — key never leaves the chip. Bit-serial field mul → projective/extended point-op → scalar-mul ladder → sign FSM; Fp381 Montgomery mul (blst `mul_mont_384` analogue). Hash/nonce are host inputs | — | Full (sim + `#synthesizeVerilog`) | secp256k1 matches SEC1/RFC-6979 vector; BLS G2 sign; Ed25519 RFC 8032 | | [**ECDSA signing demo (Tang Nano 50K)**](EcdsaSignDemo.md) | Flashable top-level: send `d‖k‖z` (96 B) over UART, get `r‖s` (64 B) back. Full closed-loop secp256k1 signer + UART. ≈ 67 ms/sign @ 27 MHz | — | Full (`#synthesizeVerilog`) | Tang Nano 50K; dataflow matches SEC1/RFC-6979 | | [**Policy-enforcing signer (Tang Nano 50K)**](PolicySignDemo.md) | Security device: hashes the tx **on-chip** (Keccak-256 sponge), checks recipient/amount against an **on-chip policy** sliced from the same bytes, signs **only if policy passes** — else returns a reject byte. Key never leaves the chip AND a compromised host can't sign attacker-chosen tx | — | Full (`#synthesizeVerilog` + iverilog) | Tang Nano 50K; dataflow matches Keccak-256 / SEC1 / policy | | [**RSA-PSS**](../../IP/Crypto/Codec/RSAPSS.lean) | RSA signature verify (PKCS #1 v2.2 PSS) | — | Sim | webPKI test set | | [**HKDF**](../../IP/Crypto/Codec/HKDF.lean) | RFC 5869 HKDF extract + expand (SHA-256 backend) | — | Sim | TLS 1.3 dep | | [**Ethereum wallet stack**](../../IP/Crypto/Codec/EthWallet.lean) | BIP-32 / BIP-39 seed + HD wallet, RLP encoder, EIP-1559 tx, ERC-20 ABI | — | Sim | Byte-exact vs reference clients | ### Security (TLS 1.3) | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**TLS 1.3**](../../IP/TLS/Client.lean) | Full TLS 1.3 client + server (record layer, handshake, key schedule, X.509 verify). AES-128-GCM + Ed25519 cipher suite | 3 theorems | Sim | Interop vs OpenSSL fixtures | | [**HTTPS demo**](../../IP/Net/HFTOverTLS.lean) | HFT-over-TLS transport (TCP + TLS + custom framing) | — | Sim | Loopback demo | ### Zero-knowledge | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**Merkle tree / polynomial commitment**](../../IP/Crypto/Proof/Merkle.lean) | Merkle-tree opening + polynomial evaluation with 8 honest openings round-trip | — | Sim | `polynomial-test`, `merkle-test` | | [**Mini-STARK verifier**](../../IP/Crypto/Proof/MiniSTARK.lean) | STARK proof verify (Goldilocks field, FRI, low-degree extension) | — | Sim | 8-opening verifier | | [**Goldilocks field**](../../IP/Crypto/Proof/Goldilocks.lean) | p = 2⁶⁴ − 2³² + 1 field arithmetic | — | Sim | STARK dep | ### Video | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**H.264 Codec**](H264.md) | Baseline Profile encoder + decoder. Hardware MP4 muxer produces playable files. CAVLC now byte-exact vs Lean reference for all 4×4 blocks (fixed in PR #66) | 15+ theorems | Full | 709-byte MP4 output | ### Verified infrastructure | IP | Description | Lean theorems (spec / model) | Synth | Details | |----|-------------|:------:|:-----:|---------| | [**CDC Infrastructure**](../architecture/CDC.md) | Lock-free multi-clock simulation. SPSC queue (210M ops/sec), rollback, 8-core parallel runner (3.87x on 8 cores). Since PR #66, dispatches through the JIT vtable — no more per-symbol dlsym (`Issue #70`) | 12 theorems | C | N-thread parallel | | [**Drone SoC (bring-up)**](Drone_SoC_Status.md) | Multi-IP drone/humanoid SoC status pages (DroneCAN + SBUS + CRSF wired to RV32) | | Status page | — | | [**Humanoid SoC (bring-up)**](Humanoid_SoC_Status.md) | Sensor / actuator bus fabric for humanoid platform | | Status page | — |