Coder Social home page Coder Social logo

cli_hdl's Introduction

CLI_HDL

Intro to GHDL command line enviroment with a few basic VHDL structures to use as templates.

Prerequisite packages install script

sudo apt update
sudo apt install -y git make gnat zlib1g-dev
git clone https://github.com/ghdl/ghdl
cd ghdl
./configure --prefix=/usr/local
make
sudo make install
echo "$0: All done!"
sudo apt install gtkwave

Clone project and test design

git clone https://github.com/ErezBinyamin/MAC_Unit.git
cd MAC_Unit
make test TESTBENCH=./tst/BIST_MAC_TB.vhd

Test intermediary components

  • N-bit adder: make test TESTBENCH=./tst/Full_Adder_Nbit_TB.vhd
  • N-bit Multiplier: make test TESTBENCH=./tst/Multiplier_TB.vhd
  • MAC unit: make test TESTBENCH=./tst/MAC_TB.vhd
  • BIST-MAC make test TESTBENCH=./tst/BIST_MAC_TB.vhd

GTK-wave simulation output

output

Auto RTL documentation using graphviz dot

  • For each file with a corresponding entity declaration, will generate one block diagram with input/output ports
  • Use make rtl_template to auto-gen a template file in out/rtl.dot
  • Use make rtl to compile out/rtl.dot into out/rtl.png and xdg-open it with your default image viewer
    Example

Project Structure

tst - contains testbenches for each component

A_TB.vhd
B_TB.vhd
C_TB.vhd

work - contains project components/source-code organized in a dependency structure

A.vhd
B.vhd
[dependency]

C.vhd

out - contains output artifacts from builds
tools - contains build scripts/tools
img - Images/gifs for github readme


Build system

  • Put new source code in work
  • Pus new testbenches in tst
  • The Makefile make all rule will find all of the source files in work, syntax check them ghdl -s and compile them `ghdl -a
  • Dependency management between source files is resloved with a Makefile enforced Project Structure. All dependent source files must exist in subfolders beneath the higher level components that depend upon them
  • The Makefile will call get_dep_list.sh to generate an ordered list of dependencies based upon the Project Structre and compile targets in the correct order.

cli_hdl's People

Watchers

 avatar  avatar

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.