Day2 Intro. Model Sim
-
Upload
ron-liu -
Category
Technology
-
view
1.770 -
download
0
description
Transcript of Day2 Intro. Model Sim
![Page 1: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/1.jpg)
ModelSim OverView
![Page 2: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/2.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/3.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/4.jpg)
ModelSim Tutorial
ModelSim Tool OverView
![Page 5: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/5.jpg)
ModelSim Flow 1
2
3
4
5
Link
![Page 6: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/6.jpg)
Vlog order independent
![Page 7: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/7.jpg)
ModelSim use mode
![Page 8: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/8.jpg)
Command Mode
![Page 9: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/9.jpg)
Batch Run
![Page 10: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/10.jpg)
ModelSim Tutorial
Projects
![Page 11: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/11.jpg)
ModelSim: New Project File > New > Project
− *.mpf
![Page 12: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/12.jpg)
Add Existing File
HDL files 路徑名稱不能有中文
![Page 13: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/13.jpg)
Add Existing File
![Page 14: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/14.jpg)
File > Add to Project
![Page 15: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/15.jpg)
Compile
Mouseright click
![Page 16: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/16.jpg)
Load Design
Mouse doubleClick
Simulate > End Simulation.
![Page 17: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/17.jpg)
OPEN CLOSE A PROJECT FILE > OPEN
FILE > CLOSE
![Page 18: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/18.jpg)
ModelSim Tutorial
Projects Folder
![Page 19: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/19.jpg)
Add Folder File > Add to Project > Folder.
![Page 20: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/20.jpg)
Add a sub folder File > Add to Project > Folder.
![Page 21: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/21.jpg)
Move Files to folder HDL
NOTE:NO actual directories created in the file system.
![Page 22: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/22.jpg)
ModelSim Tutorial
Simulation Configuration
![Page 23: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/23.jpg)
Simulation Configuration File > Add to Project > Simulation Configuration.
![Page 24: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/24.jpg)
Loading
![Page 25: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/25.jpg)
ModelSim Tutorial
Project Setting
![Page 26: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/26.jpg)
Right Click > Properties...
![Page 27: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/27.jpg)
Project Setting
![Page 28: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/28.jpg)
ModelSim Tutorial
Waveform Display
![Page 29: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/29.jpg)
Waveform Window
![Page 30: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/30.jpg)
Add wave
View wave Add wave * OR
VIEW > DEBUG WINDOWS > WAVE
![Page 31: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/31.jpg)
Add signals to waveform
Or, Mouse Drag-and-Drop
![Page 32: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/32.jpg)
Zoom-in 2X Zoom-in
2X Zoom-out
Full
![Page 33: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/33.jpg)
Cursor in Wave Window
![Page 34: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/34.jpg)
Rename the Cursor
Mouse Right Click A
![Page 35: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/35.jpg)
Add Cursor
Click Rename
Cursor2 to B
Drag Bto measurethe Delta
![Page 36: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/36.jpg)
Cursor
CURSOR HERE
![Page 37: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/37.jpg)
![Page 38: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/38.jpg)
Window Undock & Dock
![Page 39: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/39.jpg)
Tools > Combine Signal
![Page 40: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/40.jpg)
Save Waveform Format: File > Save
File > LoadSelect wave.do
![Page 41: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/41.jpg)
![Page 42: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/42.jpg)
ModelSim Tutorial
SDF
![Page 43: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/43.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/44.jpg)
$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](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/45.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/46.jpg)
ModelSim Tutorial
Library
![Page 47: Day2 Intro. Model Sim](https://reader033.fdocuments.in/reader033/viewer/2022061212/549638b4ac7959482e8b4fa8/html5/thumbnails/47.jpg)
Appendix