samna.dynapcnn.event#
Submodules#
Module content#
- class samna.dynapcnn.event.BiasValue#
Bases:
pybind11_object
A response to a bias value read request.
- property bias#
The queried bias value.
- from_json(self: samna.dynapcnn.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.
- property timestamp#
timestamp at which the bias read reponse event exited the chip.
- to_json(self: samna.dynapcnn.event.BiasValue) str #
- class samna.dynapcnn.event.DvsEvent#
Bases:
pybind11_object
Represents events that DYNAP-CNN will understand as a DVS event.
On DYNAP-CNN these events can only be sent to the DVS preprocessing layer.
- from_json(self: samna.dynapcnn.event.DvsEvent, arg0: str) None #
- property layer#
Ignored on DYNAP-CNN
- property p#
Polarity
- property timestamp#
- to_json(self: samna.dynapcnn.event.DvsEvent) str #
- property x#
X location
- property y#
Y location
- class samna.dynapcnn.event.InputInterfaceEvent#
Bases:
pybind11_object
InputInterface events are returned from the DYNAP-CNN when echoing is enabled.
The DYNAP-CNN 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.dynapcnn.event.InputInterfaceEvent, arg0: str) None #
- property msp#
True if this event is a most significant word part, false otherwise.
- property timestamp#
Time in microseconds when the event was emitted.
- to_json(self: samna.dynapcnn.event.InputInterfaceEvent) str #
- property value#
Encoded event value.
- class samna.dynapcnn.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.dynapcnn.event.MemoryValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.MemoryValue) str #
- class samna.dynapcnn.event.NeuronValue#
Bases:
pybind11_object
A response to a neuron value read request.
- from_json(self: samna.dynapcnn.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.
- property timestamp#
timestamp at which the read reponse event exited the chip.
- to_json(self: samna.dynapcnn.event.NeuronValue) str #
- class samna.dynapcnn.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 DYNAP-CNN 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.dynapcnn.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.dynapcnn.event.ReadBiasValue) str #
- class samna.dynapcnn.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.dynapcnn.event.ReadMemoryValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.ReadMemoryValue) str #
- class samna.dynapcnn.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 DYNAP-CNN 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.dynapcnn.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.dynapcnn.event.ReadNeuronValue) str #
- class samna.dynapcnn.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.dynapcnn.event.ReadRegisterValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.ReadRegisterValue) str #
- class samna.dynapcnn.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 DYNAP-CNN 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.dynapcnn.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.dynapcnn.event.ReadWeightValue) str #
- class samna.dynapcnn.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.dynapcnn.event.RegisterValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.RegisterValue) str #
- class samna.dynapcnn.event.RouterEvent#
Bases:
pybind11_object
A DYNAP-CNN 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 DYNAP-CNN 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.dynapcnn.event.RouterEvent, arg0: str) None #
- property layer#
The layer that will receive this event.
- to_json(self: samna.dynapcnn.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.dynapcnn.event.Spike#
Bases:
pybind11_object
Spikes are events that can be consumed and produced by DYNAP-CNN.
When sending spike events to DYNAP-CNN, 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 DYNAP-CNN when the external event sequencer timestamp is equal to or greater than the event timestamp.
When receing spike events from DYNAP-CNN the properties should be interpreted as the layer, feature, x, y neuron that generated the spike. The timestamp parameter is the timestamp at which DYNAP-CNN sent out the event.
- property feature#
Target/producing feature.
- from_json(self: samna.dynapcnn.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.dynapcnn.event.Spike) str #
- property x#
Target/producing x coordinate.
- property y#
Target/producing y coordinate.
- class samna.dynapcnn.event.WeightValue#
Bases:
pybind11_object
A response to a kernel weight value read request.
- from_json(self: samna.dynapcnn.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.
- property timestamp#
timestamp at which the weight read response exited the chip
- to_json(self: samna.dynapcnn.event.WeightValue) str #
- property weight#
The queried weight value
- class samna.dynapcnn.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.dynapcnn.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.dynapcnn.event.WriteBiasValue) str #
- class samna.dynapcnn.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.dynapcnn.event.WriteMemoryValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.WriteMemoryValue) str #
- class samna.dynapcnn.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.dynapcnn.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.dynapcnn.event.WriteNeuronValue) str #
- class samna.dynapcnn.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.dynapcnn.event.WriteRegisterValue, arg0: str) None #
- to_json(self: samna.dynapcnn.event.WriteRegisterValue) str #
- class samna.dynapcnn.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.dynapcnn.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.dynapcnn.event.WriteWeightValue) str #
- property weight#
The weight value to write
- samna.dynapcnn.event.decode_input_event(arg0: int, arg1: bool) samna.dynapcnn.event.Spike | samna.dynapcnn.event.RouterEvent | samna.dynapcnn.event.KillSensorPixel | samna.dynapcnn.event.ResetSensorPixel | samna.dynapcnn.event.WriteNeuronValue | samna.dynapcnn.event.ReadNeuronValue | samna.dynapcnn.event.WriteWeightValue | samna.dynapcnn.event.ReadWeightValue | samna.dynapcnn.event.WriteBiasValue | samna.dynapcnn.event.ReadBiasValue | samna.dynapcnn.event.WriteRegisterValue | samna.dynapcnn.event.ReadRegisterValue | samna.dynapcnn.event.WriteMemoryValue | samna.dynapcnn.event.ReadMemoryValue | samna.dynapcnn.event.ReadProbe #
Decodes an input event.
- Parameters:
rawEvent (int) – The event to decode.
hasTimestamp (bool) – Whether the event has a timestamp.
- Returns:
The decoded input event.
- samna.dynapcnn.event.decode_output_event(arg0: int) samna.dynapcnn.event.Spike | samna.dynapcnn.event.DvsEvent | samna.dynapcnn.event.InputInterfaceEvent | samna.dynapcnn.event.NeuronValue | samna.dynapcnn.event.BiasValue | samna.dynapcnn.event.WeightValue | samna.dynapcnn.event.RegisterValue | samna.dynapcnn.event.MemoryValue | samna.dynapcnn.event.BistValue | samna.dynapcnn.event.ProbeValue | samna.dynapcnn.event.ReadoutValue #
Decodes an output event.
- Parameters:
value (int) – The event to decode.
- Returns:
The decoded output event.
- samna.dynapcnn.event.dynapcnn_configuration_to_event(arg0: samna.dynapcnn.configuration.DynapcnnConfiguration) List[samna.dynapcnn.event.Spike | samna.dynapcnn.event.RouterEvent | samna.dynapcnn.event.KillSensorPixel | samna.dynapcnn.event.ResetSensorPixel | samna.dynapcnn.event.WriteNeuronValue | samna.dynapcnn.event.ReadNeuronValue | samna.dynapcnn.event.WriteWeightValue | samna.dynapcnn.event.ReadWeightValue | samna.dynapcnn.event.WriteBiasValue | samna.dynapcnn.event.ReadBiasValue | samna.dynapcnn.event.WriteRegisterValue | samna.dynapcnn.event.ReadRegisterValue | samna.dynapcnn.event.WriteMemoryValue | samna.dynapcnn.event.ReadMemoryValue | samna.dynapcnn.event.ReadProbe] #
Get the input events for the given configuration.
- Parameters:
config (
dynapcnn.configuration.DynapcnnConfiguration
) – The configuration to turn into events.- Returns:
A list of input events.
- samna.dynapcnn.event.encode_input_interface_event(arg0: samna.dynapcnn.event.Spike | samna.dynapcnn.event.RouterEvent | samna.dynapcnn.event.KillSensorPixel | samna.dynapcnn.event.ResetSensorPixel | samna.dynapcnn.event.WriteNeuronValue | samna.dynapcnn.event.ReadNeuronValue | samna.dynapcnn.event.WriteWeightValue | samna.dynapcnn.event.ReadWeightValue | samna.dynapcnn.event.WriteBiasValue | samna.dynapcnn.event.ReadBiasValue | samna.dynapcnn.event.WriteRegisterValue | samna.dynapcnn.event.ReadRegisterValue | samna.dynapcnn.event.WriteMemoryValue | samna.dynapcnn.event.ReadMemoryValue | samna.dynapcnn.event.ReadProbe) int #
Encodes an input interface event.
- Parameters:
event (
dynapcnn.event.InputEvent
) – The event to encode.- Returns:
The encoded event.