Skip to content

Commit

Permalink
If we don't add edges there are no keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Sep 26, 2023
1 parent 0a8ec0a commit f50f53e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
12 changes: 8 additions & 4 deletions link_test/link_test_receive_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 24 additions & 5 deletions link_test/link_test_send_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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

0 comments on commit f50f53e

Please sign in to comment.