DOC PREVIEW
Berkeley COMPSCI 150 - ModelSim Installation & Tutorial

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 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 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

IntroductionInstallation & SetupUseStep1: Create a Directory for your ProjectStep2: Start ModelSim and Create a ProjectStep3: Add Your Verilog to the ProjectStep4: Compile your Verilog FilesStep5: Start the SimulationStep6: Add Signals to the Wave WindowStep7: Recompile Changed Verilog FilesStep8: Restart/Run the SimulationMore InformationModelSim Installation & TutorialGreg GibelingUC [email protected] 13, 20081 IntroductionIn this document I will cover the basics of installing ModelSim (see section2), compiling the Xilinxsimulation libraries, and simulating a simple example project (see se ction 3). This document is targettedat both RDL users and, more generally, those new to the simulation of digital logic (EECS150 and CS61Cstudents).EECS150 and CS61C users needn’t worry about installation, as the relevant Berkeley computers(those in 125 Cory for EECS150 and ilinux1, 2 & 3 for CS61C) already have ModelSim properly installed.Students may wish to read the installation section if they are interested in running ModelSim on theirhome computers. CS61C students, like all people not using Xilinx FPGAs, should ignore the instructionsin this document which mention ”Xilinx”. In general, RDL users will need section 2, but should referto the CounterExample, distributed with RDLC for use. Section 3 on the other hand is meant for thosewithout ModelSim experience, or those who need a refresher, in particular U.C. Berke ley students inCS61C or EECS150.Note that as of this writing the current versions of various pieces of software mentioned in thisdocument are: RDLC 2.2007.6.7 and ModelSim SE 6.2g.2 Installation & SetupMake sure you have a license.Step1. Download the installer from Mentor Graphs (http://www.model.com/).i. You probably want SE (which is not the same as the student edition), assuming you,your company or school has purchased a license.ii. Students should consider the http://www.model.com/resources/student edition/download.asp,which has a limited time license. Otherwise you may wish to use the Xilinx Edition orAltera Edition of ModelSim which are both limited to simulating smaller designs.Step2. Run the installer.i. You will want the full, rather than the evaluation version, assuming you already havea license.ii. The installer should create a directory c:\Modeltech_version.Step3. Install the license by setting MGLS_LICENSE_FILE or running the licensing wizard.i. The former is recommended, if you have a floating license on a server somewhere.ii. The license for ModelSim should be of the form [email protected]. If you have an actual license.dat file, simply set MGLS_LICENSE_FILE to the absolutepath to license.dat.Step4. Build the simulation libraries1i. Who needs to do this?∗. Not necessary unless you intend to use ModelSim to simulate designs for XilinxFPGAs.†. RDLC2 as of v2.2007.3.26 will require this.ii. Make c:\Modeltech_version\ModelSim.ini writable (it is marked read-only by the in-staller).iii. Run compxlib to compile the Xilinx libraries. Note that it is best to run from c:\Modeltech_version.∗. This will modify ModelSim.ini in the current directory to include paths to theXilinx libraries.Step5. Define the MODELSIM compiler flag for use with Const.v.i. Who needs to do this?∗. Students in CS61C and EECS150 may skip this step as ModelSim has been in-stalled to do this by default.†. Anyone else not using Verilog files from RDLC2, CS61C or EECS150 may alsoskip this step.ii. Open c:\Modeltech_version\ModelSim.ini in a text editor (make sure it is still writable).iii. Add the line OptionFile = C:\Modeltech_version\vlog.opt under the [vlog] header.iv. Create the file C:\Modeltech_version\vlog.opt.v. Add the line +define+MODELSIM to vlog.opt.vi. This will ensure that the preprocessor flags in Const.v are properly defined for simula-tion.Step6. This should complete your installation of ModelSim.Step7. You may test your installation by attempting to simulate, as described below, a simpleproject w ith a single Verilog file shown in program 1Program 1 TestVerilog.v1 mod ule Tes tVeri log ;2 init ial begin3 $displa y ( ‘‘Hello , World ! ’ ’);4 end5 endmodule3 UseThe purpose of an HDL simulator is to compile, and then simulate an HDL (hardware descriptionlanguage: Verilog and VHDL are examples) on a standard computer. While this is very slow comparedto a real circuit implementation, it allows complete visibility and can be much less expensive, making itideal for design and debugging. Note that as a circuit grows in complexity an FPGA will generally be abetter platform, as the simulator will start to degrade in performance, and has no true IO connections.ModelSim is a very powerful HDL simulation environment, and as such can be difficult to m aster.To correctly simulate many complex test benches, you will need to create and use a ModelSim projectmanually. Note that throughout this tutorial we assume you are attempting to simulate a purely Verilogbased design. The steps are fairly simple:Step1. Create a directory for your project (section 3.1).Step2. Start ModelSim and create a new project (section 3.2).2Step3. Add all your Verilog files to the project (section 3.3).Step4. Compile your Verilog files (section 3.4).Step5. Start the simulation (section 3.5).Step6. Add signals to the wave window (section 3.6).Step7. Recompile changed verilog files (section 3.7).Step8. Restart/Run the simulation (section 3.8).3.1 Step1: Create a Directory for your Projecta. Because ModelSim creates rather large output files you should not save your ModelSimprojects. It is a simple matter to recreate the project anyway.b. Create a directory for your simulation.i. For CS61C Students: create a sub-directory somewhere in your home directory, perhapssomething like ~/simulation/.ii. For EECS150 students: create a sub-directory in C:\Users\cs150-xxx\, perhaps some-thing like C:\Users\cs150-xxx\Simulation.c. When you are done simulating delete this entire directory, this will remove the ModelSimproject and all of its temporary files. Obviously your source code should be elsewhere, sothat you do not delete it.3.2 Step2: Start ModelSim and Create a Projecta. Start ModelSim.i. On windows there is often a shortcut on the desktop or start menu.ii. On UNIX or Linnux, simply run vsim &.iii. For CS61C students you w ill need to take the extra step of logging into ilinux1.eecs.berkeley.edu,ilinux2 or ilinux3 where ModelSim is installed. Be sure to login using ssh -Xto


View Full Document

Berkeley COMPSCI 150 - ModelSim Installation & Tutorial

Documents in this Course
Lab 2

Lab 2

9 pages

Debugging

Debugging

28 pages

Lab 1

Lab 1

15 pages

Memory

Memory

13 pages

Lecture 7

Lecture 7

11 pages

SPDIF

SPDIF

18 pages

Memory

Memory

27 pages

Exam III

Exam III

15 pages

Quiz

Quiz

6 pages

Problem

Problem

3 pages

Memory

Memory

26 pages

Lab 1

Lab 1

9 pages

Memory

Memory

5 pages

Load more
Download ModelSim Installation & Tutorial
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 ModelSim Installation & Tutorial 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 ModelSim Installation & Tutorial 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?