\chapter{Quick reference} \label{ch:ref} \section{SPI opcodes} \begin{tabularx}{\textwidth}{C{1.4cm} L{3.2cm} C{2.4cm} Y} \toprule \rowh \thd{Value} & \thd{Name} & \thd{Response} & \thd{Summary} \\ \midrule \op{0x00} & NOP & --- & idle \\ \rowa \op{0x01} & WRITE\_RAM & --- & PSRAM block write \\ \op{0x02} & READ\_RAM & \code{len} B & PSRAM block read \\ \rowa \op{0x0F} & RESET & --- & engine reset + STATUS latch \\ \op{0x10} & SET\_BASE & --- & set base/register (sel 0..10) \\ \rowa \op{0x20} & START & --- & single-layer start \\ \op{0x21} & STATUS & 1 B & busy(live)/done(sticky) \\ \rowa \op{0x22} & READ\_OUTPUT & N\_NEURONS B & \code{y\_bus} \\ \op{0x23} & RUN\_NETWORK & --- & multi-layer start \\ \rowa \op{0x30} & READ\_CONFIG & 11 B & configuration record \\ \bottomrule \end{tabularx} \section{STATUS byte} \begin{center} \begin{tikzpicture}[font=\scriptsize] \foreach \i/\lbl [count=\x from 0] in {7/0,6/0,5/0,4/0,3/0,2/0,1/{done},0/{busy}}{ \node[fnreg,minimum width=13mm,minimum height=9mm] (b\x) at (\x*13mm,0) {\lbl}; \node[font=\tiny,text=fnGrey,above=0.5mm of b\x] {bit \i}; } \node[fill=fnAmber,text=white,rounded corners=1pt,inner sep=1.5pt,font=\tiny] at (b7.center){reserved = 0}; \node[fill=fnTeal,text=white,rounded corners=1pt,inner sep=1.5pt,font=\tiny] at (b6.center){}; \end{tikzpicture} \end{center} \code{done} is sticky, clear-on-read; \code{busy} is live. \section{SET\_BASE selectors} \begin{multicols}{2}\footnotesize \begin{itemize} \item 0 --- \code{x\_base} \item 1 --- \code{w\_base} \item 2 --- \code{bias\_addr} \item 3 --- \code{table\_base} \item 4 --- \code{buf\_a\_base} \columnbreak \item 5 --- \code{buf\_b\_base} \item 6 --- \code{activation} (single-layer) \item 7 --- \code{n\_inputs\_real} (single-layer) \item 8 --- \code{n\_neurons\_real} (single-layer) \item 9 --- \code{num\_neurons\_graph} (Type \#2) \item 10 --- \code{n\_out} (Type \#2) \end{itemize} \end{multicols} \section{Descriptor table (11 bytes/layer, MSB-first)} \begin{center} \begin{tikzpicture}[font=\scriptsize,node distance=0mm] \node[fnreg,minimum width=20mm,minimum height=8mm](a){\code{w\_base}\\3B}; \node[fnreg,minimum width=20mm,minimum height=8mm,right=0mm of a](b){\code{bias\_addr}\\3B}; \node[fnreg,minimum width=14mm,minimum height=8mm,right=0mm of b](c){\code{act}\\1B}; \node[fnreg,minimum width=22mm,minimum height=8mm,right=0mm of c](d){\code{n\_inputs\_real}\\2B}; \node[fnreg,minimum width=22mm,minimum height=8mm,right=0mm of d](e){\code{n\_neurons\_real}\\2B}; \end{tikzpicture} \end{center} \section{Build parameters} \begin{multicols}{2}\footnotesize \begin{itemize} \item \code{DATA\_WIDTH} --- 8 (INT8) \item \code{ACC\_WIDTH} --- 32 (INT32) \item \code{N\_INPUTS} --- max inputs \item \code{N\_NEURONS} --- max neurons \item \code{PARALLEL} --- simultaneous MACs \columnbreak \item \code{N\_LAYERS} --- max layers \item \code{ADDR\_WIDTH} --- 23 (8 MB) \item \code{MEM\_DATA\_WIDTH} --- 16 \item \code{CLK\_FREQ\_MHZ} --- PSRAM timing \end{itemize} \end{multicols}