Skip to content

EgemenBaykan/VHDL_Examples

Repository files navigation

VHDL Examples

Why This Repo?

This repo aims to help you with your very first VHDL codes and digital designs. There are also many sources on internet, especially for spesific projects such as VGA drive, 7 segment displays and even for RISC based microcontroller/processor architectures.

Which Programs Are Used?

As text editor Visual Studio Code and for simulations ModelSim are used in this repo.

Note #1: If you already have any IDE or programs to simulate/synthesize your design, these installations are not important. You can also try these codes on your IDE.

Note #2: Also "Modern VHDL" extension pack is used for writing VHDL code easier. After installation, you also can download and install by searching it in extension packs tab in VSCode.

Note #3: For MAC users also there are GHDL and GTKWave programs.

How To?

Basically, you can open files with ".mpf" extensions on ModelSim and compile the design files. Testbenches are named as "_CodeName_tb.vhd". Start simulation on a testbench, add your waves to simulation and run within dedicated time on the tab on top of the program. A simulation of RAM design is shown below:

RAM simulation

How To Create A New Project On ModelSim?

  1. Go to File > New > Project.
  2. Enter your project name.
  3. Choose your project location path.
  4. Click OK and choose "Add Existing Files".
  5. Add your design and testbench.
  6. Click OK. Your project is created.

How To Simulate Your Code On ModelSim?

Simulation process differs from project to project. However, most basic logic is processed in this manual.

  1. Go to Compile > Compile All. This compiles your VHDL codes included in your project.
  2. If compile is successful, continue with simulation part:
  3. Go to Simulate > Start Simulation. A new window will pop up.
  4. Under "work" directory, choose your testbench file and click OK.
  5. On left panel, in "sim" layout, right click on your unit under test (UUT).
  6. Click Add Waves. All objects will be displayed on "Wave" layout.
  7. On the tab, click "Run". This process runs your simulation in dedicated time near Run button.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages