Ejemplo n.º 1
0
 def __init__(self, hostname, port=17893):
     self.conn = SCPConnection(hostname, port)
     self.app_calls = AppCalls(self)
     self.memory_calls = MemoryCalls(self)
     self.packet_calls = PacketCalls(self)
     self._x = 0
     self._y = 0
     self.utility = None
Ejemplo n.º 2
0
def reset(hostname):
    """
    Establishes a SCP connection to the board-management processor specified
    by ``hostname`` and sends a reset command.

    :param hostname: hostname of the board-management processor of the target
                     SpiNNaker

    .. warning::

        This function is only applicable to SpiNN-4 (or greater) boards that
        have board-management processors on the PCB.

    """

    # simple packet:
    #   arg1 = 2 (denotes pulse reset)
    conn = SCPConnection(hostname)
    msg = SCPMessage()
    msg.cmd_rc = scamp.CMD_RESET
    msg.arg1 = 2
    conn.send_scp_msg(msg)
Ejemplo n.º 3
0
        print "machineName is not defined in pacman.cfg and has not been specified"
        sys.exit(2)

if configfile is None:
    version = config.get("Machine", "version")
    if version == "None":
        print "version is not defined in pacman.cfg and config file has not been specified"
        sys.exit(2)
    configfile = _checkfile("spin{}.conf".format(version))

if bootfile is None:
    bootfile = _checkfile("scamp-130.boot")

if structfile is None:
    structfile = _checkfile("sark-130.struct")

try:
    conn = SCPConnection(hostname)
    version = conn.version(retries=3)
    print "{} already booted with {} {}".format(hostname, version.desc,
                                                version.ver_num)
except:
    boot(hostname, bootfile, configfile, structfile)
    try:
        conn = SCPConnection(hostname)
        version = conn.version()
        print "{} booted with {} {}".format(hostname, version.desc,
                                            version.ver_num)
    except:
        print "Boot failed!"