day1 lab1

24
Lab1: Lab1: Modelsim Setup and Hello World Modelsim Setup and Hello World 1. quartus_install.pdf, www.altera.com 2. oem_tutor.pdf, ModelSim Tutorial 1. Make Sure your “Modelsim-Altera” ready 2. Go through a tutorial example for RTL simulati on with ModelSim

Upload: ron-liu

Post on 17-Dec-2014

642 views

Category:

Technology


5 download

DESCRIPTION

ModelSim

TRANSCRIPT

Page 1: Day1 Lab1

Lab1: Lab1: Modelsim Setup and Hello WorldModelsim Setup and Hello World

1. quartus_install.pdf, www.altera.com2. oem_tutor.pdf, ModelSim Tutorial

1. Make Sure your “Modelsim-Altera” ready2. Go through a tutorial example for RTL simulati

on with ModelSim

Page 2: Day1 Lab1

Lab1:Lab1:Basic Simulation FlowBasic Simulation Flow

ModelSim: a verification and simulation tool for ● VHDL, ● Verilog, ● SystemVerilog, ● SystemC,and mixed-language designs.

Page 3: Day1 Lab1

ModelSim RTL simulationModelSim RTL simulation

1. Create libraries.2. Map to libraries.3. Compile source code and testbenches.4. Load the design.5. Add design stimulus.6. View the simulation results.7. Advance the simulator

You already had practiced it at Lab1.

Page 4: Day1 Lab1

Start ModelSimStart ModelSim

● Verilog: Copy counter.v and tcounter.v files from /<install_dir>/examples/tutorials/verilog/basicSimulation to the new directory.

● Start ModelSimClick from your Desktop

Page 5: Day1 Lab1

Change FolderChange Folder

● Select File > Change Direc

tory and change to the directory you created.

C:\Altera\61C:\Altera\pjt\Lab1

Page 6: Day1 Lab1

Create the working library.Create the working library.

Select File > New > Library.OKdir work, file 『 _info 』

Library Windowmodelsim.ini

Page 7: Day1 Lab1

Create the working library.Create the working library.

Transcript window

Page 8: Day1 Lab1

Compile the designCompile the design

1. Select Compile > Compile

2. Select both counter.v tcounter.v modules

3. Compile, Done

Page 9: Day1 Lab1

View the compiled design unitsView the compiled design units

● Library window● click the ’+’ icon

next to the work library

Page 10: Day1 Lab1

Load DesignLoad Design

● Select Simulate -> Start Simulation● OK● ModelSim> vsim -t ns work.test_counter

Page 11: Day1 Lab1

Structure window Structure window (labeled sim) that displays thehierarchical structure of the design in simulation

Page 12: Day1 Lab1

Process and Object WindowProcess and Object Window

Page 13: Day1 Lab1

Run the SimulationRun the Simulation

● Select View > Waveor > view wave

● Resize or Move 『 Window 』 by mouse● right-click test_counter to open a popup co

ntext menu.Select Add > To Wave

Page 14: Day1 Lab1

Run the SimulationRun the Simulation

● Click Run Icon● Run up to 100 ns● VSIM> run 500● Run -All● Simulate ->Break

Page 15: Day1 Lab1

Waveform Display, Zoom-In OutWaveform Display, Zoom-In Out

Page 16: Day1 Lab1

Breakpoints and StepBreakpoints and Step

Open source file

Page 17: Day1 Lab1

Breakpoint set, hit Breakpoint set, hit

Goto line 36Double click

Right click

Restart the simulationClick ResetClick Run -allCheck Transcript and source Windowexamine data

Page 18: Day1 Lab1

Step RunStep Run

StepStep overRun

Simulate -> End Simulation

Page 19: Day1 Lab1
Page 20: Day1 Lab1

Where to get on-line help?Where to get on-line help?

Page 21: Day1 Lab1

AppendixAppendix

Page 22: Day1 Lab1

Lab1: design HierachicalLab1: design Hierachical

Page 23: Day1 Lab1

LM_LICENSE_FILELM_LICENSE_FILE

Page 24: Day1 Lab1

Lab1:Lab1:ModelSim-Altera License File in Vista ModelSim-Altera License File in Vista