day2 intro. model sim

47
ModelSim OverView

Upload: ron-liu

Post on 18-Dec-2014

1.770 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Day2 Intro. Model Sim

ModelSim OverView

Page 2: Day2 Intro. Model Sim

What we already learnedWhat we already learned

● Verilog can model: behavioral, RTL structure● Module: basic unit in Verilog● A tutorial: Module instantiation, stimulus, respone● Procedure block: initial, always

Page 3: Day2 Intro. Model Sim

ModelSim RTL simulation1. 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

Page 4: Day2 Intro. Model Sim

ModelSim Tutorial

ModelSim Tool OverView

Page 5: Day2 Intro. Model Sim

ModelSim Flow 1

2

3

4

5

Link

Page 6: Day2 Intro. Model Sim

Vlog order independent

Page 7: Day2 Intro. Model Sim

ModelSim use mode

Page 8: Day2 Intro. Model Sim

Command Mode

Page 9: Day2 Intro. Model Sim

Batch Run

Page 10: Day2 Intro. Model Sim

ModelSim Tutorial

Projects

Page 11: Day2 Intro. Model Sim

ModelSim: New Project File > New > Project

− *.mpf

Page 12: Day2 Intro. Model Sim

Add Existing File

HDL files 路徑名稱不能有中文

Page 13: Day2 Intro. Model Sim

Add Existing File

Page 14: Day2 Intro. Model Sim

File > Add to Project

Page 15: Day2 Intro. Model Sim

Compile

Mouseright click

Page 16: Day2 Intro. Model Sim

Load Design

Mouse doubleClick

Simulate > End Simulation.

Page 17: Day2 Intro. Model Sim

OPEN CLOSE A PROJECT FILE > OPEN

FILE > CLOSE

Page 18: Day2 Intro. Model Sim

ModelSim Tutorial

Projects Folder

Page 19: Day2 Intro. Model Sim

Add Folder File > Add to Project > Folder.

Page 20: Day2 Intro. Model Sim

Add a sub folder File > Add to Project > Folder.

Page 21: Day2 Intro. Model Sim

Move Files to folder HDL

NOTE:NO actual directories created in the file system.

Page 22: Day2 Intro. Model Sim

ModelSim Tutorial

Simulation Configuration

Page 23: Day2 Intro. Model Sim

Simulation Configuration File > Add to Project > Simulation Configuration.

Page 24: Day2 Intro. Model Sim

Loading

Page 25: Day2 Intro. Model Sim

ModelSim Tutorial

Project Setting

Page 26: Day2 Intro. Model Sim

Right Click > Properties...

Page 27: Day2 Intro. Model Sim

Project Setting

Page 28: Day2 Intro. Model Sim

ModelSim Tutorial

Waveform Display

Page 29: Day2 Intro. Model Sim

Waveform Window

Page 30: Day2 Intro. Model Sim

Add wave

View wave Add wave * OR

VIEW > DEBUG WINDOWS > WAVE

Page 31: Day2 Intro. Model Sim

Add signals to waveform

Or, Mouse Drag-and-Drop

Page 32: Day2 Intro. Model Sim

Zoom-in 2X Zoom-in

2X Zoom-out

Full

Page 33: Day2 Intro. Model Sim

Cursor in Wave Window

Page 34: Day2 Intro. Model Sim

Rename the Cursor

Mouse Right Click A

Page 35: Day2 Intro. Model Sim

Add Cursor

Click Rename

Cursor2 to B

Drag Bto measurethe Delta

Page 36: Day2 Intro. Model Sim

Cursor

CURSOR HERE

Page 37: Day2 Intro. Model Sim
Page 38: Day2 Intro. Model Sim

Window Undock & Dock

Page 39: Day2 Intro. Model Sim

Tools > Combine Signal

Page 40: Day2 Intro. Model Sim

Save Waveform Format: File > Save

File > LoadSelect wave.do

Page 41: Day2 Intro. Model Sim
Page 42: Day2 Intro. Model Sim

ModelSim Tutorial

SDF

Page 43: Day2 Intro. Model Sim

SDF SDF versions 1.0 through 4.0 vsim

-sdfmin [<instance>=]<filename>-sdftyp [<instance>=]<filename>-sdfmax [<instance>=]<filename>

Exvsim -sdfmax /testbench/u1=myasic.sdf testbench

OrSimulate > Start Simulation> SDF

Page 44: Day2 Intro. Model Sim

$sdf_annotate system task $sdf_annotate (["<sdffile>"], [<instance>],

["<config_file>"], ["<log_file>"], ["<mtm_spec>"], ["<scale_factor>"], ["<scale_type>"]);

Ex$sdf_annotate("myasic.sdf", testbench.u1);$sdf_annotate("myasic.sdf", testbench.u1, , , "maximum");

Page 45: Day2 Intro. Model Sim

The SDF TIMESCALE construct specifies time units of values in the SDF file. The annotator rounds timing values from the SDF file to the time precision of the module that is annotated. For example, if the SDF TIMESCALE is 1ns and a value of .016 is annotated to a path delay in a module having a time precision of 10ps (from the timescale directive), then the path delay receives a value of 20ps. The SDF value of 16ps is rounded to 20ps. Interconnect delays are rounded to the time precision of the module that contains the annotated MIPD.

Page 46: Day2 Intro. Model Sim

ModelSim Tutorial

Library

Page 47: Day2 Intro. Model Sim

Appendix