samna.speck2e.event#

Submodules#

Module content#

class samna.speck2e.event.AverageSel#

Bases: pybind11_object

Set the average select of readout layer through async serial interface.

This should be set through SPI usually.

property average_sel#

The average select.

from_json(self: samna.speck2e.event.AverageSel, arg0: str) None#
to_json(self: samna.speck2e.event.AverageSel) str#
class samna.speck2e.event.BiasValue#

Bases: pybind11_object

A response to a bias value read request.

property address#

The address of the bias.

property bias#

The value of the bias.

from_json(self: samna.speck2e.event.BiasValue, arg0: str) None#
property layer#

The layer of the bias.

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

Bases: pybind11_object

The DVS event for Speck 2e.

On Speck 2e these events can only be sent to the DVS preprocessing layer.

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

Polarity

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

X location

property y#

Y location

class samna.speck2e.event.FilterDvsEvent#

Bases: pybind11_object

The X/Y/Polarity information for the internally generated Counter update in memory

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

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

The polarity.

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

The x coordinate.

property y#

The y coordinate.

class samna.speck2e.event.FilterValue#

Bases: pybind11_object

A response to a filter sram value read request.

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

property counter_data#

The filter sram value.

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

The x coordinate.

property y#

The y coordinate.

class samna.speck2e.event.FilterValueCurrent#

Bases: pybind11_object

The current Counter value of the original event received from the Event Pre-Processing Layer.

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

property counter_data#

The current counter value.

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

Bases: pybind11_object

The previous Counter value at the location X/Y, i.e., the counter value stored in the SRAM.

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

property counter_data#

The current counter value.

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

Bases: pybind11_object

Indicate to erase flash.

Only available under spi-bridge mode.

property address#

The address(24-bit) to erase.

from_json(self: samna.speck2e.event.FlashErase, arg0: str) None#
to_json(self: samna.speck2e.event.FlashErase) str#
property type#

Erase type shall be a value of speck2e.FlashEraseType: 1: erase a 4KB sector from address; 2: erase a 32KB block from address; 3: erase a 64KB block from address; 4: erase chip, address not use.

class samna.speck2e.event.FlashQueryStatus#

Bases: pybind11_object

Query flash status.

Only available under spi-bridge mode.

class samna.speck2e.event.FlashRead#

Bases: pybind11_object

Indicate to read data directly from flash.

Only available under spi-bridge mode.

property address#

The address(24-bit) to read.

from_json(self: samna.speck2e.event.FlashRead, arg0: str) None#
to_json(self: samna.speck2e.event.FlashRead) str#
class samna.speck2e.event.FlashSpiRaw#

Bases: pybind11_object

Raw byte stream to send to DI pin.

Only available under spi-bridge mode.

from_json(self: samna.speck2e.event.FlashSpiRaw, arg0: str) None#
property raw_data#

Raw byte stream.

to_json(self: samna.speck2e.event.FlashSpiRaw) str#
class samna.speck2e.event.FlashStatus#

Bases: pybind11_object

Status of flash, value is one of speck2e.FlashStatusType.

Only available under spi-bridge mode.

from_json(self: samna.speck2e.event.FlashStatus, arg0: str) None#
to_json(self: samna.speck2e.event.FlashStatus) str#
class samna.speck2e.event.FlashValue#

Bases: pybind11_object

Data read directly from flash.

property address#

The address(24-bit) read from.

property data#

The data read from the address.

from_json(self: samna.speck2e.event.FlashValue, arg0: str) None#
to_json(self: samna.speck2e.event.FlashValue) str#
class samna.speck2e.event.FlashWrite#

Bases: pybind11_object

Indicate to write data to state register.

Only available under spi-bridge mode.

property address#

The address(24-bit) to write.

property data#

The data(24-bit) to write.

from_json(self: samna.speck2e.event.FlashWrite, arg0: str) None#
to_json(self: samna.speck2e.event.FlashWrite) str#
class samna.speck2e.event.FlashWriteEnable#

Bases: pybind11_object

Enable writing.

Only available under spi-bridge mode.

class samna.speck2e.event.Frame#

Bases: pybind11_object

DVP frame data.

property data#

The frame data.

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

Bases: pybind11_object

InputInterface events are returned from the Speck 2e when monitor_input_enable = True.

The Speck 2e has an asynchronous bus interface which may be configured to echo events received by the asynchronous bus.

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

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

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

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

Encoded event value.

class samna.speck2e.event.KillSensorPixel#

Bases: pybind11_object

KillSensorPixel are used to disable a particular pixel in the DVS array.

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

The x coorinate of the pixel to be killed.

property y#

The y coorinate of the pixel to be killed.

class samna.speck2e.event.NeuronValue#

Bases: pybind11_object

A response to a neuron value read request.

property address#

The address of the neuron.

from_json(self: samna.speck2e.event.NeuronValue, arg0: str) None#
property layer#

The layer of the neuron.

property neuron_state#

The value of the neuron.

to_json(self: samna.speck2e.event.NeuronValue) str#
class samna.speck2e.event.OutputModeSel#

Bases: pybind11_object

Set the output mode of readout layer through async serial interface.

This should be set through SPI usually.

from_json(self: samna.speck2e.event.OutputModeSel, arg0: str) None#
property mode_sel#

The output mode.

to_json(self: samna.speck2e.event.OutputModeSel) str#
class samna.speck2e.event.ReadBiasValue#

Bases: pybind11_object

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

property address#

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

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

The layer containing the bias to be read from

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

Bases: pybind11_object

Read filter sram value at a coordinate.

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

The x coordinate

property y#

The y coordinate

class samna.speck2e.event.ReadNeuronValue#

Bases: pybind11_object

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

property address#

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

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

The layer containing the neuron to be read from

to_json(self: samna.speck2e.event.ReadNeuronValue) str#
class samna.speck2e.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.

property address#

The address of the register to be read.

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

Bases: pybind11_object

Read a byte from one sram address.

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

property address#

The sram address.

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

Bases: pybind11_object

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

property address#

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

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

The layer containing the weight to be read from

to_json(self: samna.speck2e.event.ReadWeightValue) str#
class samna.speck2e.event.ReadoutPinValue#

Bases: pybind11_object

The readout pins events of Speck 2e.

from_json(self: samna.speck2e.event.ReadoutPinValue, arg0: str) None#
property index#

The value of the readout pins, represent the neuron index of max average

property timestamp#

Timestamp of the event

to_json(self: samna.speck2e.event.ReadoutPinValue) str#
class samna.speck2e.event.ReadoutValue#

Bases: pybind11_object

The readout events of Speck 2e.

from_json(self: samna.speck2e.event.ReadoutValue, arg0: str) None#
to_json(self: samna.speck2e.event.ReadoutValue) str#
property value#

The value of the readout, needs to be decoded according to how you set the output_mod_sel of ReadoutConfig.

class samna.speck2e.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.

property address#

The address of the register.

property data#

The value of the register.

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

Bases: pybind11_object

The event to monitor the SPI bus. For debug only.

class samna.speck2e.event.ResetSensorPixel#

Bases: pybind11_object

Enable all pixels in the DVS array.

class samna.speck2e.event.SpiMon#

Bases: pybind11_object

The readout pins events of Speck 2e.

property data#

The result of RequestSpiMon.

from_json(self: samna.speck2e.event.SpiMon, arg0: str) None#
to_json(self: samna.speck2e.event.SpiMon) str#
class samna.speck2e.event.Spike#

Bases: pybind11_object

Spikes are events that can be consumed and produced by Speck 2e.

When sending spike events to Speck 2e, 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 Speck 2e when the external event sequencer timestamp is equal to or greater than the event timestamp.

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

property feature#

Target/producing feature.

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

Target layer if it is an input, producing layer if it is an output. As a target layer, it can be [0, 8] which stands for the 9 CNN layers if you want to inject spikes into one of the CNN layers, or 12 if you want to send to the readout layers. If it is an output, the layer in [0, 8] represents the output CNN layer, layer 13 means it is an output from the DVS pre-processing layer if you enabled the monitor_enable.

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.speck2e.event.Spike) str#
property x#

Target/producing x coordinate.

property y#

Target/producing y coordinate.

class samna.speck2e.event.SramValue#

Bases: pybind11_object

A response to a sram value read request.

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

property address#

The sram address.

property data#

The sram value.

from_json(self: samna.speck2e.event.SramValue, arg0: str) None#
to_json(self: samna.speck2e.event.SramValue) str#
class samna.speck2e.event.WeightValue#

Bases: pybind11_object

A response to a kernel weight value read request.

property address#

The address of the kernel weight.

from_json(self: samna.speck2e.event.WeightValue, arg0: str) None#
property layer#

The layer of the kernel weight.

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

The value of the kernel weight.

class samna.speck2e.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.speck2e.event.WriteBiasValue, arg0: str) None#
property layer#

The layer containing the bias that will be written to.

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

Bases: pybind11_object

Set filter counter value at a location.

property data#

The filter counter value

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

X coordinate

property y#

Y coordinate

class samna.speck2e.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.speck2e.event.WriteNeuronValue, arg0: str) None#
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.speck2e.event.WriteNeuronValue) str#
class samna.speck2e.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.

property address#

The address of the register to be written.

property data#

The value to be written

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

Bases: pybind11_object

Write a byte to one sram address.

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

property address#

The sram address.

property data#

The sram value.

from_json(self: samna.speck2e.event.WriteSramValue, arg0: str) None#
to_json(self: samna.speck2e.event.WriteSramValue) str#
class samna.speck2e.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.speck2e.event.WriteWeightValue, arg0: str) None#
property layer#

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

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

The weight value to write

samna.speck2e.event.compute_sram_address(arg0: samna.speck2e.event.Spike | samna.speck2e.event.DvsEvent | samna.speck2e.event.KillSensorPixel | samna.speck2e.event.ResetSensorPixel | samna.speck2e.event.OutputModeSel | samna.speck2e.event.AverageSel | samna.speck2e.event.AsiRequest | samna.speck2e.event.ReadoutRequest | samna.speck2e.event.ScanChainValue | samna.speck2e.event.WriteNeuronValue | samna.speck2e.event.ReadNeuronValue | samna.speck2e.event.WriteWeightValue | samna.speck2e.event.ReadWeightValue | samna.speck2e.event.WriteBiasValue | samna.speck2e.event.ReadBiasValue | samna.speck2e.event.WriteRegisterValue | samna.speck2e.event.ReadRegisterValue | samna.speck2e.event.WriteFilterValue | samna.speck2e.event.ReadFilterValue | samna.speck2e.event.WriteSramValue | samna.speck2e.event.ReadSramValue | samna.speck2e.event.IdCodeRequest | samna.speck2e.event.FlashRead | samna.speck2e.event.FlashWrite | samna.speck2e.event.FlashErase | samna.speck2e.event.FlashSpiRaw | samna.speck2e.event.FlashWriteEnable | samna.speck2e.event.FlashQueryStatus | samna.speck2e.event.RequestSpiMon | samna.speck2e.event.Frame) int | None#

Compute the address of the a given event in the SRAM.

Parameters:

event (speck2e.event.Speck2eInputEvent) – The event to compute the address for.

Returns:

The address of the event in the SRAM if it’s possible to compute the address, otherwise return None.

samna.speck2e.event.compute_sram_address_t(arg0: samna.speck2e.event.Spike | samna.speck2e.event.DvsEvent | samna.speck2e.event.KillSensorPixel | samna.speck2e.event.ResetSensorPixel | samna.speck2e.event.OutputModeSel | samna.speck2e.event.AverageSel | samna.speck2e.event.AsiRequest | samna.speck2e.event.ReadoutRequest | samna.speck2e.event.ScanChainValue | samna.speck2e.event.WriteNeuronValue | samna.speck2e.event.ReadNeuronValue | samna.speck2e.event.WriteWeightValue | samna.speck2e.event.ReadWeightValue | samna.speck2e.event.WriteBiasValue | samna.speck2e.event.ReadBiasValue | samna.speck2e.event.WriteRegisterValue | samna.speck2e.event.ReadRegisterValue | samna.speck2e.event.WriteFilterValue | samna.speck2e.event.ReadFilterValue | samna.speck2e.event.WriteSramValue | samna.speck2e.event.ReadSramValue | samna.speck2e.event.IdCodeRequest | samna.speck2e.event.FlashRead | samna.speck2e.event.FlashWrite | samna.speck2e.event.FlashErase | samna.speck2e.event.FlashSpiRaw | samna.speck2e.event.FlashWriteEnable | samna.speck2e.event.FlashQueryStatus | samna.speck2e.event.RequestSpiMon) int | None#

Compute the address of the a given event in the SRAM.

Parameters:

event (speck2e.event.Speck2etInputEvent) – The event to compute the address for.

Returns:

The address of the event in the SRAM if it’s possible to compute the address, otherwise return None.

samna.speck2e.event.determine_sram_eventrom_address(arg0: int) samna.speck2e.event.Spike | samna.speck2e.event.DvsEvent | samna.speck2e.event.InputInterfaceEvent | samna.speck2e.event.NeuronValue | samna.speck2e.event.BiasValue | samna.speck2e.event.WeightValue | samna.speck2e.event.RegisterValue | samna.speck2e.event.ReadoutValue | samna.speck2e.event.FilterValue | samna.speck2e.event.SramValue | samna.speck2e.event.FilterDvsEvent | samna.speck2e.event.FilterValueCurrent | samna.speck2e.event.FilterValuePrevious | samna.speck2e.event.ScanChainValue | samna.speck2e.event.IdCode | samna.speck2e.event.FlashValue | samna.speck2e.event.FlashSpiRaw | samna.speck2e.event.FlashStatus | samna.speck2e.event.ReadoutPinValue | samna.speck2e.event.SpiMon#

Determine the SRAM event for the given address.

Parameters:

address (int) – The address to determine the event for.

Returns:

The event for the given address.