pacman.model.constraints.key_allocator_constraints package

Submodules

pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint module

class pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint[source]

Bases: pacman.model.constraints.abstract_constraint.AbstractConstraint

A constraint on key allocation

pacman.model.constraints.key_allocator_constraints.contiguous_key_range_constraint module

class pacman.model.constraints.key_allocator_constraints.contiguous_key_range_constraint.ContiguousKeyRangeContraint[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Key allocator constraint that keeps the keys allocated to a contiguous range. Without this constraint, keys can be allocated across the key space.

pacman.model.constraints.key_allocator_constraints.fixed_key_and_mask_constraint module

class pacman.model.constraints.key_allocator_constraints.fixed_key_and_mask_constraint.FixedKeyAndMaskConstraint(keys_and_masks, key_list_function=None)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Key allocator constraint that fixes the key and mask of an edge.

Parameters:
key_list_function

A function to call to generate the keys

Returns:A python function, or None if the default function can be used
keys_and_masks

The keys and masks to be fixed

Returns:An iterable of key and mask combinations
Return type:iterable(pacman.model.routing_info.BaseKeyAndMask)

pacman.model.constraints.key_allocator_constraints.fixed_key_field_constraint module

class pacman.model.constraints.key_allocator_constraints.fixed_key_field_constraint.FixedKeyFieldConstraint(fields=None)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint that indicates fields in the mask of a key.

Parameters:fields (iterable(pacman.utilities.utility_objs.Field)) – any fields that define regions in the mask with further limitations
Raises:PacmanInvalidParameterException – if any of the fields are outside of the mask i.e. mask & field.value != field.value or if any of the field masks overlap i.e., field.value & other_field.value != 0
fields

Any fields in the mask, i.e., ranges of the mask that have further limitations

Returns:Iterable of fields, ordered by mask with the highest bit range first
Return type:iterable(pacman.utilities.utility_objs.Field)

pacman.model.constraints.key_allocator_constraints.fixed_mask_constraint module

class pacman.model.constraints.key_allocator_constraints.fixed_mask_constraint.FixedMaskConstraint(mask)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

A key allocator that fixes the mask to be assigned to an edge.

Parameters:mask (int) – the mask to be used during key allocation
mask

The mask to be used

Returns:The mask to be used
Return type:int

pacman.model.constraints.key_allocator_constraints.flexi_key_field_constraint module

class pacman.model.constraints.key_allocator_constraints.flexi_key_field_constraint.FlexiKeyFieldConstraint(fields)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint that indicates fields in the mask without a specific size or position.

fields

pacman.model.constraints.key_allocator_constraints.share_key_constraint module

class pacman.model.constraints.key_allocator_constraints.share_key_constraint.ShareKeyConstraint(other_partitions)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint to allow the same keys to be allocated to multiple edges via partitions.

Parameters:other_partitions – the other edges which keys are shared with.
other_partitions

Module contents

class pacman.model.constraints.key_allocator_constraints.AbstractKeyAllocatorConstraint[source]

Bases: pacman.model.constraints.abstract_constraint.AbstractConstraint

A constraint on key allocation

class pacman.model.constraints.key_allocator_constraints.ContiguousKeyRangeContraint[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Key allocator constraint that keeps the keys allocated to a contiguous range. Without this constraint, keys can be allocated across the key space.

class pacman.model.constraints.key_allocator_constraints.FixedKeyFieldConstraint(fields=None)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint that indicates fields in the mask of a key.

Parameters:fields (iterable(pacman.utilities.utility_objs.Field)) – any fields that define regions in the mask with further limitations
Raises:PacmanInvalidParameterException – if any of the fields are outside of the mask i.e. mask & field.value != field.value or if any of the field masks overlap i.e., field.value & other_field.value != 0
fields

Any fields in the mask, i.e., ranges of the mask that have further limitations

Returns:Iterable of fields, ordered by mask with the highest bit range first
Return type:iterable(pacman.utilities.utility_objs.Field)
class pacman.model.constraints.key_allocator_constraints.FixedKeyAndMaskConstraint(keys_and_masks, key_list_function=None)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Key allocator constraint that fixes the key and mask of an edge.

Parameters:
key_list_function

A function to call to generate the keys

Returns:A python function, or None if the default function can be used
keys_and_masks

The keys and masks to be fixed

Returns:An iterable of key and mask combinations
Return type:iterable(pacman.model.routing_info.BaseKeyAndMask)
class pacman.model.constraints.key_allocator_constraints.FixedMaskConstraint(mask)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

A key allocator that fixes the mask to be assigned to an edge.

Parameters:mask (int) – the mask to be used during key allocation
mask

The mask to be used

Returns:The mask to be used
Return type:int
class pacman.model.constraints.key_allocator_constraints.FlexiKeyFieldConstraint(fields)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint that indicates fields in the mask without a specific size or position.

fields
class pacman.model.constraints.key_allocator_constraints.ShareKeyConstraint(other_partitions)[source]

Bases: pacman.model.constraints.key_allocator_constraints.abstract_key_allocator_constraint.AbstractKeyAllocatorConstraint

Constraint to allow the same keys to be allocated to multiple edges via partitions.

Parameters:other_partitions – the other edges which keys are shared with.
other_partitions