def setup_spinnman_interfaces(self): """Set up the interfaces for communicating with the SpiNNaker board """ self.dao.set_hostname(self.hostname) self.txrx = Transceiver(self.hostname) # Start local tubotron if requested if conf.config.getboolean("Visualiser", "enable"): self.wait_for_run = conf.config.getboolean("Visualiser", "pause_before_run") if self.wait_for_run: self.visualiser = Visualiser(self.dao, start_simulation_method=getattr( self, "run_now")) else: self.visualiser = Visualiser(self.dao) self.visualiser.set_port(self.visualiser_port) tubotron_port = conf.config.getint("Tubotron", "port") tubotron_tag = conf.config.getint("Tubotron", "tag") tubotron_host = conf.config.get("Tubotron", "hostname") self.set_tag_output(tubotron_tag, tubotron_port, tubotron_host) if conf.config.getboolean("Tubotron", "enable"): if tubotron_host == "localhost": self.tubotron = Tubotron(tubotron_port) if conf.config.has_option("Tubotron", "leaveRunning"): self.leaveTubotronRunning = conf.config.getboolean( "Tubotron", "leaveRunning")
def initialise_board(self, x, y, machine_type): if machine_type != "dynamic": boardid = board.Board(self, 0, machine_type) self.boards.append(boardid) self.create_board_chips(x, y, boardid, machine_type) self.remove_downed_cores() self.remove_downed_chips() self.initlize_neighbour_links(machine_type) self.add_virtual_chips() else: conn = Transceiver(self.hostname, 17893) self.determine_board_structure(self.hostname, x, y, machine_type, conn) self.remove_downed_cores() self.remove_downed_chips() self.determine_board_routing(self.hostname, conn) self.add_virtual_chips()
from pacman103.core.spinnman.interfaces.transceiver import Transceiver from pacman103.core.process_bar import ProgressBar from pacman103.core.spinnman.scp import scamp from pacman103.core.spinnman.scp import boot import os import pickle import struct import sys import time hostname = "192.168.240.1" version = 5 directory = "data_0.1_0.1" txrx = Transceiver(hostname) while True: try: print("Trying to get version") version = txrx.conn.version(retries=3) print("Version =", version.desc) break except: print("Couldn't get version, rebooting") boot_file = txrx.checkfile("scamp-130.boot") struct_file = txrx.checkfile("sark-130.struct") config_file = txrx.checkfile("spin{}.conf".format(5)) boot.boot(hostname, boot_file, config_file, struct_file) time.sleep(2.0) load_targets_path = os.path.join(directory, "pickled_load_targets")