\thispagestyle{plain} \noindent \begin{tikzpicture} \node[fill=fnDark,text=white,rounded corners=2pt,inner sep=6pt, minimum width=\textwidth,anchor=west] {\large\bfseries FPGA-Neural --- General description and features}; \end{tikzpicture} \vspace{6pt} \noindent {\small FPGA-Neural is a \textbf{parametric hardware accelerator for feed-forward neural networks} contained entirely within the FPGA. Computation (multiplication, accumulation, bias, activation, saturation) takes place entirely on-chip in INT8/INT32 integer arithmetic; the host system only provides configuration, weights, input data and control through a simple SPI interface, without ever being part of the computational datapath. A single bitstream serves any topology up to the build maximum.} \vspace{8pt} \begin{multicols}{2} {\color{fnDark}\large\bfseries Features}\\[2pt] {\footnotesize \begin{itemize}[leftmargin=1.1em] \item \textbf{INT8 $\times$ INT8 $\to$ INT16 $\to$ INT32} datapath, 32-bit accumulation with sign extension. \item \textbf{Balanced binary adder tree} ($O(\log_2 \text{PARALLEL})$) instead of linear reduction. \item Configurable parallel MAC: \code{PARALLEL} simultaneous hardware MACs per neuron, mapped onto \code{MULT18X18D} DSPs. \item Fully \textbf{parametric} architecture: \code{N\_INPUTS}, \code{N\_NEURONS}, \code{PARALLEL}, \code{DATA\_WIDTH}, \code{ACC\_WIDTH}, \code{N\_LAYERS}. \item \textbf{Runtime network width}: per-layer \code{n\_inputs\_real}/\code{n\_neurons\_real}, a single bitstream for every topology up to the maximum. \item Configurable activations: \code{ACT\_RELU} (default) and \code{ACT\_NONE} (linear with bilateral saturation), with INT8 saturation. \item \textbf{Two network types}: classic multi-layer dense (\code{layer\_sequencer}, ping-pong buffers) and \textbf{arbitrary sparse graph} (\code{graph\_engine} + activation buffer in \code{DP16KD} block RAM), selectable at runtime. \item \textbf{Dedicated memory} subsystem: byte$\leftrightarrow$word interface, asynchronous parallel PSRAM controller with \textbf{page mode} (70~ns random access, 20~ns page burst), 8~MB addressable (23~bit). \item \textbf{SPI Mode 0} MSB-first host interface, \code{SET\_NET\_TYPE}+dispatch, \code{STATUS.done} sticky/clear-on-read, runtime \code{READ\_CONFIG}. \item \textbf{Flash subsystem} for boot/persistence: FPGA-exclusive access to a \code{W25Q128JV} SPI NOR (16~MB) via a dedicated SPI master, a flash$\leftrightarrow$PSRAM copy engine, and a 16-slot catalog with CRC32, 8 host opcodes. \item Verified in \textbf{simulation} (Icarus Verilog) and \textbf{real synthesis} (Yosys + nextpnr-ecp5 + ecppack). \end{itemize}} \columnbreak {\color{fnDark}\large\bfseries Applications}\\[2pt] {\footnotesize \begin{itemize}[leftmargin=1.1em] \item Deterministic low-latency inference as a peripheral of a Linux SoC, Raspberry-Pi-like board, ESP32, microcontrollers. \item Reusable hardware block integrable into heterogeneous projects (a platform, not a single network). \item Edge AI on compact dense INT8-quantized networks. \item Off-loading the neural workload from the host CPU to dedicated hardware with predictable throughput. \end{itemize}} \vspace{4pt} {\color{fnDark}\large\bfseries Target \& toolchain}\\[2pt] {\footnotesize \begin{itemize}[leftmargin=1.1em] \item FPGA: Lattice ECP5 \code{LFE5U-45F-8BG381C} ($-8$, CABGA381). \item Synthesis: Yosys; place\&route: nextpnr-ecp5; bitstream: Project~Trellis (\code{ecppack}). \item Simulation: Icarus Verilog (\code{-g2012}). \item PSRAM: ISSI \code{IS66WVE4M16EBLL-70BLI} (64\,Mb, 4M$\times$16). \end{itemize}} \end{multicols} \vspace{2pt} % --- key parameter table --- \noindent {\small\color{fnDark}\bfseries Key parameters (characterized baseline configuration)} \vspace{2pt} \noindent \begin{tabularx}{\textwidth}{L{3.2cm}L{3.6cm}Y} \toprule \rowh \thd{Quantity} & \thd{Value} & \thd{Notes} \\ \midrule Data precision & INT8 (signed) & \code{DATA\_WIDTH}=8 \\ \rowa Accumulator & INT32 (signed) & \code{ACC\_WIDTH}=32 \\ Inputs / neurons & 256 / 4 & datapath benchmark baseline \\ \rowa Simultaneous MACs & $2\ldots64$ & $=$\code{PARALLEL}$\times$\code{N\_NEURONS} \\ Activations & ReLU, linear & \code{ACT\_RELU} / \code{ACT\_NONE} \\ \rowa Fmax (P=2, datapath) & 87.88~MHz & isolated datapath benchmark \\ Fmax (P=2, integrated system) & 67.91~MHz & full system incl. flash subsystem, real place\&route \\ MAC throughput (P=16) & $\approx$3.34~G\,MAC/s & theoretical, datapath only \\ \rowa Working memory & 8~MB PSRAM & 16-bit parallel bus, 70~ns / 20~ns page mode \\ Address space & 23~bit (byte) & \code{ADDR\_WIDTH}=23 \\ \bottomrule \end{tabularx} \vspace{8pt} \noindent {\small\color{fnDark}\bfseries System block diagram} \begin{center} \begin{tikzpicture}[node distance=6mm and 10mm,font=\footnotesize] \node[fnblockD,minimum width=26mm,minimum height=13mm] (host){HOST\\{\scriptsize configures / trains / controls}}; \node[fnblockT,right=16mm of host,minimum width=52mm,minimum height=22mm] (eng){}; \node[anchor=north,font=\footnotesize\bfseries,text=fnDark] at (eng.north){FPGA -- Neural Network Engine}; \node[fnreg,fill=white] (spi) at ([yshift=-2mm]eng.center){\code{spi\_slave} + \code{spi\_engine}}; \node[fnreg,fill=white,below=2.5mm of spi] (arb){\code{mem\_arbiter} + \code{layer\_sequencer}}; \node[fnreg,fill=white,above=2.5mm of spi] (core){\code{neuron\_memory} $\to$ \code{neuron\_parallel} $\to$ \code{mac8}}; \node[fnblock,right=16mm of eng,minimum width=24mm,minimum height=13mm] (ram){PSRAM 8\,MB\\{\scriptsize \code{psram\_controller}}}; \draw[fnbus] (host) -- node[fnlbl,above]{SPI} (eng.west|-host); \draw[fnbus] (eng.east|-ram) -- node[fnlbl,above]{16-bit async} (ram); \end{tikzpicture} \end{center} \begin{center}\footnotesize\itshape\color{fnGrey} The neural datapath is entirely inside the FPGA; the host does not take part in the individual MAC operations.\end{center}