diff --git a/link_test/link_test_receive_vertex.py b/link_test/link_test_receive_vertex.py index 5d186bd3..f8b9507d 100644 --- a/link_test/link_test_receive_vertex.py +++ b/link_test/link_test_receive_vertex.py @@ -132,10 +132,14 @@ def generate_machine_data_specification( config[0].receive_keys[i] = 0xFFFFFFFF config[0].receive_masks[i] = 0 else: - info = r_info.get_routing_info_from_pre_vertex( - self.__neighbours[i], PARTITION_NAME) - config[0].receive_keys[i] = info.key - config[0].receive_masks[i] = info.mask + if self.__write_routes: + config[0].receive_keys[i] = self.__neighbours[i].base_key + config[0].receive_masks[i] = self.__neighbours[i].mask + else: + info = r_info.get_routing_info_from_pre_vertex( + self.__neighbours[i], PARTITION_NAME) + config[0].receive_keys[i] = info.key + config[0].receive_masks[i] = info.mask config[0].packet_count_ok = ( (self.__sends_per_ts - self.__drops_per_ts_allowed) * self.__run_time) diff --git a/link_test/link_test_send_vertex.py b/link_test/link_test_send_vertex.py index afd862b4..e486e24c 100644 --- a/link_test/link_test_send_vertex.py +++ b/link_test/link_test_send_vertex.py @@ -27,6 +27,7 @@ MachineDataSpecableVertex) from spinn_front_end_common.data.fec_data_view import FecDataView from spinnaker_graph_front_end.utilities import SimulatorVertex +from pacman.utilities.utility_calls import get_n_bits logger = FormatAdapter(logging.getLogger(__name__)) @@ -77,6 +78,11 @@ def __init__(self, x, y, sends_per_ts, write_route, self.__y = y self.__sends_per_ts = sends_per_ts self.__write_route = write_route + self.__key = None + self.__mask = None + if not self.__write_route: + self.__key = (self.__x << 24) | (self.__y << 16) + self.__mask = 0xFFFF0000 @overrides(SimulatorVertex.get_fixed_location) def get_fixed_location(self): @@ -95,12 +101,16 @@ def generate_machine_data_specification( self.generate_system_region(spec, DataRegions.SYSTEM) # Make a config - r_info = FecDataView.get_routing_infos() - ts = FecDataView.get_simulation_time_step_us() config = (ConfigData * 1)() - info = r_info.get_routing_info_from_pre_vertex(self, PARTITION_NAME) - config[0].key = info.key - config[0].mask = info.mask + r_info = FecDataView.get_routing_infos() + if self.__write_route: + config[0].key = self.__key + config[0].mask = self.__mask + else: + ts = FecDataView.get_simulation_time_step_us() + info = r_info.get_routing_info_from_pre_vertex(self, PARTITION_NAME) + config[0].key = info.key + config[0].mask = info.mask config[0].sends_per_timestep = self.__sends_per_ts config[0].time_between_sends_us = int((ts / 2) / self.__sends_per_ts) config[0].write_route = self.__write_route @@ -116,3 +126,12 @@ def generate_machine_data_specification( def get_n_keys_for_partition(self, partition_id): return self.__sends_per_ts + + @property + def base_key(self): + return self.__key + + @property + def mask(self): + return self.__mask +