Docsity

Modelsim Tutorial - Computer Architecture and Design | ELEC 5200, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
ELEC 5200/6200
Spring 2009
Modelsim Tutorial
1. Create a directory for this homework assignment.
2. Write your VHDL code in a text editor and save file as .vhd file in the directory created
above.
3. The ModelSim tool is available in Lab 320 and Lab 310 computers. We are currently
using Modelsim 6.4c version.
4. To simulate using Modelsim, follow these steps.
STEP 1:
After starting the Modelsim, create a new project from the file menu as shown in Figure 1.
Figure 1
STEP 2:
Give Project a name. The project location is the directory in which you have your VHDL files.
Click OK. (Figure 2)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Modelsim Tutorial - Computer Architecture and Design | ELEC 5200 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

ELEC 5200/

Spring 2009

Modelsim Tutorial

  1. Create a directory for this homework assignment.
  2. Write your VHDL code in a text editor and save file as .vhd file in the directory created above.
  3. The ModelSim tool is available in Lab 320 and Lab 310 computers. We are currently using Modelsim 6.4c version.
  4. To simulate using Modelsim, follow these steps.

STEP 1: After starting the Modelsim, create a new project from the file menu as shown in Figure 1.

Figure 1

STEP 2: Give Project a name. The project location is the directory in which you have your VHDL files. Click OK. (Figure 2)

Figure 2

STEP 3: A window, as shown in Figure 3, will pop up. Select Add existing file

Figure 3 STEP 4:

STEP 5:

The selected VHDL file will appear in the workspace as highlighted in figure 6. Double click this file to open it in the right side if the workspace. Click the compile icon at the top as highlighted by red box in the figure 7 and the design will be compiled.

Figure 6

Figure 7

STEP 6: If your design contains any error, the compiler will display an error message in the Transcript window as shown in Figure 8. Double click the error message and a window will appear (Figure 9) which will contain description of the error and the line no. on which the error has occurred. Make necessary changes in the code, save and recompile until all the errors are removed. Once all errors are removed a message will appear indicating a successful compilation as highlighted in figure 10.

Figure 10

STEP 7: After compilation is successful, we simulate the circuit using an icon highlighted by red box in figure 10. A window will appear in which you will have to select the entity of component you want to simulate as shown in Figure 11.

Figure 11

STEP 8: A successful simulation will produce windows as shown in figure 12. The window at the center titled ‘Objects’ will contain all the input and output ports in the entity. To see simulation results we can either use a List or a Wave. Here, the use of List is explained. A wave can be set up and used in a similar way. To add signals in the list, right click in the Object window area and then select ‘Add to List’  ‘Signals in Design’ (figure 12)

Figure 13

Figure 14

STEP 10:

If you have clock signal in the design then right click it and select ‘clock’ Figure 15 A window in Figure 16 will appear. You can define all the clock parameters here. Click OK.

Figure 15

Figure 16

Figure 18

STEP 13: After verification, you can save this list output as a file. To do this, From File menu, select ’Write List’ ’Tabular’ (Figure 19) A window in Figure 20 will appear. Give a suitable name to your list file and Save. The Default location will be your project directory. You can later open this file in TextPad, Copy its contents and Paste in Microsoft word.

  • Figure
  • Figure
  • Figure
  • Figure