Manuscript Offprint
arXiv:2610.38118FPGAFly: A 166.7k-Neuron Fruit-Fly Connectome on One FPGA via Deferred Spike Expansion and Shared-Codeword States
Ye Ziyang
Department of Electrical Engineering and Information Systems
Graduate School of Engineering, The University of Tokyo
Tokyo, Japan
Abstract—Synapse-resolution fruit-fly (Drosophila) connectomes enable neuron-by-neuron simulation of entire insect nervous systems, yet whole-brain models still require computationally demanding software or multiple neuromorphic chips, and single FPGAs support only small or statistical networks. Scaling to the full connectome, per-synapse spike expansion scales queue traffic with fan-out up to 11.2k, while 41-bit neuron states require 6.83 Mbit, exceeding the 6.27 Mbit on-chip block static RAM (BSRAM) of the target device. FPGAFly runs the 166.7k-neuron, 25.6M-connection leaky integrate-and-fire male central nervous system (CNS) connectome on one FPGA. Order-preserving deferred expansion queues one 64-bit descriptor per spike in source-ID order, cutting external memory traffic by 54.5%–57.9% and peak queue data by 95.6%–96.5% with bit-identical results. A 24-bit encoding shares codewords across normal, refractory, and quantized out-of-range states, reducing BSRAM usage from 438 to 270 with 1245 extra LUTs and zero changes across 10,000 MNIST predictions. At 80 MHz on a Gowin GW5AST-LV138, each 100 ms window finishes in 86.83 ms on average and within 93.05 ms across 2000 tests, realizing the first complete Drosophila CNS connectome simulation on one FPGA.
Keywords—Drosophila connectome, large-scale neural simulation, memory-efficient architecture, neuromorphic computing, spiking neural networks
I. INTRODUCTION
Synapse-resolution connectomes now cover the complete adult Drosophila brain [1] and the entire male central nervous system (CNS), including the ventral nerve cord [2]. Connectome-derived networks yield experimentally confirmed predictions of taste-driven feeding [3] and visual activity [4], while neuromechanical models simulate walking and flight under multisensory input [5]–[7]. Coupling these models with real-world sensors and actuators would require real-time execution.
Large-scale simulators support statistical networks [8], [9]. Pattern-based and procedural connectivity reduce storage [10], [11], whereas connectomes require explicit per-connection storage. Software simulations of whole-brain Drosophila models still run 4.4–14× slower than real time in Brian 2 [3], [12], [13]. While neuromorphic chips [14]–[17] and multi-FPGA systems [18], [19] provide high capacity, simulating the 140k-neuron FlyWire brain requires 12 Loihi 2 chips [13], and single FPGAs support only trained networks [20], [21] or a 2.2k-neuron olfactory circuit [22].
Memory is the primary bottleneck. Expanding each spike at emission into per-synapse delay-queue records scales external memory traffic with fan-out, which is heavy-tailed in fly connectomes [23] and reaches 11.2k here. Meanwhile, storing two 18-bit neuron states and a 5-bit refractory counter requires 41 bits per neuron, or 6.83 Mbit for the 166.7k-neuron CNS, exceeding our target FPGA's 6.27 Mbit of block static RAM (BSRAM). Off-chip storage is impractical because updating every neuron each 0.1 ms step requires about 17 GB/s of state traffic, the DDR3 controller's 2.56 GB/s peak.
Layerwise dataflows [21], [24] require a feed-forward order that recurrent connectomes lack. Address-event communication [25], source-indexed row lookup [26], and hierarchical routing memories [27] avoid per-synapse queue records, but our model saturates and quantizes states on each delivered event, so queueing spikes in parallel lane completion order alters trajectories. For state storage, narrowing independent fixed-point fields [28] either fails 80 MHz timing at 29 bits or distorts dynamics at 24 bits.
FPGAFly exploits model delay and reset bounds to fit on a single Gowin GW5AST-LV138 FPGA, as shown in Fig. 1. Uniform 18-step source delays and 22-step refractoriness allow bitmap-ordered deferred expansion to queue at most one 64-bit descriptor per neuron, cutting external memory traffic by 54.5%–57.9% with bit-identical results. Firing and refractory resets leave unused codes for a 24-bit encoding to pack refractory and quantized out-of-range values alongside normal states, reducing BSRAMs from 438 to 270 with 1245 extra LUTs and zero changed MNIST predictions. At 80 MHz, FPGAFly finishes 2000 100 ms windows in 86.83 ms on
This work has been submitted to IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.
Source code: https://github.com/ZiyangYE/FPGAFLY_ISCAS2027

Fig. 1. FPGAFly architecture. (a) System dataflow and execution phases. (b) Compute unit with parallel integration and serial event updates. (c) Shared 24-bit state encoding.
average and within 93.05 ms, realizing the first complete Drosophila CNS connectome simulation on one FPGA.
- Neuron Model: The network is a frozen fixed-point leaky integrate-and-fire model derived from MaleCNS v1.0 [2]. A compressed sparse row (CSR) table stores its 25.6M neuron-pair connections with signed 18-bit weights. The membrane state and synaptic state carry seven and six fractional bits, respectively, and counts refractory steps. With the rounding , a nonrefractory neuron is updated as
where is the input drive and the constants are exponential integration factors for ms and ms at ms, scaled by . The factor 2588 absorbs the 1-bit alignment between and . If , the neuron spikes, resets , and remains refractory for 22 steps. Otherwise, both states saturate to 18 bits before state encoding. All synapses share an 18-step (1.8 ms) delay. Each due event adds its weight to a nonrefractory target's , followed by saturation, encoding, and immediate writeback. For stimulus input, lamina neurons receive constant background drive , and a pulse encoder maps grayscale images to 3335 visual input neurons.
- Order-Preserving Deferred Expansion: When a source spikes, early expansion queues one target-weight record per outgoing synapse, whereas deferred expansion queues a single 64-bit descriptor (Fig. 2(a)). Each spiking source's 64-bit entry is fetched from the DDR3 source-descriptor table and queued directly, packing a 25-bit CSR edge index, 14-bit out-degree, 14-bit coefficient start, and 4-bit coefficient count. Both schemes pack four 64-bit records per 256-bit memory word.
Per-event saturation and quantization make updates order-dependent. Across the seven 6-lane units, any 42-neuron row with a spike pushes a 12-bit row index and 42-bit mask into a 64-entry FIFO. Draining this FIFO updates readout scores and marks source IDs in a bitmap. Scanning this bitmap in ascending order then enqueues descriptors deterministically, regardless of lane completion order. Since all outgoing synapses of a source share one delay, both schemes deliver the exact same event sequence and keep states bit-identical at every step.
Because the 22-step refractory period exceeds the 18-step delay, each neuron has at most one descriptor in flight, bounding valid queue data to 1.27 MiB versus 195.2 MiB for early expansion.
- Shared-Codeword State Encoding: Refractory neurons hold , allowing state encoding without a separate refractory field (Fig. 1(c)) as
where denotes and , , is a -bit two's-complement field, and denotes concatenation. Spiking caps
TABLE I RESOURCE USAGE, TIMING, AND FIDELITY OF STATE-FORMAT AND SPIKE-EXPANSION VARIANTS
| Variant | Synthesis | P&R at 80 MHz | Fidelity vs. uncompressed format | ||||||
|---|---|---|---|---|---|---|---|---|---|
| BSRAMs | LUTs | Registers | Setup WNS (ns) | Accuracy | Changed predictions | Rate MAE (Hz) | Population correlation | Spike match | |
| Uncompressed (41-bit) | 438 | 37,953 | 56,328 | exceeds capacity | 86.91% | reference | |||
| Shared 24-bit (proposed) | 270 | 39,198 | 48,272 | +0.020 | 86.91% | 0 | 0.0709–0.231 | 0.9904–0.9995 | 42.17% |
| Shared 24-bit, early expansion | 270 | 39,859 | 48,127 | +0.038 | bit-identical to shared 24-bit on six inputs | ||||
| Independent 29-bit | 326 | 35,236 | 48,805 | −0.653 | 86.92% | 1 | 0.491–1.30 | 0.9868–0.9994 | 42.24% |
| Independent 24-bit | 270 | 34,688 | 45,736 | route failed | 87.82% | 987 | 9.64–18.5 | −0.0017–0.4053 | 1.06% |
Synthesis settings are identical, and expansion is deferred unless noted. WNS, worst setup slack after place-and-route.
nonrefractory at 896, so the lower 13-bit field uses 897–918 to encode and 2048–4095 to mark out-of-range states quantized by 8.
Each unit stores six 24-bit states per 144-bit row across sixteen 9-bit banks. Integration and event updates use state RAM in separate phases (Fig. 1(b)). Each unit integrates six neurons in parallel and updates target neurons serially in 4–5 cycles per event. Domain and refractory codes span states per neuron. Two depth-cascaded -bit BSRAMs per bank provide 4096 rows, totaling 224 state BSRAMs across seven units plus 46 for queues, bitmap, and memory interfaces. Each event writes to only the three or four banks that span the target lane.
III. EVALUATION METHODS
We implemented FPGAfly in Gowin EDA V1.9.12.03 on a Tang Mega 138K Pro board with a Gowin GW5AST-LV138 FPGA containing 340 BSRAMs. Core and DDR3 clocks run at 80 and 320 MHz, giving 8000 core cycles per 0.1 ms step. Each area-averaged MNIST image is presented over a 100 ms test window of 1000 steps. States and queues persist within continuous runs. For classification, a linear readout trained offline on 50k MNIST images accumulates ten class scores across 554 selected neurons.
-
Queue Organization: Early and deferred expansion shared the encoding, bitmap scanner, and datapath. RTL simulation compared both schemes on test inputs 0–3 and training inputs 10000–10001. Valid queue data comprised all in-flight records, while DDR traffic measured 32 B per accepted command across all phases.
-
State Formats: The 41-bit uncompressed baseline uses 18-bit and states matching the DSP input width plus a 5-bit refractory counter. An independent 29-bit format with 13-bit and 11-bit preserves fractional precision but clips outside its narrower range, while an independent 24-bit format with 10-bit and 9-bit was optimized for accuracy on 200 training images. Software simulations evaluated single 100 ms windows across all 10,000 test images and 20 s streams of all-black, normal MNIST, all-white, and alternating white-black inputs. Across the four streams, we report the min–max ranges for both the firing-rate mean absolute error (MAE) over active neurons and the population correlation in 5 ms bins.

Fig. 2. Early versus deferred spike expansion. (a) Record formats and dataflow. (b) Peak valid queue data and (c) DDR traffic per window.
Classification accuracy used all 10,000 test windows. Exact spike match used the 20 s MNIST stream.
- Implementation and Board Timing: Ten test images per class each ran for 20 consecutive windows, totaling 2000 windows. Stress tests used 60 s of all-white input and 20 s of alternating windows with a 1:9 white-to-black ratio. We also evaluated 28 synthetic patterns in which 25%–100% of the pixels are concentrated or dispersed with gray levels from 64 to 255, while the remaining pixels are set to zero. Each synthetic pattern ran for 20 windows, extended to 200 windows for the 75% gray-192 pair. RTL simulation tracked per-step service time over three windows, or 3000 steps, of MNIST test image 0. Window time ran from initialization, or from the first step on later windows, until classification completed, excluding host I/O. The real-time factor is its ratio to the simulated 100 ms.
IV. RESULTS
- Queue Organization: Early and deferred expansion produced bit-identical final states, activity, and scores on tested

Fig. 3. Board window timing and simulated per-step service time. (a) Window time over 2000 MNIST windows. (b) Maximum window time and overrun rate for synthetic inputs. (c) Window time with one white per nine black windows. (d) Per-step service time in RTL simulation over 3000 steps.
TABLE II COMPARISON WITH PRIOR LARGE-SCALE SPIKING-NETWORK AND CONNECTOME SIMULATION PLATFORMS
| Work | Platform | Devices | Network | Neurons | Connections | Time step | Real-time factor |
|---|---|---|---|---|---|---|---|
| Statistical or procedural networks | |||||||
| Rhodes et al. [8] | SpiNNaker | Multi | Cortical microcircuit | 77k | 0.3B | 0.1 ms | 1.0 |
| Kauth et al. [9] | Xilinx Virtex-7 XC7VX690T | 35 | Cortical microcircuit | 77k | 0.3B | — | 0.05 |
| R. Wang et al. [10] | Intel Stratix V 5SGXEA7 | 1 | Cortex (pattern-based) | 20M–2.6B | — | 1 ms | 1.0 |
| Knight and Nowotny [11] | NVIDIA TITAN RTX | 1 | Macaque cortex (procedural) | 4.13M | 24.2B | — | — |
| Measured connectomes | |||||||
| Brian 2 [3], [12], [13] | CPU | — | FlyWire brain | ~140k | ~15M | 0.1 ms | 4.4–14 |
| F. Wang et al. [13] | Intel Loihi 2 | 12 | FlyWire brain | ~140k | ~15M | 0.1 ms | 0.054–5.8 |
| Nanami et al. [22] | Xilinx Artix-7 XC7A35T | 1 | Olfactory circuit | ~2.2k | — | 1 ms | 1.0 |
| This work | Gowin GW5AST-LV138 | 1 | MaleCNS brain + nerve cord | 166.7k | 25.6M | 0.1 ms | 0.87 / 0.93 |
Real-time factor is wall-clock time per unit of simulated time. Brian 2 and Loihi 2 values from [13] are activity-dependent. This work reports mean / maximum over 2000 MNIST windows.
inputs. Deferred expansion reduced peak valid queue data by 95.6%–96.5% and DDR traffic per window by 54.5%–57.9% (Fig. 2). Reduced queue traffic drove these savings, while non-queue traffic increased by only 24.5–74.7 KiB over early expansion.
-
State Formats: Only the shared 24-bit format fit on chip, met timing, and preserved all 10,000 predictions, saving 168 BSRAMs at the cost of 1245 extra LUTs (Table I). Both the shared 24-bit and independent 29-bit formats compute exact in-domain updates. However, out-of-range clipping and quantization cause the state trajectories to diverge [29], which reduces the exact spike match to ~42%. Even so, extending the range through quantization preserves population dynamics and lowers rate MAE by 5.6–6.9× versus clipping. The independent 24-bit format failed routing, suppressed 62.6% of spikes, and altered 987 predictions despite accuracy tuning, severely distorting network dynamics.
-
Implementation and Board Timing: After place-and-route, the design met timing at 80 MHz with +0.020 ns setup and +0.131 ns hold slack, using 39.2k LUTs, 49.1k registers, 270 BSRAMs, and 136 DSPs. All 2000 MNIST windows met the 100 ms budget, averaging 86.83 ms and peaking at 93.05 ms (Fig. 3(a)). Every window's spike counts, event counts, and scores matched the software model. RTL cycle counts predicted board timing with a median error of 0.082%.
Under synthetic stress tests, 5 of 28 conditions exceeded the 100 ms budget (Fig. 3(b)). At gray level 192 with 75% bright pixels, concentrated input overrun in 49 of 200 windows while dispersed input never overrun. Sustained all-white input averaged 108.12 ms, and periodic white-window bursts peaked at 117.03 ms before recovering immediately on subsequent black windows (Fig. 3(c)). For MNIST test image 0, 7.93% of steps exceeded 8000 cycles (Fig. 3(d)).
V. DISCUSSION AND CONCLUSION
REFERENCES
Bitmap-ordered deferral brings deterministic delivery order to source-addressed schemes [25], [26] for order-sensitive updates, while refractoriness bounds valid queue data to 1.27 MiB for any input. Shared 24-bit codewords preserve in-domain precision and quantize out-of-range states, saving 168 BSRAMs at a 3.28% LUT cost while keeping 0.9904–0.9995 population correlation and 0.0709–0.231 Hz rate error. Independent fields either clip out-of-range values at 29 bits using 326 BSRAMs or coarsen in-domain resolution at 24 bits and diverge [29]. Unlike designs using procedural connectivity [10], [11] or 12 Loihi 2 chips [13], FPGAFly is the only single-device platform in Table II that executes an entire CNS connectome, supporting a larger graph at the same 0.1 ms step size.
In conclusion, order-preserving deferred expansion and shared-codeword encoding enable the complete 166.7k-neuron, 25.6M-connection Drosophila CNS connectome to run in real time on one low-cost FPGA. Both techniques apply beyond Drosophila to event-driven simulators with per-source delays and neuron models with unreachable post-reset states. Future work will explore motor readout pathways and tighter 0.1 ms per-step tail latency under bursty activity to support closed-loop sensor and robot actuation.
[1] S. Dorkenwald et al., “Neuronal wiring diagram of an adult brain,” Nature, vol. 634, no. 8032, pp. 124–138, 2024.
[2] S. Berg et al., “Sexual dimorphism in the complete Drosophila male central nervous system connectome,” Cell, vol. 189, no. 18, pp. 5504–5526.e15, 2026.
[3] P. K. Shiu et al., “A Drosophila computational brain model reveals sensorimotor processing,” Nature, vol. 634, no. 8032, pp. 210–219, 2024.
[4] J. K. Lappalainen et al., “Connectome-constrained networks predict neural activity across the fly visual system,” Nature, vol. 634, no. 8036, pp. 1132–1140, 2024.
[5] V. Lobato-Rios, S. T. Ramalingasetty, P. G. Özdil, J. Arreguit, A. J. Ijspeert, and P. Ramdya, “NeuroMechFly, a neuromechanical model of adult Drosophila melanogaster,” Nat. Methods, vol. 19, no. 5, pp. 620–627, 2022.
[6] S. Wang-Chen et al., “NeuroMechFly v2: Simulating embodied sensorimotor control in adult Drosophila,” Nat. Methods, vol. 21, no. 12, pp. 2353–2362, 2024.
[7] R. Vaxenburg et al., “Whole-body physics simulation of fruit fly locomotion,” Nature, vol. 643, no. 8074, pp. 1312–1320, 2025.
[8] O. Rhodes et al., “Real-time cortical simulation on neuromorphic hardware,” Phil. Trans. R. Soc. A, vol. 378, no. 2164, 2020, Art. no. 20190160.
[9] K. Kauth, T. Stadtmann, V. Sobhani, and T. Gemmeke, “neuroAIx-Framework: Design of future neuroscience simulation systems exhibiting execution of the cortical microcircuit model 20× faster than biological real-time,” Front. Comput. Neurosci., vol. 17, 2023, Art. no. 1144143.
[10] R. M. Wang, C. S. Thakur, and A. van Schaik, “An FPGA-based massively parallel neuromorphic cortex simulator,” Front. Neurosci., vol. 12, 2018, Art. no. 213.
[11] J. C. Knight and T. Nowotny, “Larger GPU-accelerated brain simulations with procedural connectivity,” Nat. Comput. Sci., vol. 1, no. 2, pp. 136–142, 2021.
[12] M. Stimberg, R. Brette, and D. F. M. Goodman, “Brian 2, an intuitive and efficient neural simulator,” eLife, vol. 8, 2019, Art. no. e47314.
[13] F. Wang, B. H. Theilman, F. Rothganger, W. Severa, C. M. Vineyard, and J. B. Aimone, “Neuromorphic simulation of Drosophila melanogaster brain connectome on Loihi 2,” 2025, arXiv:2508.16792.
[14] P. A. Merolla et al., “A million spiking-neuron integrated circuit with a scalable communication network and interface,” Science, vol. 345, no. 6197, pp. 668–673, 2014.
[15] M. Davies et al., “Loihi: A neuromorphic manycore processor with on-chip learning,” IEEE Micro, vol. 38, no. 1, pp. 82–99, 2018.
[16] S. B. Furber, F. Galluppi, S. Temple, and L. A. Plana, “The SpiNNaker project,” Proc. IEEE, vol. 102, no. 5, pp. 652–665, 2014.
[17] B. V. Benjamin et al., “Neurogrid: A mixed-analog-digital multichip system for large-scale neural simulations,” Proc. IEEE, vol. 102, no. 5, pp. 699–716, 2014.
[18] S. W. Moore, P. J. Fox, S. J. T. Marsh, A. T. Markettos, and A. Mujumdar, “Bluehive—A field-programmable custom computing machine for extreme-scale real-time neural network simulation,” in Proc. IEEE 20th Int. Symp. Field-Programmable Custom Comput. Mach. (FCCM), 2012, pp. 133–140.
[19] K. Cheung, S. R. Schultz, and W. Luk, “NeuroFlow: A general purpose spiking neural network simulation platform using customizable processors,” Front. Neurosci., vol. 9, 2016, Art. no. 516.
[20] D. Neil and S.-C. Liu, “Minitaur, an event-driven FPGA-based spiking network accelerator,” IEEE Trans. Very Large Scale Integr. (VLSI) Syst., vol. 22, no. 12, pp. 2621–2628, 2014.
[21] J. Li, G. Shen, D. Zhao, Q. Zhang, and Y. Zeng, “FireFly v2: Advancing hardware support for high-performance spiking neural network with a spatiotemporal FPGA accelerator,” IEEE Trans. Comput.-Aided Design Integr. Circuits Syst., vol. 43, no. 9, pp. 2647–2660, 2024.
[22] T. Nanami, D. Yamada, M. Someya, T. Hige, H. Kazama, and T. Kohno, “A lightweight data-driven spiking neuronal network model of Drosophila olfactory nervous system with dedicated hardware support,” Front. Neurosci., vol. 18, 2024, Art. no. 1384336.
[23] A. Lin et al., “Network statistics of the whole-brain connectome of Drosophila,” Nature, vol. 634, no. 8032, pp. 153–165, 2024.
[24] S. Narayanan, K. Taht, R. Balasubramonian, E. Giacomin, and P.-E. Gaillardon, “SpinalFlow: An architecture and dataflow tailored for spiking neural networks,” in Proc. ACM/IEEE 47th Annu. Int. Symp. Comput. Archit. (ISCA), 2020, pp. 349–362.
[25] K. A. Boahen, "Point-to-point connectivity between neuromorphic chips using address events," IEEE Trans. Circuits Syst. II, Analog Digit. Signal Process., vol. 47, no. 5, pp. 416–434, 2000.
[26] O. Rhodes et al., "sPyNNaker: A software package for running PyNN simulations on SpiNNaker," Front. Neurosci., vol. 12, 2018, Art. no. 816.
[27] S. Moradi, N. Qiao, F. Stefanini, and G. Indiveri, "A scalable multicore architecture with heterogeneous memory structures for dynamic neuromorphic asynchronous processors (DYNAPs)," IEEE Trans. Biomed. Circuits Syst., vol. 12, no. 1, pp. 106–122, 2018.
[28] M. Hopkins, M. Mikaitis, D. R. Lester, and S. Furber, "Stochastic rounding and reduced-precision fixed-point arithmetic for solving neural ordinary differential equations," Phil. Trans. R. Soc. A, vol. 378, no. 2166, 2020, Art. no. 20190052.
[29] R. Brette et al., "Simulation of networks of spiking neurons: A review of tools and strategies," J. Comput. Neurosci., vol. 23, no. 3, pp. 349–398, 2007.