cs670d

This is of course a scaled down tutorial .. more to get you onto using the tool.

U should visit the tutorials at the ModelSim Site.

ModelSim Tutorial

  1. Create Project and Compile VHDL

    1. Launch ModelSim, then create a new project from the dialog box

    2. Specify your project name and your project folder as you desired.

    3. The project will be created. You will find the prompt "ModelSim>"

    4. Select File => New => source => vhdl from the menu. A VHDL editor will be shown for you to edit the VHDL file.

    5. edit and save the vhdl code, or copy and paste this one (systole.vhd):

    6. select project => add file to project from the main menu, and add the VHDL file you want to simulate to the project

    7. select project => compile ALL to compile the VHDL code


  2. Simulation
    1. After writing your code you should simulate your design

    2. To simulate the design, you must prepare the test vector. In VHDL, we can create a VHDL file which contain the test vector. We call this test bench file. You can imagine the test bench file is the "breadboard".

    3. As the initial function of VHDL is to simulate the digital design, several features of VHDL can make test bench for simulation.

    4. To create a test bench file, you can create the VHDL file as usual. Here is the example of test bench file: (systolic_tb.vhd)

    5. You can add the test bench file as normal VHDL file to the project. To compile the test bench file, you can follow the compilation step as shown above.

    6. Moreover, you have to tell the ModelSim which test bench you will use to simulate the design. Select Design=> load design, then choose "systolic_tb" and click load such that the ModelSim will load both the test bench and the systolic.vhd and the other files for simulation.

    7. To simulate the design, you have to invoke several windows:
      Structure window
      Signals window
      Wave window
      You can select the appropriate window from view menu


    8. Drag the signal you want to observe from signals window to wave window. The wave window will show the signal as well.

    9. The last step is let the simulation start. In the modeSim command prompt, type the command "run -all or use the icons in the wave window" to start the simulation. This will let the simulation run. You will see the wave form from the wave window.