samna.speck2b.event#

Submodules#

Module content#

class samna.speck2b.event.BiasValue#

Bases: pybind11_object

A response to a bias value read request.

property bias#

The queried bias value.

from_json(self: samna.speck2b.event.BiasValue, arg0: str) None#
property kill#

If True then this bias value is disabled.

property monitor_tag#

The monitor_tag of the read request event that generated this read response.

to_json(self: samna.speck2b.event.BiasValue) str#
class samna.speck2b.event.DvsEvent#

Bases: pybind11_object

Represents events that speck2b will understand as a DVS event.

On speck2b these events can only be sent to the DVS preprocessing layer.

from_json(self: samna.speck2b.event.DvsEvent, arg0: str) None#
property p#

Polarity

property timestamp#
to_json(self: samna.speck2b.event.DvsEvent) str#
property x#

X location

property y#

Y location

class samna.speck2b.event.FilterDvsEvent#

Bases: pybind11_object

The output of the filter, it’s usually used for debug.

Whenever a pixel event arrives at the filter, the filter stores in its SRAM the timestamp of the event at that location.

When a new pixel event arrives at the filter at location (x0,y0), the filter checks the area defined by register bits FKSX[2:0] and FKSY[2:0], i.e. (x0±FKSX,y0±FKSY) to see if any event was recorded in that area in a number of clock cycles defined by register bits FDEL[15:0].

The timestamps are recorded using a 16-bit loop counter. Each count is triggered by the input pin SCAN_CLK_LEAK_CLK (used also as Leak Trigger). The input clock for the filter is activated by register bit FCKE.

from_json(self: samna.speck2b.event.FilterDvsEvent, arg0: str) None#
property p#

Polarity

to_json(self: samna.speck2b.event.FilterDvsEvent) str#
property x#

X location

property y#

Y location

class samna.speck2b.event.FilterValueCurrent#

Bases: pybind11_object

Event generated together with FilterDvsEvent. it contains current filter count at the location corresponding to FilterDvsEvent.

property counter_data#

Current count value

from_json(self: samna.speck2b.event.FilterValueCurrent, arg0: str) None#
to_json(self: samna.speck2b.event.FilterValueCurrent) str#
class samna.speck2b.event.FilterValuePrevious#

Bases: pybind11_object

Event generated together with FilterDvsEvent. it contains previous filter count (Stored in SRAM) at the location corresponding to FilterDvsEvent.

property counter_data#

Previous count value

from_json(self: samna.speck2b.event.FilterValuePrevious, arg0: str) None#
to_json(self: samna.speck2b.event.FilterValuePrevious) str#
class samna.speck2b.event.InputInterfaceEvent#

Bases: pybind11_object

InputInterface events are returned from the speck2b when echoing is enabled.

The speck2b has an asynchronous bus interface which may be configured to echo events received. If echoing is enabled every input event will generate two InputInterface events.

This is a low-level event type which is used for debugging.

from_json(self: samna.speck2b.event.InputInterfaceEvent, arg0: str) None#
property msp#

True if this event is a most significant word part, false otherwise.

to_json(self: samna.speck2b.event.InputInterfaceEvent) str#
property value#

Encoded event value.

class samna.speck2b.event.MemoryValue#

Bases: pybind11_object

A response to a memory value read request.

This event is used for low level operations and should not be needed under normal conditions.

from_json(self: samna.speck2b.event.MemoryValue, arg0: str) None#
to_json(self: samna.speck2b.event.MemoryValue) str#
class samna.speck2b.event.NeuronValue#

Bases: pybind11_object

A response to a neuron value read request.

from_json(self: samna.speck2b.event.NeuronValue, arg0: str) None#
property kill#

If True then this neuron is disabled.

property monitor_tag#

The monitor_tag of the read request event that generated this read response.

property neuron_state#

The membrane potential (state) of the queried neuron.

to_json(self: samna.speck2b.event.NeuronValue) str#
class samna.speck2b.event.ReadBiasValue#

Bases: pybind11_object

An event that will create a read request for a bias value.

The tag property will be included in the BiasValue event that will be generated as a response. This is useful because speck2b does not guarantee that read requests will be responded to in the order they were received.

property address#

The address of the bias to read from in its layer.

from_json(self: samna.speck2b.event.ReadBiasValue, arg0: str) None#
property layer#

The layer containing the bias to be read from

property monitor_tag#

The tag will be used for the read response event

to_json(self: samna.speck2b.event.ReadBiasValue) str#
class samna.speck2b.event.ReadFilterValue#

Bases: pybind11_object

Get filter count value at a location.

from_json(self: samna.speck2b.event.ReadFilterValue, arg0: str) None#
to_json(self: samna.speck2b.event.ReadFilterValue) str#
property x#

X location

property y#

Y location

class samna.speck2b.event.ReadMemoryValue#

Bases: pybind11_object

An event that will create a memory read request.

This event is used for low level operations and should not be needed under normal conditions.

from_json(self: samna.speck2b.event.ReadMemoryValue, arg0: str) None#
to_json(self: samna.speck2b.event.ReadMemoryValue) str#
class samna.speck2b.event.ReadNeuronValue#

Bases: pybind11_object

An event that will create a read request for a neuron state value.

The tag property will be included in the NeuronValue event that will be generated as a response. This is useful because speck2b does not guarantee that read requests will be responded to in the order they were received.

property address#

The address of the neuron to read from in its layer.

from_json(self: samna.speck2b.event.ReadNeuronValue, arg0: str) None#
property layer#

The layer containing the neuron to be read from

property monitor_tag#

The tag will be used for the read response event

to_json(self: samna.speck2b.event.ReadNeuronValue) str#
class samna.speck2b.event.ReadRegisterValue#

Bases: pybind11_object

An event that will create a register read request.

This event is used for low level operations and should not be needed under normal conditions.

from_json(self: samna.speck2b.event.ReadRegisterValue, arg0: str) None#
to_json(self: samna.speck2b.event.ReadRegisterValue) str#
class samna.speck2b.event.ReadWeightValue#

Bases: pybind11_object

An event that will create a read request for a weight value.

The tag property will be included in the WeightValue event that will be generated as a response. This is useful because speck2b does not guarantee that read requests will be responded to in the order they were received.

property address#

The address of the weight to read from in its layer.

from_json(self: samna.speck2b.event.ReadWeightValue, arg0: str) None#
property layer#

The layer containing the weight to be read from

property monitor_tag#

The tag will be used for the read response event

to_json(self: samna.speck2b.event.ReadWeightValue) str#
class samna.speck2b.event.RegisterValue#

Bases: pybind11_object

A response to a register value read request.

This event is used for low level operations and should not be needed under normal conditions.

from_json(self: samna.speck2b.event.RegisterValue, arg0: str) None#
to_json(self: samna.speck2b.event.RegisterValue) str#
class samna.speck2b.event.RouterEvent#

Bases: pybind11_object

A speck2b event type that will be injected into the on-chip event router.

The layer, feature, x, y properties determine the neuron that will receive the event.

RouterEvents can only be injected. When speck2b produces events they will be of type Spike. RouterEvents also do not contain a timestamp. If timestamps are needed, use the Spike event type.

property feature#

The feature that will receive this event.

from_json(self: samna.speck2b.event.RouterEvent, arg0: str) None#
property layer#

The layer that will receive this event.

to_json(self: samna.speck2b.event.RouterEvent) str#
property x#

The x coordinate that will receive this event.

property y#

The y coordinate that will receive this event.

class samna.speck2b.event.Spike#

Bases: pybind11_object

Spikes are events that can be consumed and produced by speck2b.

When sending spike events to speck2b, the properties will be interpreted as the destination layer, feature, x, y that should receive the event. The timestamp property will be used to inject the event into speck2b when the external event sequencer timestamp is equal to or greater than the event timestamp.

When receing spike events from speck2b the properties should be interpreted as the layer, feature, x, y neuron that generated the spike. The timestamp parameter is the timestamp at which speck2b sent out the event.

property feature#

Target/producing feature.

from_json(self: samna.speck2b.event.Spike, arg0: str) None#
property layer#

Target/producing layer.

property timestamp#

When receiving a Spike event from a chip the timestamp will be populated with the time at which the event leave the chip.

When sending a Spike event to a chip the timestamp will be used to control when the event will be applied to the chip.

to_json(self: samna.speck2b.event.Spike) str#
property x#

Target/producing x coordinate.

property y#

Target/producing y coordinate.

class samna.speck2b.event.WeightValue#

Bases: pybind11_object

A response to a kernel weight value read request.

from_json(self: samna.speck2b.event.WeightValue, arg0: str) None#
property kill#

If True then this weight value is disabled.

property monitor_tag#

The monitor_tag of the read request event that generated this read response.

to_json(self: samna.speck2b.event.WeightValue) str#
property weight#

The queried weight value

class samna.speck2b.event.WriteBiasValue#

Bases: pybind11_object

An event that will write a bias value.

This event is used for low level operations. Biases will be written automatically when a configuration is applied. Prefer using the configuration whenever possible.

property address#

The address of the bias that will be written to.

property bias#

The bias value to write

from_json(self: samna.speck2b.event.WriteBiasValue, arg0: str) None#
property kill#

If true, disables this bias from being used.

property layer#

The layer containing the bias that will be written to.

to_json(self: samna.speck2b.event.WriteBiasValue) str#
class samna.speck2b.event.WriteFilterValue#

Bases: pybind11_object

Set filter count value at a location.

property data#

new filter count value.

from_json(self: samna.speck2b.event.WriteFilterValue, arg0: str) None#
to_json(self: samna.speck2b.event.WriteFilterValue) str#
property x#

X location

property y#

Y location

class samna.speck2b.event.WriteMemoryValue#

Bases: pybind11_object

An event that will write a memory value.

This event is used for low level operations. Memory will be written automatically when a configuration is applied. Prefer using the configuration whenever possible.

from_json(self: samna.speck2b.event.WriteMemoryValue, arg0: str) None#
to_json(self: samna.speck2b.event.WriteMemoryValue) str#
class samna.speck2b.event.WriteNeuronValue#

Bases: pybind11_object

An event that will write the neuron state value of a single neuron.

This event is used for low level operations. Initial neuron state values will be written automatically when a configuration is applied. Prefer using the configuration whenever possible.

property address#

The address of the neuron to be written to

from_json(self: samna.speck2b.event.WriteNeuronValue, arg0: str) None#
property kill#

If true, disables this neuron state value from being used

property layer#

The layer containing the neuron to be written to

property neuron_state#

The value which will be written to the neuron state address

to_json(self: samna.speck2b.event.WriteNeuronValue) str#
class samna.speck2b.event.WriteRegisterValue#

Bases: pybind11_object

An event that will write a register value.

This event is used for low level operations. Registers will be written automatically when a configuration is applied. Prefer using the configuration whenever possible.

from_json(self: samna.speck2b.event.WriteRegisterValue, arg0: str) None#
to_json(self: samna.speck2b.event.WriteRegisterValue) str#
class samna.speck2b.event.WriteWeightValue#

Bases: pybind11_object

An event that will write a kernel weight.

This event is used for low level operations. Kernel weights will be written automatically when a configuration is applied. Prefer using the configuration whenever possible.

property address#

The address of the kernel that will be written to.

from_json(self: samna.speck2b.event.WriteWeightValue, arg0: str) None#
property kill#

If true, disables this kernel weight from being used.

property layer#

The layer containing the kernel weight that will be written to.

to_json(self: samna.speck2b.event.WriteWeightValue) str#
property weight#

The weight value to write

samna.speck2b.event.assemble_request_to_match_events(arg0: bool, arg1: List[samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue]) Tuple[bool, List[samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue]]#

Assemble the request to match events.

Parameters:
  • isContextSensitiveEventActive (bool) – Whether the context sensitive event is active.

  • events (speck2b.event.InputEvent) – The events to assemble.

Returns:

A list of input events.

samna.speck2b.event.decode_context_sensitive_event(arg0: samna.speck2b.event.ContextSensitiveEvent, arg1: samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue) samna.speck2b.event.Spike | samna.speck2b.event.DvsEvent | samna.speck2b.event.InputInterfaceEvent | samna.speck2b.event.S2PMonitorEvent | samna.speck2b.event.NeuronValue | samna.speck2b.event.BiasValue | samna.speck2b.event.WeightValue | samna.speck2b.event.RegisterValue | samna.speck2b.event.MemoryValue | samna.speck2b.event.ReadoutValue | samna.speck2b.event.ContextSensitiveEvent | samna.speck2b.event.FilterDvsEvent | samna.speck2b.event.FilterValueCurrent | samna.speck2b.event.FilterValuePrevious | samna.speck2b.event.ScanChainValue#

Decodes a context sensitive event.

Parameters:
  • event (speck2b.event.ContextSensitiveEvent) – The event to decode.

  • requestToMatch (speck2b.event.InputEvent) – The request to match.

Returns:

The decoded event.

samna.speck2b.event.decode_context_sensitive_event_as_readout_event(arg0: samna.speck2b.event.ContextSensitiveEvent) samna.speck2b.event.Spike | samna.speck2b.event.DvsEvent | samna.speck2b.event.InputInterfaceEvent | samna.speck2b.event.S2PMonitorEvent | samna.speck2b.event.NeuronValue | samna.speck2b.event.BiasValue | samna.speck2b.event.WeightValue | samna.speck2b.event.RegisterValue | samna.speck2b.event.MemoryValue | samna.speck2b.event.ReadoutValue | samna.speck2b.event.ContextSensitiveEvent | samna.speck2b.event.FilterDvsEvent | samna.speck2b.event.FilterValueCurrent | samna.speck2b.event.FilterValuePrevious | samna.speck2b.event.ScanChainValue#

Decodes a context sensitive event into a readout event.

Parameters:

event (speck2b.event.ContextSensitiveEvent) – The event to decode.

Returns:

The decoded readout event.

samna.speck2b.event.decode_input_interface_events(arg0: List[int]) List[samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue]#

Decodes input interface events.

Parameters:

events (int) – The events to decode.

Returns:

The decoded input events.

samna.speck2b.event.decode_output_event(arg0: int) samna.speck2b.event.Spike | samna.speck2b.event.DvsEvent | samna.speck2b.event.InputInterfaceEvent | samna.speck2b.event.S2PMonitorEvent | samna.speck2b.event.NeuronValue | samna.speck2b.event.BiasValue | samna.speck2b.event.WeightValue | samna.speck2b.event.RegisterValue | samna.speck2b.event.MemoryValue | samna.speck2b.event.ReadoutValue | samna.speck2b.event.ContextSensitiveEvent | samna.speck2b.event.FilterDvsEvent | samna.speck2b.event.FilterValueCurrent | samna.speck2b.event.FilterValuePrevious | samna.speck2b.event.ScanChainValue#

Decodes an output event.

Parameters:

rawEvent (int) – The event to decode.

Returns:

The decoded output event.

samna.speck2b.event.encode_input_interface_events(arg0: List[samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue]) Tuple[List[int], List[int], List[int]]#

Encodes input interface events.

Parameters:

events (speck2b.event.InputEvent) – The events to encode.

Returns:

A tuple containing configuration, normal and raw packets.

samna.speck2b.event.speck_configuration_to_event(arg0: samna.speck2b.configuration.SpeckConfiguration) List[samna.speck2b.event.Spike | samna.speck2b.event.RouterEvent | samna.speck2b.event.DvsEvent | samna.speck2b.event.KillSensorPixel | samna.speck2b.event.ResetSensorPixel | samna.speck2b.event.WriteNeuronValue | samna.speck2b.event.ReadNeuronValue | samna.speck2b.event.WriteWeightValue | samna.speck2b.event.ReadWeightValue | samna.speck2b.event.WriteBiasValue | samna.speck2b.event.ReadBiasValue | samna.speck2b.event.WriteRegisterValue | samna.speck2b.event.ReadRegisterValue | samna.speck2b.event.WriteMemoryValue | samna.speck2b.event.ReadMemoryValue | samna.speck2b.event.WriteFilterValue | samna.speck2b.event.ReadFilterValue | samna.speck2b.event.OutputNeuronSel | samna.speck2b.event.OutputModeSel | samna.speck2b.event.ScanChainValue]#

Get the input events for the given Speck configuration.

Parameters:

config (speck2b.configuration.SpeckConfiguration) – The configuration to turn into events.

Returns:

A list of input events.