This Verilog module, , is designed to model a layer of spiking neurons in hardware. It integrates various inputs such as clock signals, resets, and neuron parameters to manage a layer of three spiking neurons. Here’s a breakdown of the module and its components:
Module Inputs and Outputs
Inputs:clk: The clock signal for synchronizing the operation.reset: Asynchronous reset signal, which is active high.enable: A control signal to enable or disable updating of the neurons.input_spikes: A 3-bit wide input representing spikes that are common inputs to all neurons.input_weights: A 72-bit input, containing concatenated weights for each of the three neurons.neuron_params: A 32-bit input that packs the parameters for neuron operation, such as threshold, decay, refractory period, and feedback scale.
clk: The clock signal for synchronizing the operation.
reset: Asynchronous reset signal, which is active high.
enable: A control signal to enable or disable updating of the neurons.
input_spikes: A 3-bit wide input representing spikes that are common inputs to all neurons.
input_weights: A 72-bit input, containing concatenated weights for each of the three neurons.
neuron_params: A 32-bit input that packs the parameters for neuron operation, such as threshold, decay, refractory period, and feedback scale.
Outputs:spike_out: A 3-bit output where each bit represents the spike output from each neuron.
spike_out: A 3-bit output where each bit represents the spike output from each neuron.
Inputs:
clk: The clock signal for synchronizing the operation.
reset: Asynchronous reset signal, which is active high.
enable: A control signal to enable or disable updating of the neurons.
input_spikes: A 3-bit wide input representing spikes that are common inputs to all neurons.
input_weights: A 72-bit input, containing concatenated weights for each of the three neurons.
neuron_params: A 32-bit input that packs the parameters for neuron operation, such as threshold, decay, refractory period, and feedback scale.
clk: The clock signal for synchronizing the operation.
reset: Asynchronous reset signal, which is active high.
enable: A control signal to enable or disable updating of the neurons.
input_spikes: A 3-bit wide input representing spikes that are common inputs to all neurons.
input_weights: A 72-bit input, containing concatenated weights for each of the three neurons.
neuron_params: A 32-bit input that packs the parameters for neuron operation, such as threshold, decay, refractory period, and feedback scale.
Outputs:
spike_out: A 3-bit output where each bit represents the spike output from each neuron.
spike_out: A 3-bit output where each bit represents the spike output from each neuron.
Internal Signal Processing
Parameter Extraction:The 32-bitneuron_paramsinput is split into four 8-bit segments to individually represent each neuron's threshold, decay, refractory period, and feedback scale.
The 32-bitneuron_paramsinput is split into four 8-bit segments to individually represent each neuron's threshold, decay, refractory period, and feedback scale.
Weight Extraction:Theinput_weightsvector is partitioned into 8-bit segments, each representing a specific weight for an interaction between an input spike and a neuron.
Theinput_weightsvector is partitioned into 8-bit segments, each representing a specific weight for an interaction between an input spike and a neuron.
Current Calculation:For each neuron, an intermediate current is computed based on the input spikes and their corresponding weights. This computation considers the spike input presence (1or0) and the corresponding weight value, resulting in a signed extension for appropriate handling of the resulting current value.
For each neuron, an intermediate current is computed based on the input spikes and their corresponding weights. This computation considers the spike input presence (1or0) and the corresponding weight value, resulting in a signed extension for appropriate handling of the resulting current value.
Current Clamping:The computed intermediate current for each neuron is clamped to ensure it stays within the 8-bit signed range, from -128 to 127. This step prevents overflow and underflow, making sure the output fits within hardware limits.
The computed intermediate current for each neuron is clamped to ensure it stays within the 8-bit signed range, from -128 to 127. This step prevents overflow and underflow, making sure the output fits within hardware limits.
Neuron Instantiation:Three instances ofRecurrentSpikingNeuronare created, each corresponding to one of the neurons in the layer. These instances are fed with the computed and clamped currents, along with shared parameters fromneuron_params. Each instance outputs its spike signal.
Three instances ofRecurrentSpikingNeuronare created, each corresponding to one of the neurons in the layer. These instances are fed with the computed and clamped currents, along with shared parameters fromneuron_params. Each instance outputs its spike signal.
Parameter Extraction:
The 32-bitneuron_paramsinput is split into four 8-bit segments to individually represent each neuron's threshold, decay, refractory period, and feedback scale.
The 32-bitneuron_paramsinput is split into four 8-bit segments to individually represent each neuron's threshold, decay, refractory period, and feedback scale.
Weight Extraction:
Theinput_weightsvector is partitioned into 8-bit segments, each representing a specific weight for an interaction between an input spike and a neuron.
Theinput_weightsvector is partitioned into 8-bit segments, each representing a specific weight for an interaction between an input spike and a neuron.
Current Calculation:
For each neuron, an intermediate current is computed based on the input spikes and their corresponding weights. This computation considers the spike input presence (1or0) and the corresponding weight value, resulting in a signed extension for appropriate handling of the resulting current value.
For each neuron, an intermediate current is computed based on the input spikes and their corresponding weights. This computation considers the spike input presence (1or0) and the corresponding weight value, resulting in a signed extension for appropriate handling of the resulting current value.
Current Clamping:
The computed intermediate current for each neuron is clamped to ensure it stays within the 8-bit signed range, from -128 to 127. This step prevents overflow and underflow, making sure the output fits within hardware limits.
The computed intermediate current for each neuron is clamped to ensure it stays within the 8-bit signed range, from -128 to 127. This step prevents overflow and underflow, making sure the output fits within hardware limits.
Neuron Instantiation:
Three instances ofRecurrentSpikingNeuronare created, each corresponding to one of the neurons in the layer. These instances are fed with the computed and clamped currents, along with shared parameters fromneuron_params. Each instance outputs its spike signal.
Three instances ofRecurrentSpikingNeuronare created, each corresponding to one of the neurons in the layer. These instances are fed with the computed and clamped currents, along with shared parameters fromneuron_params. Each instance outputs its spike signal.
Module Usage and Hardware Implementation
The module is designed for FPGA or ASIC implementations where timing, synchronization, and efficiency are critical. By using hardware to model spiking neuron behavior, the system can potentially achieve high-speed operation suitable for applications like real-time processing in neuromorphic computing systems.
This module effectively encapsulates neuron dynamics in a parallelizable and scalable architecture, making it suitable for complex neural network implementations in hardware.