Implements M3: three parametric dual-port buffers for the §12 data-plane (Input/Weight/Result), reusing the proven BRAM-inference idiom from the frozen hardware/v1/rtl/act_buffer.v (synchronous write, synchronous REGISTERED read, no reset on the read register -- keeps Yosys off the LUT-RAM path). Verified with Verilator: 10/10 tests pass (write-then-read correctness, extreme INT8 round-tripping, weight_buffer's full 64-bit tile width round-tripping, undisturbed re-reads). Real synthesis at two depths per module (6 configs total): 0 CHECK problems, every configuration correctly infers DP16KD (never LUT-RAM). Non-obvious real finding: weight_buffer's BRAM cost is driven by its P_IN*DATA_WIDTH tile width, not its DEPTH -- an 8x depth reduction (512->64) left DP16KD usage unchanged at 2, while activation_buffer/result_buffer (byte-wide) scale as naively expected (2->1). All default-depth configs PASS at 80MHz with large margin (287-367 MHz) via real nextpnr-ecp5 place&route. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013xXuuRUWZScuo1DeYJxs3v
113 lines
6.4 KiB
Plaintext
113 lines
6.4 KiB
Plaintext
# V2 development log — solo append, mai troncato/sovrascritto (vedi README.md)
|
|
|
|
[2026-09-05T11:14:08Z] commit=07a48e4 session=v2-kickoff
|
|
module: scaffold
|
|
action: creato hardware/v1/ (baseline V1 congelata, sola lettura) e
|
|
hardware/v2/ (struttura obbligatoria: rtl/ sim/ constraints/ synthesis/
|
|
reports/{simulation,synthesis,timing,experiments}/ scripts/sweep/ logs/
|
|
docs/), per iniziare lo sviluppo V2 richiesto da docs/v2-description.md.
|
|
reason: richiesta utente esplicita -- "Crea un v1 con tutto il codice
|
|
attuale che non deve essere modificato per nessun motivo e lavora su
|
|
una v2 copiando quello che ti serve. Aggiornami frequentemente e crea
|
|
un log nuovo."
|
|
command: cp rtl/*.v sim/*.v tools/ synth/ecp5/{p2,p4,p8,post_fix_verify}
|
|
synth/ecp5/*.lpf docs/validation/*.md WORKLOG.md
|
|
docs/FPGA-NeuralNetwork-Engine.md docs/FPGA-Neural-Datapatch-Benchmark.md
|
|
docs/FPGA-Neural-Hardware-Design.md -> hardware/v1/{rtl,sim,tools,
|
|
constraints,synthesis,docs}; chmod -R a-w su tutto hardware/v1/.
|
|
result: verificato bit-esatto (`diff -rq rtl/ hardware/v1/rtl/` e cmp
|
|
file-per-file su sim/*.v, 0 differenze). hardware/v1/ reso sola lettura
|
|
a livello filesystem come ulteriore salvaguardia oltre alla policy.
|
|
hardware/v2/ vuoto tranne logs/ (questo file + README.md).
|
|
errors: nessuno.
|
|
decision: copia (non spostamento) dell'albero top-level rtl/sim/synth/
|
|
tools -- l'albero principale del repository resta la "produzione" V1
|
|
invariata; hardware/v1/ e' una seconda copia frozen dedicata al
|
|
confronto V2, per minimizzare il rischio di rompere riferimenti/path
|
|
esistenti in WORKLOG.md, docs/, altri script. Vedi decisions.log
|
|
DEC-0001 per la motivazione completa.
|
|
next_action: M1 (docs/v2-description.md §33) -- implementare
|
|
hardware/v2/rtl/neural_processor.v (P_IN=8), pipeline 8 stage,
|
|
bit-exact contro hardware/v1/rtl/neuron_parallel.v + mac8.v,
|
|
testbench hardware/v2/sim/tb_neural_processor.v.
|
|
|
|
[2026-09-05T12:03:12Z] commit=07a48e4 session=v2-M1-neural-processor
|
|
module: hardware/v2/rtl/neural_processor.v + hardware/v2/sim/
|
|
tb_neural_processor.v
|
|
action: implementato M1 (docs/v2-description.md §33) -- Neural
|
|
Processor P_IN=8, pipeline a 8 stadi (input align -> 8 moltiplicatori
|
|
-> 3 livelli di albero di somma -> accumulatore -> bias/activation ->
|
|
saturazione INT8), FSM a 7 stati (§6, con 4 stati assorbiti in
|
|
NP_WAIT_OPERANDS per il vero throughput pipeline -- vedi
|
|
decisions.log DEC-0002), interfacce valid/ready/data/last (§7).
|
|
Aritmetica bit-esatta con hardware/v1/rtl/neuron_parallel.v +
|
|
mac8.v + mac_unit.v.
|
|
reason: roadmap M1, richiesta esplicita utente di iniziare lo sviluppo
|
|
V2 copiando da V1 quanto necessario.
|
|
result: 3 bug reali incontrati e risolti durante lo sviluppo (vedi
|
|
errors.log ERR-0001/0002/0003) -- due erano bug del toolchain Icarus
|
|
Verilog v13.0 (non del RTL), confermati installando e usando
|
|
Verilator 5.050 come secondo simulatore indipendente (decisions.log
|
|
DEC-0004); uno era un bug RTL reale (gating mancante su `last0`,
|
|
fix verificato). Testbench finale: 7/7 test PASS, bit-exact contro
|
|
V1, sia a ACC_WIDTH=32 che ACC_WIDTH=24 (esperimento richiesto
|
|
dall'utente, experiments.log EXP-0002). Sintesi reale Yosys + P&R
|
|
reale nextpnr-ecp5: 0 problemi CHECK, Fmax 183.12 MHz (ACC_WIDTH=32)
|
|
/ 176.21 MHz (ACC_WIDTH=24) -- entrambi PASS a 80MHz con ampio
|
|
margine, ~3x il Fmax isolato di V1 a PARALLEL=8 (61.71 MHz).
|
|
errors: vedi errors.log ERR-0001, ERR-0002, ERR-0003, ERR-0004.
|
|
decision: vedi decisions.log DEC-0002, DEC-0003, DEC-0004.
|
|
next_action: M2 -- neural_processor_array.v, sweep N_PROCESSORS
|
|
(1,2,4,8), misura timing/risorse/throughput/utilization reali.
|
|
|
|
[2026-09-05T14:30:00Z] commit=dc0b331 session=v2-M2-processor-array
|
|
module: hardware/v2/rtl/neural_processor_array.v + hardware/v2/sim/
|
|
tb_neural_processor_array.v + hardware/v2/synthesis/
|
|
harness_neural_processor_array.v
|
|
action: implementato M2 -- Neural Processor Array, N_PROCESSORS
|
|
parametrico, ogni processore con interfaccia job/operand/result
|
|
dedicata (nessun bus condiviso/mux a questo livello, §7). Testato
|
|
N_PROCESSORS=4 con esecuzione concorrente reale (lancio simultaneo
|
|
di 4 job diversi, più un test a partenza sfalsata) e con lo sweep
|
|
reale N_PROCESSORS={1,2,4,8} per sintesi/place&route.
|
|
reason: roadmap M2.
|
|
result: 7/7 test PASS (Verilator), confermata esecuzione concorrente e
|
|
indipendente (un job più corto lanciato dopo completa prima di uno
|
|
più lungo lanciato prima -- non c'e' serializzazione nascosta).
|
|
Sintesi/P&R reali per N=1/2/4/8: 0 problemi CHECK, scaling lineare
|
|
delle risorse, Fmax sempre PASS a 80MHz (159.11/149.59/151.01/134.70
|
|
MHz). Scoperta reale non assunta: il DSP (MULT18X18D) e' la prima
|
|
risorsa a saturare (88% a N=8), non LUT/FF (sotto il 6% anche a
|
|
N=8) -- vedi decisions.log DEC-0005.
|
|
errors: ERR-0005 (artefatto di sintesi da pin-count, non un bug RTL --
|
|
workaround con un harness dedicato, vedi errors.log). Un primo
|
|
tentativo di harness alimentava dati identici a ogni processore/lane
|
|
MAC, e Yosys deduplicava silenziosamente tutto a 1x indipendentemente
|
|
da N -- scoperto verificando che lo scaling fosse davvero lineare
|
|
prima di fidarsi dei numeri.
|
|
decision: vedi decisions.log DEC-0005.
|
|
next_action: M3 -- activation_buffer.v / weight_buffer.v /
|
|
result_buffer.v (profondita' parametrica, valutare BRAM mapping).
|
|
|
|
[2026-09-05T15:15:00Z] commit=3026dcd session=v2-M3-buffers
|
|
module: hardware/v2/rtl/activation_buffer.v, weight_buffer.v,
|
|
result_buffer.v
|
|
action: implementato M3 -- tre buffer paramentrici (profondita'
|
|
parametrica) che inferiscono DP16KD reale, riusando l'idioma gia'
|
|
validato in hardware/v1/rtl/act_buffer.v (porta A scrittura sync,
|
|
porta B lettura sync REGISTRATA, nessun reset sulla porta di lettura
|
|
per restare fuori dal percorso LUT-RAM).
|
|
reason: roadmap M3.
|
|
result: 10/10 test PASS (Verilator). Sintesi reale a 2 profondita'
|
|
ciascuno: 0 problemi CHECK, DP16KD reale confermato in tutte le 6
|
|
configurazioni (mai LUT-RAM). Scoperta reale non assunta: il costo
|
|
BRAM di weight_buffer e' determinato dalla LARGHEZZA (P_IN*DATA_
|
|
WIDTH=64 bit), non dalla profondita' -- 512->64 di profondita' non
|
|
ha ridotto il conteggio DP16KD (resta 2). Place&route reale sui
|
|
default: tutti PASS a 80MHz con ampio margine (287-367 MHz).
|
|
errors: nessuno.
|
|
decision: vedi benchmark.log -- il dimensionamento di weight_buffer
|
|
andra' guidato da P_IN, non solo da DEPTH, quando si arrivera' a
|
|
M4/M9.
|
|
next_action: M4 -- memory_manager.v + prefetch_engine.v.
|