Skip to content

About

Auditable browser-native Verilog RTL resource estimation & FPGA development board selector

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FPGA Selector (v2 β€” Reviewer-Hardened Rebuild)

Live Demo Build & Test React 18 TypeScript Tailwind CSS License: MIT

πŸ”— Live Application: https://fpga-selector-v2.netlify.app
πŸ“¦ GitHub Repository: https://github.com/Hazz-Y/fpga-selector

A zero-install, browser-native platform that parses Verilog RTL, statically estimates FPGA resource utilization (LUTs, Flip-Flops, I/Os, DSPs, Block RAM) with full provenance tracing, and ranks real, purchasable FPGA development boards via an auditable non-linear suitability formula.


⚑ Key Highlights

  • πŸš€ 100% Client-Side & Zero-Install: Instant analysis in any modern web browser β€” no synthesis tool licenses, EDA installations, or backend cloud dependencies required.
  • πŸ”¬ Deterministic Heuristics with Provenance: Every resource count links directly to the specific Verilog construct, source file line number, rule name, and architectural rationale.
  • πŸ“‹ Curated Development Board Catalog: Over 18 commercial development boards from AMD/Xilinx, Intel/Altera, Lattice Semiconductor, and Microchip with comprehensive board-level specifications (DRAM, Flash, Transceivers, Power, I/O headers).
  • βš–οΈ Auditable Suitability Scoring: Ranks development boards using geometric-mean resource fit, cost normalization, bottleneck penalties, and headroom efficiency penalties with deterministic tie-breaking.
  • πŸŽ›οΈ Live Sensitivity Analysis: Interactive sliders allow hardware designers to adjust scoring weights in real time and immediately see re-ranked results without re-parsing.
  • πŸ§ͺ 25+ Validation Benchmark Suite: Unit-tested against hand-derived standard hardware blocks (ALUs, FSMs, FIR filters, UARTs, MAC units, Multipliers, Block RAMs) with documented accuracy.

πŸ—οΈ Architecture & Engine Pipeline

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                    User Verilog RTL Source                  β”‚
  β”‚            (Multi-file upload, tabbed code editor)          β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                 Tokenizer & Lexer (lexer.ts)                β”‚
  β”‚     Token stream: keywords, ports, regs, operators, commentsβ”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                 AST Parser (parser.ts)                      β”‚
  β”‚     Extracts modules, port directions/widths, always blocks, β”‚
  β”‚     hierarchical module instantiations, and memory arrays   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚            Estimation Engine (estimator.ts)                 β”‚
  β”‚     Applies rules from estimationRules.ts (Single Truth)    β”‚
  β”‚     Computes LUT, FF, I/O, DSP48, BRAM + Provenance Trace   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚            Scoring & Ranking Engine (scoring.ts)            β”‚
  β”‚     Geometric mean resource fit + cost + bottleneck penalty β”‚
  β”‚     Hard infeasibility filter + Sensitivity sliders         β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚               Interactive Web UI (React + Tailwind)         β”‚
  β”‚  β€’ Analyzer (Editor, Charts, Breakdown, Provenance Trace)   β”‚
  β”‚  β€’ Recommendations (Board Cards, Sensitivity Sliders)       β”‚
  β”‚  β€’ Methodology (Live Config Tables & Formulas)              β”‚
  β”‚  β€’ Board Browser (Filterable/Searchable Board Catalog)      β”‚
  β”‚  β€’ History (LocalStorage Session Restoration)               β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Estimation Rules & Mathematical Foundations

All estimation coefficients are centralized in src/engine/estimationRules.ts and rendered dynamically on the Methodology page to ensure zero documentation drift.

1. LUT Estimation (6-LUT Baseline Architecture)

  • Bitwise Logic (&, |, ^, ~^): $1.0\text{ LUT per bit}$
  • Adders & Subtractors (+, -): $\lceil N \times 1.0 \rceil\text{ LUTs}$ (dedicated fast-carry logic)
  • Small Multipliers (* when $< 8\text{ bits}$): $\lceil N^{1.5} \rceil\text{ LUTs}$
  • Ternary / Multiplexers (sel ? a : b, if/else): $2.0\text{ LUTs per node}$
  • Case Statements: $K \times \lceil\log_2(N)\rceil\text{ LUTs}$
  • Comparators (==, <, >, etc.): $\lceil N \times 0.5 \rceil\text{ LUTs}$
  • Inverters / Buffers (~, !): $0\text{ LUTs}$ (absorbed into adjacent LUT inputs)

2. Sequential & Dedicated Primitives

  • Flip-Flops: $1.0\text{ FF per bit}$ in @(posedge clk) blocks; $\lceil\log_2(\text{states})\rceil\text{ FFs}$ for FSM state registers.
  • DSP Slices: Inferred when multiplier operands $\ge 8\text{ bits}$ or when clocked MAC ($acc \leftarrow acc + a \times b$) is identified.
  • Block RAM: Array depth $\ge 64$ entries $\rightarrow \lceil\frac{W \times D}{1024 \times 18}\rceil\text{ blocks of 18Kb}$.
  • Distributed RAM: Array depth $&lt; 64$ entries $\rightarrow \lceil\frac{W \times D}{6}\rceil\text{ LUTs}$.

3. Non-Linear Suitability Formula

For design estimate $E$ and board capacity $C$:

$$\text{fit}_i = \min\left(1.0, \frac{C_i}{\max(E_i, \epsilon)}\right)$$

$$\text{ResourceScore} = \left(\prod_{i \in {\text{LUT, FF, IO, DSP, BRAM}}} \text{fit}_i\right)^{1/5}$$

$$\text{CostScore} = 1.0 - \frac{\text{Price}_{\text{avg}} - \text{Price}_{\min}}{\text{Price}_{\max} - \text{Price}_{\min} + \epsilon}$$

$$\text{EfficiencyPenalty} = k_{\text{efficiency}} \times \max(0, \text{ResourceScore} - \text{TargetHeadroom})$$

$$S = \operatorname{clamp}\left(0, 1, w_{\text{fit}} \cdot \text{ResourceScore} + w_{\text{cost}} \cdot \text{CostScore} + w_{\text{bottleneck}} \cdot \text{BottleneckPenalty} - \text{EfficiencyPenalty}\right)$$


πŸ› οΈ Board Catalog Overview

Includes 18 commercial FPGA development boards with full specs:

Board Vendor FPGA Family Logic Cells / LUTs On-board RAM Approx Price Key Interfaces
Digilent Basys 3 AMD/Xilinx Artix-7 33,280 β€” $130–$150 USB-JTAG, VGA, Pmod
Digilent Arty A7-35T AMD/Xilinx Artix-7 33,280 256MB DDR3L $129–$149 10/100 Ethernet, Arduino, Pmod
Digilent Arty A7-100T AMD/Xilinx Artix-7 101,440 256MB DDR3L $249–$279 10/100 Ethernet, Arduino, Pmod
Digilent Nexys A7-100T AMD/Xilinx Artix-7 101,440 128MB DDR2 $410–$450 Ethernet, VGA, MicroSD, Audio, Pmod
Digilent Cmod A7-35T AMD/Xilinx Artix-7 33,280 512KB SRAM $79–$89 DIP-48 form factor, USB-UART
Xilinx Kintex-7 KC705 AMD/Xilinx Kintex-7 203,800 1GB DDR3 $1,695–$1,895 PCIe Gen2 x8, SFP+, FMC-HPC, HDMI
Terasic DE10-Lite Intel/Altera MAX 10 49,760 64MB SDRAM $55–$75 VGA, 7-Seg, Arduino, Accelerometer
Terasic DE10-Nano Intel/Altera Cyclone V SE (SoC) 110,000 1GB DDR3 $130–$160 Dual Cortex-A9, HDMI, Gigabit Ethernet
Terasic DE1-SoC Intel/Altera Cyclone V SX (SoC) 85,000 1GB DDR3 $225–$275 Dual Cortex-A9, VGA, Audio CODEC, GPIO
Lattice ECP5-5G Eval Lattice ECP5-5G 84,000 β€” $199–$249 5Gbps SERDES, PCIe, Dual Gigabit Ethernet
Lattice iCEstick Lattice iCE40HX 1,280 β€” $25–$35 USB thumb drive, IrDA, Pmod
Lattice ULX3S Lattice ECP5 84,000 32MB SDRAM $99–$139 HDMI/DVI, MicroSD, ESP32, USB-OTG
Lattice MachXO3L Starter Lattice MachXO3L 9,400 β€” $49–$69 On-chip flash, low-power I/O
Microchip PolarFire Eval Microchip PolarFire 12,500 4GB DDR4 $199–$249 Non-volatile, Low Power, PCIe x4, SFP+
Digilent Genesys 2 AMD/Xilinx Kintex-7 203,800 1GB DDR3 $1,195–$1,395 DisplayPort, HDMI, FMC-HPC, USB 2.0

πŸ§ͺ Validation & Benchmark Test Suite

The test harness in src/engine/__tests__/estimator.test.ts executes 29 automated tests covering:

  • TC01–TC20: Standard building blocks (trivial modules, bitwise logic, adders, shift registers, FSMs, small/large multipliers, distributed RAM, block RAM).
  • TC21–TC25: Large complex hardware designs ($\ge 1,000\text{ to }20,000\text{ LUTs}$) including 32-bit multi-op ALUs, 16-bit multiply-accumulate units, 8-stage 32-bit pipelines, 16-tap FIR filters, and 16-state FSM processors.
  • Scoring Engine Tests: Feasibility filtering, total score normalization, deterministic tie-breaking, and extreme boundary conditions.

Run tests locally:

npm test

πŸš€ Getting Started Locally

Prerequisites

  • Node.js $\ge 18.0.0$
  • npm $\ge 9.0.0$

Installation & Development

# Clone repository
git clone https://github.com/Hazz-Y/fpga-selector.git
cd fpga-selector

# Install dependencies
npm install

# Start local Vite development server
npm run dev

# Run unit tests
npm test

# Build production bundle
npm run build

πŸ“‘ Reviewer Feedback & Hardening Checklist

This v2 rebuild addresses all methodological gaps identified during peer review:

Reviewer Comment Resolution in v2 Implementation Location
Board vs. Bare Chip Added boardLevelSpecs (DRAM, Flash, Transceivers, Power) and Board/Chip view toggle src/data/boardCatalog.ts, src/pages/Recommendations.tsx
Sensitivity Analysis Built real-time sensitivity sliders to inspect score variation under different weights src/components/SensitivitySliders.tsx
Auditable Methodology Methodology page dynamically imports constants from code config (zero doc drift) src/pages/Methodology.tsx, src/engine/estimationRules.ts
Provenance Traceability Per-construct line-level trace table with resource delta badges src/components/ProvenancePanel.tsx
Non-Linear Scoring Formulated geometric-mean resource fit + bottleneck penalty + tie-breaking src/engine/scoring.ts
Scalable Benchmarks Added 25+ automated reference test cases including 1K–20K LUT designs src/engine/__tests__/estimator.test.ts

πŸ“„ License

This project is licensed under the MIT License.

About

Auditable browser-native Verilog RTL resource estimation & FPGA development board selector

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages