Source code for pacman.model.graphs.machine.machine_fpga_vertex

# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from spinn_utilities.overrides import overrides
from pacman.model.constraints.placer_constraints import ChipAndCoreConstraint
from pacman.model.graphs import AbstractFPGA, AbstractVirtual
from pacman.model.resources import ResourceContainer
from .machine_vertex import MachineVertex


[docs]class MachineFPGAVertex(MachineVertex, AbstractFPGA): """ A virtual vertex on an FPGA link. """ __slots__ = [ "_fpga_id", "_fpga_link_id", "_board_address", "_virtual_chip_x", "_virtual_chip_y"] def __init__( self, fpga_id, fpga_link_id, board_address=None, label=None, constraints=None, app_vertex=None, vertex_slice=None): super().__init__( label=label, constraints=constraints, app_vertex=app_vertex, vertex_slice=vertex_slice) self._fpga_id = fpga_id self._fpga_link_id = fpga_link_id self._board_address = board_address self._virtual_chip_x = None self._virtual_chip_y = None @property @overrides(MachineVertex.resources_required) def resources_required(self): return ResourceContainer() @property @overrides(AbstractFPGA.fpga_id) def fpga_id(self): return self._fpga_id @property @overrides(AbstractFPGA.fpga_link_id) def fpga_link_id(self): return self._fpga_link_id @property @overrides(AbstractVirtual.board_address) def board_address(self): return self._board_address @property @overrides(AbstractVirtual.virtual_chip_x) def virtual_chip_x(self): return self._virtual_chip_x @property @overrides(AbstractVirtual.virtual_chip_y) def virtual_chip_y(self): return self._virtual_chip_y
[docs] @overrides(AbstractVirtual.set_virtual_chip_coordinates) def set_virtual_chip_coordinates(self, virtual_chip_x, virtual_chip_y): if virtual_chip_x is not None and virtual_chip_y is not None: self._virtual_chip_x = virtual_chip_x self._virtual_chip_y = virtual_chip_y self.add_constraint(ChipAndCoreConstraint( self._virtual_chip_x, self._virtual_chip_y)) if (self._app_vertex is not None and self._app_vertex.virtual_chip_x is None and self._app_vertex.virtual_chip_y is None): self._app_vertex.set_virtual_chip_coordinates()