diff --git a/spynnaker/pyNN/models/neuron/abstract_population_vertex.py b/spynnaker/pyNN/models/neuron/abstract_population_vertex.py index ce7bee79ca..21823adecb 100644 --- a/spynnaker/pyNN/models/neuron/abstract_population_vertex.py +++ b/spynnaker/pyNN/models/neuron/abstract_population_vertex.py @@ -57,7 +57,8 @@ BYTES_PER_WORD, SYSTEM_BYTES_REQUIREMENT) from spynnaker.pyNN.data import SpynnakerDataView -from spynnaker.pyNN.exceptions import SpynnakerException +from spynnaker.pyNN.exceptions import ( + SynapticConfigurationException, SpynnakerException) from spynnaker.pyNN.models.abstract_models import ( AbstractAcceptsIncomingSynapses, AbstractMaxSpikes, HasSynapses, @@ -1320,9 +1321,19 @@ def __add_matrix_size(self, address: int, projection: Projection, if max_row_info.undelayed_max_n_synapses > 0: size = n_sub_atoms * max_row_info.undelayed_max_bytes for _ in range(n_sub_edges): - address = \ - MasterPopTableAsBinarySearch.get_next_allowed_address( - address) + try: + address = \ + MasterPopTableAsBinarySearch.get_next_allowed_address( + address) + except SynapticConfigurationException as ex: + values = self.__incoming_projections.values() + n_projections = (sum(len(x) for x in values)) + if n_projections > 100: + raise SpynnakerException( + f"{self} has {n_projections} incoming Projections " + f"which is more than Spynnaker can handle.")\ + from ex + raise address += size if max_row_info.delayed_max_n_synapses > 0: size = (n_sub_atoms * max_row_info.delayed_max_bytes *