Coder Social home page Coder Social logo

hazooree / lenet-cnn-accelerator-hardware-for-fpga Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 2.58 MB

An open source Verilog Based LeNet-1 Parallel CNNs Accelerator for FPGAs in Vivado 2017

Verilog 0.74% Coq 0.13% Jupyter Notebook 99.13%
verilog lenet handwritten-digit-recognition fpga cnn cnns acceleration

lenet-cnn-accelerator-hardware-for-fpga's Introduction

Systolic Array Based LeNet-CNN-Accelerator-for-FPGA

An open source Verilog Based LeNet-1 CNNs Accelerator for FPGAs. Trained weights of the model are in "W.mem" file in "Other-files" directory.

for more details on theory you can refer to https://arxiv.org/ftp/arxiv/papers/1901/1901.04986.pdf.

Please cite as: {Hazoor Ahmad, Muhammad Tanvir, Muhammad Abdullah, Muhammad Usama Javed, Rehan Hafiz, and Muhammad Shafique. "Systimator: A Design Space Exploration Methodology for Systolic Array based CNNs Acceleration on the FPGA-based Edge Nodes." arXiv preprint arXiv:1901.04986 (2018).}

How to run

Requirement:

Vivado 2017.1 or above (as I have used)

Procedure

  1. Make a new project in vivado
  2. Add files (Conv3D.v, FC.v, LeNet.v, MACC.v, Multiplication.v, PE.v, PE_Array.v, max2.v, softmax.v) from folder (Verilog-Source-Files) to your project as 'design sources'.
  3. Add file (tb_LeNet.v) from folder (Other-Files) to your project as 'simulation sources'.
  4. Add files (I0.mem, I1.mem, I2.mem, I3.mem, I4.mem, I5.mem, I6.mem, I7.mem, I8.mem, I9.mem, W.mem) from folder (Other-Files) to your project as 'design sources'.
  5. Change inputs from line 56 of LeNet.v in folder (Verilog-Source-Files). [like I4.mem instead of I3.mem]
  6. Before simulation confirm simulation time should be more than 10000ns to do it go to: Project Manager -> Settings -> Project Setting -> Simulation -> Find Simulation tab -> change xsim.simulate.runtime from 1000ns to 1000us Alt text

Alternatevly: You can directly run this command in 'tcl console'

set_property -name {xsim.simulate.runtime} -value {1000us} -objects [get_filesets sim_1]

7. Simulate and get the desired result

Details of work

LeNet-1 Network

LeNet-1 Architecture for handwritten digit recognition is given by Alt text

LeNet-1 Model Summary

Alt text

Systolic Array Based Hardware Architechture Design

Alt text

Controller

Alt text Alt text Alt text

Convolution Layer PE Array (5X6) Micro-Architecture

Alt text

Processing Element (PE) and MACC Units

Alt text

Fully Connected Layer Micro-Architecture

Alt text

Fast Softmax Micro-Architecture

Alt text

Results Before Softmax Layer (Keras Vs Vivado)

Alt text Alt text Alt text Alt text Alt text Alt text Alt text Alt text Alt text Alt text

lenet-cnn-accelerator-hardware-for-fpga's People

Contributors

hazooree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

odin2985

lenet-cnn-accelerator-hardware-for-fpga's Issues

help

How can I enter test data?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.