Multi-Chip Hardware Compiler¶
Target-agnostic SNN compiler with built-in specs for Loihi 2, SynSense Xylo/Speck, BrainChip Akida, SpiNNaker2, and BrainScaleS-2.
Chip Specifications¶
sc_neurocore.chip_compiler.chip_spec
¶
Chip specification model for multi-target compilation.
Each neuromorphic chip is described by a ChipSpec: cores, neurons/core, weight precision, connectivity constraints, supported neuron models, and on-chip learning capabilities. Built-in specs for Loihi 2, SynSense Xylo/Speck, BrainChip Akida, and SpiNNaker2.
Specs can be loaded from YAML for custom/future chips.
BUILTIN_CHIPS = {'loihi2': ChipSpec(name='loihi2', vendor='Intel', total_cores=128, core=(CoreSpec(max_neurons=128, max_synapses_per_neuron=8192, weight_bits=8, supported_neuron_types=['LIF', 'ALIF', 'Izhikevich', 'Compartmental'], has_on_chip_learning=True, learning_rules=['STDP', 'R-STDP', 'e-prop'], max_delay_steps=63)), clock_mhz=100, power_mw_per_core=0.5, routing_topology='mesh', max_fan_out=8192, analog_noise_cv=0.0), 'xylo': ChipSpec(name='xylo', vendor='SynSense', total_cores=1, core=(CoreSpec(max_neurons=1000, max_synapses_per_neuron=1000, weight_bits=8, supported_neuron_types=['IAF', 'LIF'], has_on_chip_learning=False, max_delay_steps=15)), clock_mhz=50, power_mw_per_core=0.1, routing_topology='crossbar', max_fan_out=1000, analog_noise_cv=0.0), 'speck': ChipSpec(name='speck', vendor='SynSense', total_cores=1, core=(CoreSpec(max_neurons=32768, max_synapses_per_neuron=512, weight_bits=4, supported_neuron_types=['IAF'], has_on_chip_learning=False, max_delay_steps=0)), clock_mhz=200, power_mw_per_core=0.5, routing_topology='crossbar', max_fan_out=512, analog_noise_cv=0.0), 'akida': ChipSpec(name='akida', vendor='BrainChip', total_cores=80, core=(CoreSpec(max_neurons=256, max_synapses_per_neuron=4096, weight_bits=4, supported_neuron_types=['IF', 'LIF'], has_on_chip_learning=True, learning_rules=['STDP'], max_delay_steps=0)), clock_mhz=300, power_mw_per_core=0.3, routing_topology='mesh', max_fan_out=4096, analog_noise_cv=0.0), 'spinnaker2': ChipSpec(name='spinnaker2', vendor='University of Manchester / Dresden', total_cores=152, core=(CoreSpec(max_neurons=1024, max_synapses_per_neuron=16384, weight_bits=16, supported_neuron_types=['LIF', 'Izhikevich', 'HH', 'Custom'], has_on_chip_learning=True, learning_rules=['STDP', 'R-STDP', 'custom'], max_delay_steps=256)), clock_mhz=500, power_mw_per_core=2.0, routing_topology='mesh', max_fan_out=16384, analog_noise_cv=0.0), 'brainscales2': ChipSpec(name='brainscales2', vendor='University of Heidelberg', total_cores=1, core=(CoreSpec(max_neurons=512, max_synapses_per_neuron=256, weight_bits=6, supported_neuron_types=['AdEx', 'LIF'], has_on_chip_learning=True, learning_rules=['STDP', 'correlation'], max_delay_steps=4)), clock_mhz=125, power_mw_per_core=30.0, routing_topology='crossbar', max_fan_out=256, analog_noise_cv=0.2)}
module-attribute
¶
ChipSpec
dataclass
¶
Full neuromorphic chip specification.
Parameters¶
name : str Chip identifier (e.g., 'loihi2', 'xylo', 'akida'). vendor : str total_cores : int core : CoreSpec Per-core specification (assumes homogeneous cores). clock_mhz : float power_mw_per_core : float Estimated dynamic power per active core. routing_topology : str 'mesh', 'crossbar', 'tree', 'ring' max_fan_out : int Maximum outgoing connections per neuron. analog_noise_cv : float Coefficient of variation for analog process variation. 0.0 for fully digital chips.
Source code in src/sc_neurocore/chip_compiler/chip_spec.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
fits(n_neurons, max_fan_out=0)
¶
Check if a network fits on this chip.
Source code in src/sc_neurocore/chip_compiler/chip_spec.py
81 82 83 84 85 | |
cores_needed(n_neurons)
¶
Minimum cores needed for N neurons.
Source code in src/sc_neurocore/chip_compiler/chip_spec.py
87 88 89 | |
CoreSpec
dataclass
¶
Specification for one neuromorphic core.
Source code in src/sc_neurocore/chip_compiler/chip_spec.py
26 27 28 29 30 31 32 33 34 35 36 | |
Compiler¶
sc_neurocore.chip_compiler.compiler
¶
Compile an SNN to a target neuromorphic chip.
Partitions the network into cores, checks constraints (neurons/core, fan-out, weight precision, supported neuron types), quantizes weights, and produces a deployment map. Reports constraint violations with specific fix suggestions.
This is the foundation for the "GCC of neuromorphic computing" — one compiler that targets all chips via pluggable chip specs.
CompilationResult
dataclass
¶
Result of compiling an SNN to a chip target.
Source code in src/sc_neurocore/chip_compiler/compiler.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
CoreMapping
dataclass
¶
Mapping of neurons to one chip core.
Source code in src/sc_neurocore/chip_compiler/compiler.py
28 29 30 31 32 33 34 35 36 | |
compile_for_chip(layer_sizes, weights=None, neuron_types=None, target='loihi2')
¶
Compile an SNN to a target neuromorphic chip.
Parameters¶
layer_sizes : list of (n_inputs, n_neurons) weights : list of ndarray, optional Weight matrices per layer. If provided, will be quantized. neuron_types : list of str, optional Neuron type per layer (e.g., 'LIF', 'Izhikevich'). target : str or ChipSpec Target chip name or spec.
Returns¶
CompilationResult
Source code in src/sc_neurocore/chip_compiler/compiler.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |