Skip to content

A three-layer LIF neuron SNN accelerator. The first layer is the input layer and has 784 neurons, that receive the encoded spikes. The second layer is the hidden layer and has 100 neurons; the last layer is the output layer with 10 neurons.

Notifications You must be signed in to change notification settings

ycy012/SNN-Accelerator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

SNN-Accelerator

A three-layer LIF neuron SNN accelerator. The first layer is the input layer and has 784 neurons, that receive the encoded spikes. The second layer is the hidden layer and has 100 neurons; the last layer is the output layer with 10 neurons.

Design Spec

The following figure is my block diagram. It takes one image as input at a time, and by modifying the IMAGE in the testbench, different images can be used to obtain test results. There are several registers in the top module, which differ from those provided by the teaching assistant. Designspec

(1) en_compute_FC1

The input trigger is used to start computing FC1. When en_compute_FC1 = 1, start to compute the output spike in the hidden layer.

(2) en_compute_FC1_finish

The output trigger is used to start checking the answer of FC1. When en_compute_FC1_finish = 1, start to check the answer of the output spike in the hidden layer.

(3) en_compute_FC2

The input trigger is used to start computing FC2. When en_compute_FC2 = 1, start to compute the output spike in the output layer.

(4) en_compute_FC2_finish

The output trigger is used to start checking the answer of FC2. When en_compute_FC2_finish = 1, start to check the answer of the output spike in the output layer.

FSM

The following figure is the FSM of the whole system. The inside controllers of FC1/FC2 are the same. The timestep of each image is the most important part of the whole system. Because we need to use the membranes of the previous timestep, so we need to save them for each timestep. I used several counters to count the timesteps and the address of SRAM A and SRAM B. FSM

Membranes Potential

timestep

The total timesteps I chose is 35. First, divide the timesteps into 0 and 1-34. In the simulation of the software, in the first layer, Vth = 68, and in the second layer, Vth = 91. I use the following formula to calculate mem: timestep0

In timestep 1 to 34, I need to use the membranes after resetting from the previous timestep. So, in timestep 0, I first output and record the reset membranes in the top module. When I reach timestep 1, I then input these values. timestep1to34

About

A three-layer LIF neuron SNN accelerator. The first layer is the input layer and has 784 neurons, that receive the encoded spikes. The second layer is the hidden layer and has 100 neurons; the last layer is the output layer with 10 neurons.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Verilog 100.0%