Files
FPGA-Neural/hardware/v2/logs/simulation.log
T
micheleandClaude Sonnet 5 91bbbe2fe5 feat(v2): M10 Optimization - data-driven findings, completes the V2 roadmap
Final milestone of docs/v2-description.md's §33 roadmap, scoped
exactly to its own mandate: optimize only on data already gathered in
M1-M9, across the pipeline/P_IN/processor-count/scheduling/memory
axes - no speculative new features.

Three concrete, data-driven results:

1. N_SLOTS=8 (numero processor axis): real synthesis + nextpnr-ecp5
   P&R for dataflow_core at N_SLOTS=8, extending M7's N_SLOTS=2/4
   sweep to the real DSP ceiling DEC-0005 predicted. 92.63 MHz
   POST-P&R, PASS at 80MHz, DSP 64/72 (88.9%). DEC-0012 recommends
   N_SLOTS=8 as the practical ceiling for P_IN=8 on the
   LFE5U-45F-8BG381.

2. ACC_WIDTH 24 vs 32 (pipeline axis): a real 6-seed nextpnr-ecp5
   placement sweep (reusing already-synthesized netlists, no new
   synthesis needed) resolves EXP-0002's single-seed
   inconclusiveness. ACC_WIDTH=24 wins on both mean Fmax (+6.2%,
   180.71 vs 170.12 MHz) and seed-to-seed variance (~3.4x tighter),
   on top of its already-known resource advantage. DEC-0013
   recommends ACC_WIDTH=24 as the new default.

3. Stall %/utilization (scheduling/memory axes): testbench-only cycle
   counters added to tb_neural_multiprocessor.v (no RTL touched)
   close DEC-0011's deferred measurement gap with real data - shared
   PSRAM port 81.7% utilized, slot 0 95.2%, slot 1 65.2%, no
   conclusive evidence of harmful fixed-priority starvation at this
   scale.

The 10-milestone V2 roadmap (docs/v2-description.md §33) is now
complete end-to-end: real Verilator simulation, real Yosys synthesis,
real nextpnr-ecp5 place & route for every milestone, fully logged
(EXP-0001..EXP-0013, DEC-0001..DEC-0013, ERR-0001..ERR-0008) with no
invented results (§30) and V1 kept frozen and untouched throughout
(§1/§34).

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

121 lines
6.4 KiB
Plaintext

# V2 simulation log -- solo append, mai troncato/sovrascritto (vedi README.md)
# Nessuna entry ancora -- popolato incrementalmente man mano che avanza lo sviluppo V2.
[2026-09-05] EXP-0001/EXP-0002 -- hardware/v2/sim/tb_neural_processor.v
test: 7 cases (16/32/8/8/8/8/64-input jobs; ACT_NONE + ACT_RELU;
extreme INT8 saturation; back-to-back zero-idle-gap tiles)
vectors: regular positive, mixed-sign cancellation, extreme INT8
(-128,-127,-1,0,1,126,127,127 in one 8-lane tile), back-to-back
jobs, 8-tile (64-input) job
simulator: Verilator 5.050 (--binary --timing) -- see decisions.log
DEC-0004 for why Icarus v13.0 is not trusted for this testbench
cycles: not separately profiled at this milestone (throughput/stall
cycle counting deferred to M9 per §22)
PASS/FAIL: 7/7 PASS (ACC_WIDTH=32); 7/7 PASS (ACC_WIDTH=24, EXP-0002)
bit-exact result: V1.y === V2.result_data for every case, both widths
stall cycles / memory wait / utilization: N/A (no Memory Manager yet,
M1 operands fed directly by testbench per the roadmap)
[2026-09-05] EXP-0003 -- hardware/v2/sim/tb_neural_processor_array.v
(N_PROCESSORS=4)
test: 7 cases (single-processor sanity; 4-way same-cycle concurrent
launch with different tile counts; staggered-start 2-processor test)
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 7/7 PASS
bit-exact result: N/A at this milestone (hand-computed expected
values, arithmetic itself already bit-exact-certified vs V1 at M1)
concurrency: confirmed genuine -- in the staggered test, the
later-launched, shorter job (processor 1) completes BEFORE the
earlier-launched, longer job (processor 0), proving independent
progress rather than serialization.
[2026-09-05] EXP-0004 -- hardware/v2/sim/tb_buffers.v
test: 10 cases across activation_buffer/weight_buffer/result_buffer
vectors: extreme INT8 (-128, 127, -100, 100), regular values, full
64-bit tile round-trip (weight_buffer), re-reads confirming earlier
writes undisturbed
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 10/10 PASS
[2026-09-05] EXP-0005 -- hardware/v2/sim/tb_memory_manager.v
test: 3 end-to-end jobs (3-tile/saturating, 1-tile/non-saturating,
5-tile/steady-state-swap), real V1 PSRAM backend chain (unmodified),
real M1 neural_processor
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 3/3 PASS
bit-exact result: PSRAM-read-back result byte matches hand-computed
expectation in every case (independent oracle, not derived from the
RTL under test)
cycles: 446 (3 tiles), 166 (1 tile), 728 (5 tiles) -- real PSRAM
latency dominates, not memory_manager's own control overhead
[2026-09-05] EXP-0006 -- hardware/v2/sim/tb_neural_director.v
test: 4 cases (3-jobs-2-slots first-free dispatch + queueing,
backpressure fill/recover)
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 4/4 PASS
[2026-09-05] EXP-0007 -- hardware/v2/sim/tb_dependency_manager.v
test: 4 cases on a 4-node DAG (2 independent + 1 dual-dependency +
1 single-dependency-shared-producer)
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 4/4 PASS
[2026-09-05] EXP-0008 -- hardware/v2/sim/tb_dataflow_core.v
test: full end-to-end M1-M6 integration through dataflow_core.v (M7),
a 3-node DAG (node0/node1 independent, node2 depends on BOTH) run
through the REAL dependency_manager -> neural_director -> N_SLOTS x
(memory_manager + neural_processor) chain for the first time, each
slot backed by its own independent behavioral byte memory
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 4/4 PASS -- node0=48, node1=8 (both real neural_processor
computations via the full stack), node2=40 dispatched only after
BOTH node0 and node1 genuinely completed (continuously polled every
cycle up to completion, not just checked at the end) -- the
dependency-manager-to-director wake-up loop closes correctly
end-to-end with real hardware in between, not just in isolation
(M6's own testbench already proved the wake-up logic alone)
[2026-09-05] EXP-0009 -- hardware/v2/sim/tb_neural_multiprocessor.v
test: same 3-node DAG as EXP-0008 (node0/node1 independent, node2
depends on both), routed through neural_multiprocessor.v (M8): the
REAL, UNMODIFIED V1 PSRAM backend chain (int8_memory_access ->
memory_interface -> psram_controller -> psram_model) shared across
N_SLOTS=2 genuinely concurrent memory_manager instances via the new
slot_mem_arbiter.v -- node0 and node1 are registered back-to-back
with no dependencies, so both dispatch to their slots essentially
simultaneously and genuinely contend for the one real PSRAM port.
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 4/4 PASS after fixing a real dropped-request bug in the
first arbiter draft (errors.log ERR-0008) -- node0=48, node1=8
(concurrent, real PSRAM, real arbitration), node2=40 dispatched only
after both genuinely completed. 444 cycles end-to-end (vs 20000-cycle
watchdog timeout with the buggy first draft, where node1's request
was silently dropped and its slot hung forever).
regression: hardware/v2/sim/tb_memory_manager.v (M4) re-run unchanged
(no M4 file touched) -- still 3/3 PASS, identical cycle counts
(446/166/728), confirming slot_mem_arbiter.v is purely additive.
[2026-09-05] EXP-0013 -- hardware/v2/sim/tb_neural_multiprocessor.v,
M10 cycle-accounting instrumentation (closes decisions.log DEC-0011's
deferred stall %/utilization gap with real data, testbench-only
addition, no RTL touched)
test: same EXP-0009 scenario (3-node DAG, N_SLOTS=2, real V1 PSRAM
chain, real slot_mem_arbiter contention), instrumented with cycle
counters (shared PSRAM port busy cycles via
u_nmp.u_arbiter.owner!=0, each slot's memory_manager busy cycles via
its own state!=MM_IDLE), measured from the first node registration
to test completion.
simulator: Verilator 5.050 (--binary --timing)
PASS/FAIL: 4/4 PASS (unchanged from EXP-0009), plus real measured
data: 684 total cycles measured; shared PSRAM port busy 559/684
(81.7% utilization, 18.3% idle); slot 0 (memory_manager) busy
651/684 (95.2%); slot 1 (memory_manager) busy 446/684 (65.2%).
note: slot 0's higher utilization is at least partly explained by it
serving TWO sequential jobs in this run (node0, then whichever slot
frees first serves node2 -- likely slot 0, first-free/lowest-index)
while slot 1 only ever serves node1 -- NOT conclusive evidence of
harmful priority starvation on its own; see decisions.log DEC-0010's
original fairness deferral, now informed by this real (if small)
data point.