Files
FPGA-Neural-Datasheet/chapters/11-registers.tex
T
micheleandClaude Sonnet 5 07f8ec0460 docs: consolidate all V2 datasheets into one current, complete document
The repository had accumulated multiple, contradictory "current state"
documents for V2 hardware: an old V1 IT/EN datasheet copy nested inside
hardware/v2/docs/datasheet/, a stray untracked duplicate at repo root
(docs/DatasheetLatex/), and a second, much older documentation track
(hardware/v2/docs/*.md: PRE_PCB_VERIFICATION.md, PRE_PCB_CLOSURE_4POINT.md,
MEMORY_UPGRADE_64MB_N8.md, and 10 more) describing an earlier PSRAM/
N_SLOTS<=2 milestone alongside the real, current SDRAM/N_SLOTS=4 board.
The LaTeX datasheet's own front matter (features/pinout cover pages) and
chapter 9 (benchmarks) were themselves still describing that obsolete
architecture, contradicting the real, current chapters 5/7/10 elsewhere
in the same document.

This commit:
- Flattens hardware/v2/docs/datasheet/files/docs/datasheet/v2-en/* up to
  hardware/v2/docs/datasheet/ (was 4 levels of redundant nesting).
- Removes the old V1 IT/EN LaTeX copies and the stray root-level
  duplicate entirely (recoverable from git history, not from disk).
- Preserves the real component reference PDFs (ECP5 eval board, ISSI
  PSRAM, programming cables) under datasheet/references/.
- Removes 13 superseded hardware/v2/docs/*.md status documents after
  folding every real, unique fact they contained into the datasheet:
  SPI max verified clock (12MHz, exact 12.8MHz CDC edge), SDRAM directed
  boundary test (21/21 PASS), 16MHz oscillator MPN (ECS-3225MV-160-BN-TR),
  and the real FPGA<->SDRAM ball mapping cross-check.
- Rewrites the datasheet's own front matter, ch.4 (parameters), ch.8
  (top-level module -- was documenting the wrong, non-physical top
  entirely), and ch.9 (benchmarks) to describe the current, real SDRAM/
  N_SLOTS=4 production board, while keeping the real PSRAM-era chapters
  as clearly-labeled history rather than deleting correctly-measured
  work.
- Fixes a title-page tikzpicture that was clipped off the page edge
  (pre-existing, unrelated to this change) by scaling it to fit.

Net: 85 files changed, -8814/+498 lines. hardware/v2/docs/ now contains
exactly one current datasheet plus FIRST_POWER_ON.md (a bring-up
runbook, not a duplicate spec).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xXuuRUWZScuo1DeYJxs3v
2026-09-09 00:41:06 +02:00

87 lines
4.6 KiB
TeX

\chapter{Register-level interface \& internal state encodings}
\label{ch:regs}
\begin{fnwarn}[Real SPI opcode map exists; state encodings below are
per-module reference]
Ch.~\ref{ch:host} now documents V2's real, physical SPI opcode map
(\code{WRITE\_JOB}/\code{WRITE\_MEM}/\code{READ\_MEM}/\code{STATUS}/
\code{RESET}) --- this chapter's own node-registration field layout
below remains the logical field reference (repeated here for quick
reference). The \textbf{internal FSM state encodings} below are useful
for simulation-level debug; \S\S\ref{ch:regs}'s Dependency
Manager/Neural Director tables are shared by every V2 architecture
(unchanged between the PSRAM-era and current SDRAM boards). The Memory
Manager and Neural Processor tables were captured from the PSRAM-era
\code{memory\_manager.v}/\code{neural\_processor.v} pairing (ch.~\ref{ch:arch})
--- the current SDRAM board's \code{nms\_memory\_manager\_stream\_wide.v}
implements the same functional handshake (prefetch $\to$ stream $\to$
write-back $\to$ done) against the SDRAM backend instead of PSRAM, but
its own internal state encoding was not re-transcribed into this table.
\end{fnwarn}
\section{Node registration fields (quick reference)}
See ch.~\ref{ch:host} for the full field-level description.
\code{reg\_node\_id}, \code{reg\_required}, \code{reg\_producer\_ids},
\code{reg\_x\_base}, \code{reg\_w\_base}, \code{reg\_n\_tiles},
\code{reg\_result\_addr} --- valid/ready handshake, \code{reg\_ready}
gated on the target node id's table slot being \code{EMPTY}.
\section{Dependency Manager node state (\texttt{node\_state})}
\begin{tabularx}{\textwidth}{C{1.4cm} L{2.6cm} Y}
\toprule
\rowh \thd{Value} & \thd{Name} & \thd{Meaning} \\
\midrule
\op{2'd0} & \code{ST\_EMPTY} & Table slot free; \code{reg\_ready} asserted for this node id. \\
\rowa \op{2'd1} & \code{ST\_WAITING} & Registered, at least one producer not yet resolved. \\
\op{2'd2} & \code{ST\_READY} & All producers resolved; eligible for dispatch. \\
\rowa \op{2'd3} & \code{ST\_DISPATCHED} & Handed to the Director; \textbf{terminal} (\S\ref{ch:sched}). \\
\bottomrule
\end{tabularx}
\section{Neural Director state (\texttt{dir\_state})}
\begin{tabularx}{\textwidth}{C{1.4cm} L{2.6cm} Y}
\toprule
\rowh \thd{Value} & \thd{Name} & \thd{Meaning} \\
\midrule
\op{4'd0} & \code{DIR\_IDLE} & Reset/startup. \\
\rowa \op{4'd1} & \code{DIR\_SCAN\_READY} & Checking whether a queued job and a free slot both exist. \\
\op{4'd2} & \code{DIR\_ALLOCATE} & Dispatching the head-of-queue job to the first free slot. \\
\rowa \op{4'd3} & \code{DIR\_ERROR} & Recoverable only via reset (an isolated fault never blocks other slots). \\
\bottomrule
\end{tabularx}
\section{Memory Manager state (\texttt{state})}
\begin{tabularx}{\textwidth}{C{1.4cm} L{3.0cm} Y}
\toprule
\rowh \thd{Value} & \thd{Name} & \thd{Meaning} \\
\midrule
\op{3'd0} & \code{MM\_IDLE} & Waiting for \code{job\_start}. \\
\rowa \op{3'd1} & \code{MM\_PREFETCH\_FIRST} & Waiting for tile~0's activation \emph{and} weight halves to both arrive. \\
\op{3'd2} & \code{MM\_STREAM} & Presenting tiles to the Neural Processor, double-buffering the next one. \\
\rowa \op{3'd3} & \code{MM\_WAIT\_RESULT} & Last tile handed off; waiting for the Neural Processor's own result. \\
\op{3'd4} & \code{MM\_WRITE\_RESULT} & Issuing the real PSRAM word write for the INT8 result. \\
\rowa \op{3'd5} & \code{MM\_DONE} & Waiting for the write's own \code{mem\_ready}; then pulses \code{job\_done}. \\
\bottomrule
\end{tabularx}
\section{Neural Processor state (\texttt{np\_state})}
\begin{tabularx}{\textwidth}{C{1.4cm} L{2.8cm} Y}
\toprule
\rowh \thd{Value} & \thd{Name} & \thd{Meaning} \\
\midrule
\op{4'd0} & \code{NP\_IDLE} & No job in flight. \\
\rowa \op{4'd1} & \code{NP\_LOAD\_JOB} & Latching \code{job\_bias}/\code{job\_activation}, clearing the accumulator. \\
\op{4'd2} & \code{NP\_WAIT\_OPERANDS} & Consuming tiles as they arrive (absorbs the per-tile MAC/accumulate/next-tile sequence). \\
\rowa \op{4'd3} & \code{NP\_FINISH} & Draining the pipeline after \code{tile\_last}. \\
\op{4'd4} & \code{NP\_WRITE\_RESULT} & Result available for the Memory Manager to consume. \\
\rowa \op{4'd5} & \code{NP\_DONE} & Job complete. \\
\op{4'd6} & \code{NP\_ERROR} & Reachable only via an unreachable \code{default} case --- isolated per-processor, never blocks other slots. \\
\bottomrule
\end{tabularx}
\section{Slot Memory Arbiter owner encoding}
\code{owner} is \code{0} for ``no port granted'', or (port index $+1$)
for the currently-granted port --- indices \code{0..N\_SLOTS-1} are the
per-slot Memory Managers' own weight/write-back traffic; index
\code{N\_SLOTS} is the shared Activation Cache's own traffic.