Skip to content

Commit

Permalink
Merge pull request #265 from SpiNNakerManchester/roc_part
Browse files Browse the repository at this point in the history
Pacman Typing information and some changes to make that easier
  • Loading branch information
Christian-B committed Nov 1, 2023
2 parents b86c978 + 3606224 commit d887779
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gfe_examples/live_io/live_io_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class LiveIOVertex(
SimulatorVertex, MachineDataSpecableVertex):

def __init__(self, n_keys, send_partition="LiveOut", label=None):
super().__init__(label, "live_io.aplx")
super().__init__(
label, "live_io.aplx", vertex_slice=Slice(0, n_keys - 1))
self.__n_keys = n_keys
self.__send_partition = send_partition
self._vertex_slice = Slice(0, n_keys - 1)

@property
@overrides(MachineVertex.sdram_required)
Expand Down
14 changes: 13 additions & 1 deletion spinnaker_graph_front_end/utilities/simulator_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.
import logging
import sys
from spinn_utilities.abstract_base import abstractmethod
from spinn_utilities.overrides import overrides
from spinn_utilities.log import FormatAdapter
from spinnman.model.enums import ExecutableType
from pacman.model.graphs.machine import MachineVertex
from pacman.model.resources import AbstractSDRAM
from spinn_front_end_common.abstract_models import AbstractHasAssociatedBinary
from spinn_front_end_common.data import FecDataView
from spinn_front_end_common.interface.buffer_management import (
Expand All @@ -34,12 +36,16 @@ class SimulatorVertex(MachineVertex, AbstractHasAssociatedBinary):

__slots__ = ["_binary_name", "__front_end"]

def __init__(self, label, binary_name):
def __init__(self, label, binary_name, vertex_slice=None):
"""
:param str label:
The label for the vertex.
:param str binary_name:
The name of the APLX implementing the vertex.
:param vertex_slice:
The slice of the application vertex that this machine vertex
implements.
:type vertex_slice: ~pacman.model.graphs.common.Slice or None
"""
super().__init__(label)
self._binary_name = binary_name
Expand All @@ -57,6 +63,12 @@ def get_binary_file_name(self):
def get_binary_start_type(self):
return ExecutableType.USES_SIMULATION_INTERFACE

@property
@abstractmethod
@overrides(MachineVertex.sdram_required)
def sdram_required(self) -> AbstractSDRAM:
raise NotImplementedError

@property
def front_end(self):
"""
Expand Down

0 comments on commit d887779

Please sign in to comment.