+ All Categories
Home > Documents > LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with...

LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with...

Date post: 19-Jan-2016
Category:
Upload: baldric-garrison
View: 214 times
Download: 0 times
Share this document with a friend
19
LECTURE IV MODELSIM
Transcript
Page 1: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

LECTURE IV

MODELSIM

Page 2: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• We will begin by downloading a free student version of Modelsim• 1) Click on the link below or copy and paste into your browser.• http://www.mentor.com/company/higher_ed/modelsim-student-edition• 2) Click on "Download Student Edition"• 3) Click on "Run" at the bottom of your screen. The actual download could take quite

a while to accomplish. Be sure you have time prior to beginning the download.• 4) Once downloaded, follow the directions to receive an e-mail with your license key

attached. These instructions are included in the e-mail:

• FINAL INSTALLATION INSTRUCTIONS• ===============================• • 1) Save the attached file with the name 'student_license.dat' to the top level • installation directory for ModelSim PE Student Edition (e.g., c:/modeltech_pe_edu). This • is the directory that contains that sub-directory 'win32pe_edu.'• • 2) Do not edit the file 'student_license.dat' in any way, or the license will not work.• • 3) You should now be able to run ModelSim PE Student Edition.

• 5) Again, follow the directions to place the license key in the correct Modelsim folder.

Page 3: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog project which creates an Inverter logic gate, compiles the program and then simulates it.

• https://www.youtube.com/watch?v=9mpRF6bAY1g• Note that there are a variety of ways to accomplish the

same thing in Verilog. For example, his module statement could have been placed on a single line. Either way works. You will find that this is the often the case in Verilog.

Page 4: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• Try running the sample project that was written in Lecture 3:

• module Simple_Circuit (A,B,C,D,E);• output D,E;• input A,B,C;• wire w1;• • and G1 (w1,A,B); // Optional gate instance name• not G2 (E,C);• or G3 (D,w1,E);• endmodule

Page 5: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• 1) Begin by opening Modelsim• 2) Click "Jumpstart" in the opening box• 3) Click on "Create a Project"• 4) Give the project a name and click "OK"• 5) Click "Create New File"• 6) Give the file a name (I usually use the same

one used for the project name. VERY IMPORTANT: Under "Add file as type" click the arrow and select "Verilog" and now click "OK”.

Page 6: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 7: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 8: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 9: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 10: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 11: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 12: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 13: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 14: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 15: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.
Page 16: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• 7) Now click on the "Close" button in the "Add items to the Project" box

• 8) You should now see a .v file in the upper left corner• 9) Right click in this file and then click "Edit"• 10) You should now see the text editor box to the

right. Either rewrite the project mentioned above or cut and paste it into this area.

• 11) IMPORTANT: You must now save your project before proceeding! Click on the floppy disc icon to do so. (Don't know what a floppy disc is? Ask your parents.)

Page 17: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• 12) AFTER saving the file, you are now ready compile the project.• 13) Right click on the file and hover over "Compile". Click on

Compile Selected"• 14) If you have written your project correctly, a check mark will

appear after the file name and a message stating that the compile was successful will appear in the Transcript box. If these two things don't happen, a compiler error has occurred. To get a hint as to what is wrong, right click on the file name, hover over "Compile" and click on "Compile Report". A message will appear giving you some indication as to what caused the project to fail to compile. Note: sometimes these messages are quite clear and point directly to the problem and then there are other times when they seem to make no sense. Good luck. (A good idea is to very carefully examine your syntax)

Page 18: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• 15) Once you have successfully compiled your project you are now ready to simulate it.

• 16) Right click on the project name in the Library and click on Simulate.

• 17) Now click on Wave (lower center of screen). Notice the changes on the screen. You should see a blank area called "Wave Default" and to the right of that, something that looks like a logic analyzer with a time scale at the bottom. ( If you don't know what a logic analyzer is, try Google.)

• 18) Click and drag the inputs and outputs that you want to observe from the "Objects" box to the "Wave-Default" box.

Page 19: LECTURE IV MODELSIM. Go to the link listed below for a demonstration of how to begin working with Modelsim. The video shows you how to write a Verilog.

• 19) Now you need to set the inputs to some initial value. Do this by right clicking on one of the inputs and then click on "Force". find the "Value" box and replace its contents with either a 1 or a 0. Repeat for the rest of the Inputs.

• 20) Once you have set all of the inputs to the desired values, you can now run the simulation. Do so by clicking on the "Run" box located at the top of the screen just right of the "Run Length" box which should read "100 ns".

• 21) Force the inputs to different values and click on the "Run" box again. You should observe a different waveform which corresponds to the values you forced the inputs to be.


Recommended