pacman.model.routing_tables package¶
Module contents¶
- class pacman.model.routing_tables.AbstractMulticastRoutingTable¶
Bases:
object
A multicast routing table. May be compressed or uncompressed.
- abstractmethod add_multicast_routing_entry(multicast_routing_entry: MulticastRoutingEntry) None [source]¶
Adds a routing entry to this table.
- Parameters:
multicast_routing_entry – The route to add
- Raises:
PacmanAlreadyExistsException – If a routing entry with the same key-mask combination already exists
- abstract property multicast_routing_entries: Collection[MulticastRoutingEntry]¶
The multicast routing entries in the table.
- abstract property number_of_defaultable_entries: int¶
The number of multicast routing entries that are set to be defaultable within this multicast routing table.
- class pacman.model.routing_tables.CompressedMulticastRoutingTable(x: int, y: int, multicast_routing_entries: Iterable[MulticastRoutingEntry] = ())¶
Bases:
AbstractMulticastRoutingTable
Represents a compressed routing table for a chip. Compressed tables have a maximum size, ensuring that they fit in the hardware available.
- Parameters:
x – The x-coordinate of the chip for which this is the routing table
y – The y-coordinate of the chip for which this is the routing tables
multicast_routing_entries – The routing entries to add to the table
- Raises:
pacman.exceptions.PacmanAlreadyExistsException – If any two routing entries contain the same key-mask combination
- add_multicast_routing_entry(multicast_routing_entry: MulticastRoutingEntry) None [source]¶
Adds a routing entry to this table.
- Parameters:
multicast_routing_entry – The route to add
- Raises:
PacmanAlreadyExistsException – If a routing entry with the same key-mask combination already exists
- property multicast_routing_entries: Collection[MulticastRoutingEntry]¶
The multicast routing entries in the table.
- property number_of_defaultable_entries: int¶
The number of multicast routing entries that are set to be defaultable within this multicast routing table.
- class pacman.model.routing_tables.MulticastRoutingTables(routing_tables: Iterable[AbstractMulticastRoutingTable] = ())¶
Bases:
object
Represents the multicast routing tables for a number of chips.
Note
The tables in an instance of this class should be either all uncompressed tables, or all compressed tables.
- Parameters:
routing_tables – The routing tables to add
- Raises:
PacmanAlreadyExistsException – If any two routing tables are for the same chip
- add_routing_table(routing_table: AbstractMulticastRoutingTable) None [source]¶
Add a routing table.
- Parameters:
routing_table – a routing table to add
- Raises:
PacmanAlreadyExistsException – If a routing table already exists for the chip
- get_max_number_of_entries() int [source]¶
The maximum number of multicast routing entries there are in any multicast routing table.
Will return zero if there are no routing tables
- get_routing_table_for_chip(x: int, y: int) AbstractMulticastRoutingTable | None [source]¶
Get a routing table for a particular chip.
- Parameters:
x – The X-coordinate of the chip
y – The Y-coordinate of the chip
- Returns:
The routing table, or None if no such table exists
- get_total_number_of_entries() int [source]¶
The total number of multicast routing entries there are in all multicast routing table.
Will return zero if there are no routing tables
- property routing_tables: Collection[AbstractMulticastRoutingTable]¶
The routing tables stored within.
- Returns:
an iterable of routing tables
- class pacman.model.routing_tables.UnCompressedMulticastRoutingTable(x: int, y: int, multicast_routing_entries: Iterable[MulticastRoutingEntry] = ())¶
Bases:
AbstractMulticastRoutingTable
Represents a uncompressed routing table for a chip. Uncompressed tables have no maximum size, but may not be deployable to hardware without being compressed.
- Parameters:
x – The x-coordinate of the chip for which this is the routing table
y – The y-coordinate of the chip for which this is the routing tables
multicast_routing_entries – The routing entries to add to the table
- Raises:
PacmanAlreadyExistsException – If any two routing entries contain the same key-mask combination
- add_multicast_routing_entry(multicast_routing_entry: MulticastRoutingEntry) None [source]¶
Adds a routing entry to this table.
- Parameters:
multicast_routing_entry – The route to add
- Raises:
PacmanAlreadyExistsException – If a routing entry with the same key-mask combination already exists
- property multicast_routing_entries: Collection[MulticastRoutingEntry]¶
The multicast routing entries in the table.
- property number_of_defaultable_entries: int¶
The number of multicast routing entries that are set to be defaultable within this multicast routing table.