pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator package

Submodules

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.compressible_malloc_based_routing_info_allocator module

class pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.compressible_malloc_based_routing_info_allocator.CompressibleMallocBasedRoutingInfoAllocator[source]

Bases: pacman.utilities.algorithm_utilities.element_allocator_algorithm.ElementAllocatorAlgorithm

A Routing Info Allocation Allocator algorithm that keeps track of free keys and attempts to allocate them as requested, but that also looks at routing tables in an attempt to make things more compressible

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.key_field_generator module

class pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.key_field_generator.KeyFieldGenerator(fixed_mask, fields, free_space_list)[source]

Bases: object

Handle fields in a routing key.

is_next_key
next()[source]
next_key

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.malloc_based_routing_info_allocator module

class pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.malloc_based_routing_info_allocator.MallocBasedRoutingInfoAllocator[source]

Bases: pacman.utilities.algorithm_utilities.element_allocator_algorithm.ElementAllocatorAlgorithm

A Routing Info Allocation Allocator algorithm that keeps track of free keys and attempts to allocate them as requested

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.utils module

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.utils.get_possible_masks(n_keys, mask_width=32, contiguous_keys=True)[source]

Get the possible masks given the number of keys.

Parameters:
  • n_keys (int) – The number of keys to generate a mask for
  • mask_width – Number of bits that are meaningful in the mask. 32 by default.
  • mask_width – int
  • contiguous_keys – True if the mask should only have zeros in the LSBs
Returns:

A generator of all possible masks

Return type:

iterable(int)

pacman.operations.routing_info_allocator_algorithms.malloc_based_routing_allocator.utils.zero_out_bits(all_ones_mask, bits_to_zero)[source]

Takes a mask (with all interesting bits set to 1) and zeroes out the bits at the given indices.

Parameters:
  • all_ones_mask (int) – Initial mask
  • bits_to_zero (iterable(int)) – Which bits to clear. The LSB is zero.
Returns:

A single mask, with zeroes in all required places

Return type:

int

Module contents