spinnman.model package¶
Subpackages¶
- spinnman.model.enums package
- Module contents
CPUStateDiagnosticFilterDefaultRoutingStatusDiagnosticFilterDestinationDiagnosticFilterDestination.DUMPDiagnosticFilterDestination.LINK_0DiagnosticFilterDestination.LINK_1DiagnosticFilterDestination.LINK_2DiagnosticFilterDestination.LINK_3DiagnosticFilterDestination.LINK_4DiagnosticFilterDestination.LINK_5DiagnosticFilterDestination.LOCALDiagnosticFilterDestination.LOCAL_MONITOR
DiagnosticFilterEmergencyRoutingStatusDiagnosticFilterPacketTypeDiagnosticFilterPayloadStatusDiagnosticFilterSourceExecutableTypeMailboxCommandP2PTableRouteRouterErrorRunTimeErrorRunTimeError.ABORTRunTimeError.APIRunTimeError.DABTRunTimeError.DIVBY0RunTimeError.ENABLERunTimeError.EVENTRunTimeError.FIQRunTimeError.IOBUFRunTimeError.IRQRunTimeError.MALLOCRunTimeError.NONERunTimeError.NULLRunTimeError.PABTRunTimeError.PKTRunTimeError.RESETRunTimeError.SARK_VERSRION_INCORRECTRunTimeError.SVCRunTimeError.SWERRRunTimeError.TIMERRunTimeError.UNDEFRunTimeError.UNRECOGNISEDRunTimeError.VIC
SDP_PORTSSDP_RUNNING_MESSAGE_CODESUserRegister
- Module contents
Module contents¶
- class spinnman.model.ADCInfo(adc_data: bytes, offset: int)¶
Bases:
objectContainer for the ADC data that’s been retrieved from an FPGA.
- Parameters:
adc_data – bytes from an SCP packet containing ADC information
- Raises:
SpinnmanInvalidParameterException – If the message does not contain valid ADC information
- class spinnman.model.BMPConnectionData(ip_address: str, boards: Sequence[int], port_num: int | None)¶
Bases:
objectContains the details of a BMP connection.
- Parameters:
ip_address – The IP address of the BMP.
boards – The boards to be addressed.
port_num – The port number associated with this BMP connection.
- class spinnman.model.CPUInfo(x: int, y: int, p: int, cpu_data: Tuple[bytes, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, bytes, int, int, int, int, int, int])¶
Bases:
objectRepresents information about the state of a CPU.
This is the content of the vcpu_t for the processor, maintained by SARK.
- Parameters:
x – The x-coordinate of a chip
y – The y-coordinate of a chip
p – The ID of a core on the chip
cpu_data – A byte-string received from SDRAM on the board
- property application_mailbox_command: MailboxCommand¶
The command currently in the mailbox being sent from the monitor processor to the application.
- property application_mailbox_data_address: int¶
The address of the data in SDRAM for the application mailbox.
- static mock_info(x: int, y: int, p: int, physical_cpu_id: int, state: CPUState) CPUInfo[source]¶
Makes a CPU_info object for Testing purposes
- Returns:
A fake
- property monitor_mailbox_command: MailboxCommand¶
The command currently in the mailbox being sent from the application to the monitor processor.
- property monitor_mailbox_data_address: int¶
The address of the data in SDRAM of the monitor mailbox.
- property run_time_error: RunTimeError¶
The reason for a run time error.
- class spinnman.model.CPUInfos¶
Bases:
objectA set of CPU information objects.
- add_info(cpu_info: CPUInfo) None[source]¶
Add a info on using its core coordinates.
- Parameters:
cpu_info
- add_infos(other: Self, states: Iterable[CPUState]) None[source]¶
Adds all the infos in the other CPUInfos if the have one of the required states
mainly a support method for Transceiver.add_cpu_information_from_core
- Parameters:
other – Another Infos object to merge in
states – Only add if the Info has this state
- get_cpu_info(x: int, y: int, p: int) CPUInfo[source]¶
- Returns:
The information for the given core on the given core
- infos_for_state(state: CPUState) CPUInfos[source]¶
Creates a new CpuInfos object with Just the Infos that match the state.
- Parameters:
state
- Returns:
New Infos object with the filtered infos if any
- class spinnman.model.ChipInfo(system_data: bytes, offset: int)¶
Bases:
objectRepresents the system variables for a chip, received from the chip SDRAM.
- Parameters:
system_data – A byte-string retrieved from SDRAM on the board
offset – The offset into the byte-string where the actual data starts
- Raises:
SpinnmanInvalidParameterException – If the data doesn’t contain valid system data information
- property physical_to_virtual_core_map: bytes¶
The physical core ID to virtual core ID map; entries with a value of 0xFF are non-operational cores.
- property virtual_core_ids: Iterable[int]¶
A list of available cores by virtual core ID (including the monitor).
- class spinnman.model.ChipSummaryInfo(chip_summary_data: bytes, offset: int, x: int, y: int)¶
Bases:
objectRepresents the chip summary information read via an SCP command.
- Parameters:
chip_summary_data – The data from the SCP response
offset – The offset into the data where the data starts
x – The x-coordinate of the chip that this data is from
y – The y-coordinate of the chip that this data is from
- clear_ethernet_ip_address() None[source]¶
Forces the Ethernet IP address to None, in case of an errant chip.
- property n_free_multicast_routing_entries: int¶
The number of multicast routing entries free on this chip.
- class spinnman.model.DiagnosticFilter(enable_interrupt_on_counter_event: bool, match_emergency_routing_status_to_incoming_packet: bool, destinations: List[DiagnosticFilterDestination], sources: List[DiagnosticFilterSource], payload_statuses: List[DiagnosticFilterPayloadStatus], default_routing_statuses: List[DiagnosticFilterDefaultRoutingStatus], emergency_routing_statuses: List[DiagnosticFilterEmergencyRoutingStatus], packet_types: List[DiagnosticFilterPacketType])¶
Bases:
objectA router diagnostic counter filter, which counts packets passing through the router with certain properties. The counter will be incremented so long as the packet matches one of the values in each field i.e. one of each of the destinations, sources, payload_statuses, default_routing_statuses, emergency_routing_statuses and packet_types.
- Parameters:
enable_interrupt_on_counter_event – Indicates whether an interrupt should be raised when this rule matches
match_emergency_routing_status_to_incoming_packet – Indicates whether the emergency routing statuses should be matched against packets arriving at this router (if True), or if they should be matched against packets leaving this router (if False)
destinations – Increment the counter if one or more of the given destinations match
sources – Increment the counter if one or more of the given sources match (or None or empty list to match all)
payload_statuses – Increment the counter if one or more of the given payload statuses match (or None or empty list to match all)
default_routing_statuses – Increment the counter if one or more of the given default routing statuses match (or None or empty list to match all)
emergency_routing_statuses – Increment the counter if one or more of the given emergency routing statuses match (or None or empty list to match all)
packet_types – Increment the counter if one or more of the given packet types match (or None or empty list to match all)
- property default_routing_statuses: List[DiagnosticFilterDefaultRoutingStatus]¶
Returns the default routing statuses passed into the init unchanged
Currently unused
- property destinations: List[DiagnosticFilterDestination]¶
Returns the destinations passed into the init unchanged
Currently unused
- property emergency_routing_statuses: List[DiagnosticFilterEmergencyRoutingStatus]¶
Returns the emergency routing statuses passed into the init unchanged
Currently unused
- property enable_interrupt_on_counter_event: bool¶
Returns the enable interrupt on counter event passed into the init unchanged
Currently unused
- property match_emergency_routing_status_to_incoming_packet: bool¶
Returns the match emergency routing status to incoming packet passed into the init unchanged
Currently unused
- property packet_types: List[DiagnosticFilterPacketType]¶
Returns the packet types passed into the init unchanged
Currently unused
- property payload_statuses: List[DiagnosticFilterPayloadStatus]¶
Returns the payload statuses passed into the init unchanged
Currently unused
- static read_from_int(int_value: int) DiagnosticFilter[source]¶
Claims to return a filter that reads an int
Currently only called by unused Transceiver methods
- Parameters:
int_value
- Returns:
Untested filter
- class spinnman.model.ExecutableTargets¶
Bases:
objectEncapsulate the binaries and cores on which to execute them.
- add_processor(binary: str, chip_x: int, chip_y: int, chip_p: int, executable_type: ExecutableType | None = None) None[source]¶
Add a processor to the executable targets
- Parameters:
binary – the binary path for executable
chip_x – the coordinate on the machine in terms of x for the chip
chip_y – the coordinate on the machine in terms of y for the chip
chip_p – the processor ID to place this executable on
executable_type – the executable type for locating n cores of
- add_subsets(binary: str, subsets: CoreSubsets, executable_type: ExecutableType | None = None) None[source]¶
Add core subsets to a binary.
- Parameters:
binary – the path to the binary needed to be executed
subsets – the subset of cores that the binary needs to be loaded on
executable_type – The type of this executable.
Nonemeans don’t record it.
- property all_core_subsets: CoreSubsets¶
All the core subsets for all the binaries.
- property binaries: Collection[str]¶
The binaries of the executables.
- executable_types_in_binary_set() Iterable[ExecutableType][source]¶
Get the executable types in the set of binaries.
- Returns:
iterable of the executable types in this binary set.
- get_binaries_of_executable_type(executable_type: ExecutableType) Iterable[str][source]¶
Get the binaries of a given a executable type.
- Parameters:
executable_type – the executable type enum value
- Returns:
iterable of binaries with that executable type
- get_cores_for_binary(binary: str) CoreSubsets[source]¶
Get the cores that a binary is to run on.
- Parameters:
binary – The binary to find the cores for
- Returns:
A possibly empty CoreSubsets for this binary
- get_n_cores_for_executable_type(executable_type: ExecutableType) int[source]¶
Get the number of cores that the executable type is using.
- Parameters:
executable_type
- Returns:
the number of cores using this executable type
- class spinnman.model.HeapElement(block_address: int, next_address: int, free: int)¶
Bases:
objectAn element of one of the heaps on SpiNNaker.
- Parameters:
block_address – The address of this element on the heap
next_address – The address of the next element on the heap
free – The “free” element of the block as read from the heap
- class spinnman.model.IOBuffer(x: int, y: int, p: int, iobuf: str)¶
Bases:
objectThe contents of IOBUF for a core.
- Parameters:
x – The x-coordinate of a chip
y – The y-coordinate of a chip
p – The p-coordinate of a chip
iobuf – The contents of the buffer for the chip
- class spinnman.model.MachineDimensions(width: int, height: int)¶
Bases:
objectRepresents the size of a machine in chips.
- Parameters:
width – The width of the machine in chips
height – The height of the machine in chips
- class spinnman.model.P2PTable(width: int, height: int, column_data: List[Tuple[bytes, int]])¶
Bases:
objectRepresents a P2P routing table read from the machine.
- Parameters:
width
height
column_data
- static get_column_offset(column: int) int[source]¶
- Parameters:
column – The column to be read
- Returns:
the offset of the next column in the table from the P2P base address.
- static get_n_column_bytes(height: int) int[source]¶
- Parameters:
height – The height of the machine
- Returns:
The number of bytes to be read for each column of the table.
- get_route(x: int, y: int) P2PTableRoute[source]¶
- Parameters:
x – The x-coordinate of the chip to find the route to
y – The y-coordinate of the chip to find the route to
- Returns:
The route to follow from this chip to the given chip.
- is_route(x: int, y: int) bool[source]¶
- Parameters:
x – The x-coordinate of the chip to look up
y – The y-coordinate of the chip to look up
- Returns:
True if there is a route in the P2P table to the given chip.
- class spinnman.model.RouterDiagnostics(control_register: int, error_status: int, register_values: Sequence[int])¶
Bases:
objectRepresents a set of diagnostic information available from a chip router.
- Parameters:
control_register – The value of the control register
error_status – The value of the error_status
register_values – The values of the 16 router registers
- Raises:
SpinnmanInvalidParameterException – If the number of register values is not 16
- property n_dropped_fixed_route_packets: int¶
The number of fixed-route packets received that were dropped.
- property n_dropped_multicast_packets: int¶
The number of multicast packets received that were dropped.
- property n_dropped_nearest_neighbour_packets: int¶
The number of nearest-neighbour packets received that were dropped.
- property n_dropped_peer_to_peer_packets: int¶
The number of peer-to-peer packets received that were dropped.
- property n_external_fixed_route_packets: int¶
The number of fixed-route packets received from external links.
- property n_external_multicast_packets: int¶
The number of multicast packets received from external links.
- property n_external_nearest_neighbour_packets: int¶
The number of nearest-neighbour packets received from external links.
- property n_external_peer_to_peer_packets: int¶
The number of peer-to-peer packets received from external links.
- property n_local_fixed_route_packets: int¶
The number of fixed-route packets received from local cores.
- property n_local_nearest_neighbour_packets: int¶
The number of nearest-neighbour packets received from local cores.
- property n_local_peer_to_peer_packets: int¶
The number of peer-to-peer packets received from local cores.
- class spinnman.model.VersionInfo(version_data: bytes, offset: int = 0)¶
Bases:
objectDecodes SC&MP/SARK version information as returned by the SVER command.
- Parameters:
version_data – bytes from an SCP packet containing version information
offset – the offset in the bytes from an SCP packet containing version information
- Raises:
SpinnmanInvalidParameterException – If the message does not contain valid version information