Day1 Lab1
-
Upload
ron-liu -
Category
Technology
-
view
642 -
download
5
description
Transcript of Day1 Lab1
![Page 1: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/6.jpg)
Create the working library.Create the working library.
Select File > New > Library.OKdir work, file 『 _info 』
Library Windowmodelsim.ini
![Page 7: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/7.jpg)
Create the working library.Create the working library.
Transcript window
![Page 8: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/8.jpg)
Compile the designCompile the design
1. Select Compile > Compile
2. Select both counter.v tcounter.v modules
3. Compile, Done
![Page 9: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/9.jpg)
View the compiled design unitsView the compiled design units
● Library window● click the ’+’ icon
next to the work library
![Page 10: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/10.jpg)
Load DesignLoad Design
● Select Simulate -> Start Simulation● OK● ModelSim> vsim -t ns work.test_counter
![Page 11: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/11.jpg)
Structure window Structure window (labeled sim) that displays thehierarchical structure of the design in simulation
![Page 12: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/12.jpg)
Process and Object WindowProcess and Object Window
![Page 13: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/14.jpg)
Run the SimulationRun the Simulation
● Click Run Icon● Run up to 100 ns● VSIM> run 500● Run -All● Simulate ->Break
![Page 15: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/15.jpg)
Waveform Display, Zoom-In OutWaveform Display, Zoom-In Out
![Page 16: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/16.jpg)
Breakpoints and StepBreakpoints and Step
Open source file
![Page 17: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/17.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/18.jpg)
Step RunStep Run
StepStep overRun
Simulate -> End Simulation
![Page 19: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/19.jpg)
![Page 20: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/20.jpg)
Where to get on-line help?Where to get on-line help?
![Page 21: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/21.jpg)
AppendixAppendix
![Page 22: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/22.jpg)
Lab1: design HierachicalLab1: design Hierachical
![Page 23: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/23.jpg)
LM_LICENSE_FILELM_LICENSE_FILE
![Page 24: Day1 Lab1](https://reader034.fdocuments.net/reader034/viewer/2022042623/549638abac795925288b5223/html5/thumbnails/24.jpg)
Lab1:Lab1:ModelSim-Altera License File in Vista ModelSim-Altera License File in Vista