spinn_front_end_common.interface.buffer_management.buffer_models package

Module contents

class spinn_front_end_common.interface.buffer_management.buffer_models.AbstractReceiveBuffersToHost

Bases: object

Indicates that this MachineVertex can receive buffers.

abstract get_recorded_region_ids() Sequence[int][source]

Get the recording region IDs that have been recorded using buffering.

Returns:

The region numbers that have active recording

Return type:

iterable(int)

abstract get_recording_region_base_address(placement: Placement) int[source]

Get the recording region base address.

Parameters:

placement (Placement) – the placement object of the core to find the address of

Returns:

the base address of the recording region

Return type:

int

class spinn_front_end_common.interface.buffer_management.buffer_models.AbstractSendsBuffersFromHost

Bases: object

A vertex that sends buffers of keys to be transmitted at given timestamps in the simulation.

abstract buffering_input() bool[source]

Return True if the input of this vertex is to be buffered.

Return type:

bool

abstract get_next_key(region: int) int[source]

Get the next key in the given region.

Parameters:

region (int) – The region to get the next key from

Returns:

The next key, or None if there are no more keys

Return type:

int

abstract get_next_timestamp(region: int) int[source]

Get the next timestamp at which there are still keys to be sent for the given region.

Parameters:

region (int) – The region to get the timestamp for

Returns:

The timestamp of the next available keys

Return type:

int

abstract get_region_buffer_size(region: int) int[source]

Get the size of the buffer to be used in SDRAM on the machine for the region in bytes.

Parameters:

region (int) – The region to get the buffer size of

Returns:

The size of the buffer space in bytes

Return type:

int

abstract get_regions() Iterable[int][source]

Get the set of regions for which there are keys to be sent.

Returns:

Iterable of region IDs

Return type:

iterable(int)

abstract is_empty(region: int) bool[source]

Return true if there are no spikes to be buffered for the specified region.

Parameters:

region (int) – The region to get the next key from

Returns:

Whether there are no keys to send for the region

Return type:

bool

abstract is_next_key(region: int, timestamp: int) bool[source]

Determine if there are still keys to be sent at the given timestamp for the given region.

Parameters:
  • region (int) – The region to determine if there are keys for

  • timestamp (int) – The timestamp to determine if there are more keys for

Returns:

Whether there are more keys to send for the parameters

Return type:

bool

abstract is_next_timestamp(region: int) bool[source]

Determine if there is another timestamp with data to be sent.

Parameters:

region (int) – The region to determine if there is more data for

Returns:

Whether there is more data

Return type:

bool

abstract rewind(region: int)[source]

Rewinds the internal buffer in preparation of re-sending the spikes.

Parameters:

region (int) – The region to rewind

class spinn_front_end_common.interface.buffer_management.buffer_models.SendsBuffersFromHostPreBufferedImpl

Bases: AbstractSendsBuffersFromHost

Implementation of AbstractReceiveBuffersToHost that uses an existing set of buffers for the details.

buffering_input() bool[source]

Return True if the input of this vertex is to be buffered.

Return type:

bool

get_next_key(region: int) int[source]

Get the next key in the given region.

Parameters:

region (int) – The region to get the next key from

Returns:

The next key, or None if there are no more keys

Return type:

int

get_next_timestamp(region: int) int[source]

Get the next timestamp at which there are still keys to be sent for the given region.

Parameters:

region (int) – The region to get the timestamp for

Returns:

The timestamp of the next available keys

Return type:

int

get_regions() Collection[int][source]

Get the set of regions for which there are keys to be sent.

Returns:

Iterable of region IDs

Return type:

iterable(int)

is_empty(region: int) bool[source]

Return true if there are no spikes to be buffered for the specified region.

Parameters:

region (int) – The region to get the next key from

Returns:

Whether there are no keys to send for the region

Return type:

bool

is_next_key(region: int, timestamp: int) bool[source]

Determine if there are still keys to be sent at the given timestamp for the given region.

Parameters:
  • region (int) – The region to determine if there are keys for

  • timestamp (int) – The timestamp to determine if there are more keys for

Returns:

Whether there are more keys to send for the parameters

Return type:

bool

is_next_timestamp(region: int) bool[source]

Determine if there is another timestamp with data to be sent.

Parameters:

region (int) – The region to determine if there is more data for

Returns:

Whether there is more data

Return type:

bool

rewind(region: int)[source]

Rewinds the internal buffer in preparation of re-sending the spikes.

Parameters:

region (int) – The region to rewind

abstract property send_buffers: Dict[int, BufferedSendingRegion]

The buffer for each region that has keys to send.

Return type:

dict(int, BufferedSendingRegion)