DOC PREVIEW
MIT 6 111 - Study Guide

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.111 – Introductory Digital Systems Laboratory ModelSim/Verilog Tutorial Authors: David Milliner, Frank Honoré, Spring, 2004 Jenny Lee, Spring, 2005 Theodoros Konstantakopoulos, Spring 2006 Introduction This tutorial is designed to familiarize you with Verilog coding/syntax and simulation in the ModelSim environment. Verilog HDL is a hardware description language used to design digital systems. Along with VHDL, Verilog is the primary industry tool for programming digital systems. ModelSim is the industry standard simulation tool for verifying digital designs. Directory Structure The first time you log into the lab computer you should familiarize yourselves with the directory structure and the drives and directories you can store your files for this class. Double-click on “My Computer”. You will see two local drives C: and E: and two network drives S: and U: C: is a local drive. Nothing should ever be installed or saved there. E: is a local drive. Drive E: should only be used for storing files temporarily. Using drive E: for storing your source files will speed up your simulations, compared to using a network drive. However, the files on drive E: cannot be retrieved from any other computer in the lab. Please make sure you delete everything you save to this drive before each log-off. S: is a network drive. It is a shared network drive. On this drive there is a ‘6.111’ folder that all 6.111 students have access to it. In this folder (‘S:\6.111’) you will find files useful for tutorials. U: is a network drive. Each student with a lab account has a private share on this drive. Only the student and administrators have access to the folders on your share. If you double-click on this drive you will see among others, a folder called ‘Desktop’. This ‘Desktop’ folder is the Desktop you see when you log into a lab computer. The contents of drive ‘U:’ are accessible from any computer in the lab area. Please make sure you save all your source files in U:/Desktop. (Another way to access the contents of your ‘U:’ drive is by double-clicking the ‘My Documents’ folder on your Desktop when you log into a lab computer - drive ‘U:’ points to ‘eecslabs\labroot\users\Username’.) 1Although drive ‘U:’ is accessible from any computer in the lab area, you will probably want to back these files up on your Athena account from time to time. You can transfer files back and forth from your Athena account using WinSCP. Verilog Source Code and Testbench In ‘S:\6.111\Tutorials’ you will find source files for two short tutorials: a counter tutorial and an adder tutorial. On the Desktop of your local computer, create a ‘Tutorial’ folder with a subfolder for each tutorial (U:\Desktop\Labs\Tutorials\counter and U:\Desktop\Tutorials\adder). In your ‘counter’ folder create two subfolders: ‘src’ and ‘sims’. The ‘src’ folder will contain the source codes for this tutorial and the ‘sims’ directory is where you will be compiling your code. Copy the files ‘counter.v’, ‘top.v’, ‘tb_tutorial.v’, from ‘S:\6.111\Tutorials\counter’ to your ‘src’ folder on the ‘counter’ directory. The file ‘counter.v’ is a simple two-bit Verilog counter designed to divide the input clock by four. This counter is designed to reset back to zero on the positive assertion of the reset signal. Your counter is instantiated in the top level file top.v. The file tb_tutorial.v is used to simulate the counter module in counter.v. We recommend you spend a few minutes familiarizing yourself with this code and the Verilog syntax. Opening ModelSim You can access ModelSim either through the PCs in the lab or an Athena Workstation. On the Lab PC under Windows XP, launch ModelSim from the Desktop icon (or Start > All Programs > ModelSim SE > ModelSim). If it’s your first time opening ModelSim or if you encounter problems with licenses, you can run the license wizard: Start > All Programs > ModelSim SE > Licensing Wizard. The license file should be set to ‘[email protected]’. On Athena workstations, first run 'setup 6.111' to configure your environment correctly. Then run 'vsim &' to start the application. Online help and tutorials for ModelSim are available from the Help pull-down menu. Help > SE PDF Documentation > Tutorial will bring up the guide for a recommended tutorial. The PDF for the user's manual is also available on the course website: ‘http://www-mtl.mit.edu/Courses/6.111/labkit/ModelSim.pdf’ (must have MIT certificates). 2What are Library and Project? Before jumping into using ModelSim, there are two important components you should get familiar with: Library and Project. Library provides an environment for you to compile and simulate your design, while Project provides you a place to contain all relevant files and settings for independent design including its working library. Library: A directory that contains compiled design units, such as modules. There are two types of libraries: Resource Library and Working Library: Resource Library: contains static contents, such as the compiled version of standard modules. Resource libraries, such as ieee, can be found in the ‘library’ pane on the left-hand side of ModelSim. Working Library: contains the compiled version of your design. The contents of a working library change every time you compile your design. The default working library in ModelSim is named work and is predefined in the ModelSim compiler. The working library when created or linked to your source code can be accessed through the ‘library’ pane on the left-hand side of ModelSim. Project: A collection of various files for designs under test, such as Verilog source files, local working libraries, references to resource libraries, and simulation configuration (*.mpf files). Creating files in ModelSim There are two ways to start creating your designs in ModelSim: 1.Creating a project or 2.Opening or creating a Verilog file without a project. 1. Creating a project Create a new project: File > New > Project Specify your project name and specify the Project Location as a directory under ‘U:\Desktop\Tutorials\counter’. Leave the Default Library Name to work. Now, you have created a project .mpf file and a working library, which can store useful information, such as your


View Full Document

MIT 6 111 - Study Guide

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?