SlideShare a Scribd company logo
1 of 47
Download to read offline
ModelSim OverView
What we already learned

    Verilog can model: behavioral, RTL structure
●
    Module: basic unit in Verilog
●
    A tutorial: Module instantiation, stimulus, respone
●
    Procedure block: initial, always
●
ModelSim 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
ModelSim Tutorial


    ModelSim Tool OverView
ModelSim Flow   1

                2


                        3




                            Link
                    4

                    5
Vlog order independent
ModelSim use mode
Command Mode
Batch Run
ModelSim Tutorial


    Projects
ModelSim: New Project
    File > New > Project

    − *.mpf
Add Existing File




HDL files 路徑名稱不能有中文
Add Existing File
File > Add to Project
Compile




Mouse
right click
Load Design




                             Mouse
                             double
                             Click



Simulate > End Simulation.
OPEN CLOSE A PROJECT
    FILE > OPEN


    FILE > CLOSE

ModelSim Tutorial


    Projects Folder
Add Folder
    File > Add to Project > Folder.

Add a sub folder
    File > Add to Project > Folder.

Move Files to folder HDL




                     NOTE:
                     NO actual directories created
                     in the file system.
ModelSim Tutorial


    Simulation Configuration
Simulation Configuration
    File > Add to Project > Simulation Configuration.

Loading
ModelSim Tutorial


    Project Setting
Right Click > Properties...
Project Setting
ModelSim Tutorial


    Waveform Display
Waveform Window
Add wave

  View wave

 Add wave *
 OR
  VIEW > DEBUG WINDOWS > WAVE
Add signals to waveform




            Or, Mouse Drag-and-Drop
Zoom-in   2X Zoom-in        Full

              2X Zoom-out
Cursor in Wave Window
Rename the Cursor
 Mouse Right Click

A
Add Cursor

  Click

 Rename
  Cursor2 to
  B
 Drag B
  to measure
  the Delta
Cursor




CURSOR HERE
Window Undock & Dock
Tools > Combine Signal
Save Waveform Format: File > Save




           File > Load
           Select wave.do
ModelSim Tutorial


    SDF
SDF
  SDF versions 1.0 through 4.0

 vsim
  -sdfmin [<instance>=]<filename>
  -sdftyp [<instance>=]<filename>
  -sdfmax [<instance>=]<filename>
 Ex
  vsim -sdfmax /testbench/u1=myasic.sdf testbench
 Or
  Simulate > Start Simulation
  > SDF
$sdf_annotate system task
  $sdf_annotate ([quot;<sdffile>quot;], [<instance>],

  [quot;<config_file>quot;], [quot;<log_file>quot;], [quot;<mtm_spec>quot;],
  [quot;<scale_factor>quot;], [quot;<scale_type>quot;]);
 Ex
  $sdf_annotate(quot;myasic.sdfquot;, testbench.u1);
  $sdf_annotate(quot;myasic.sdfquot;, testbench.u1, , ,
  quot;maximumquot;);


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.
ModelSim Tutorial


    Library
Appendix

More Related Content

Similar to ModelSim OverView and Simulation Guide

Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1Ron Liu
 
How to create a joomla component from scratch
How to create a joomla component from scratchHow to create a joomla component from scratch
How to create a joomla component from scratchTim Plummer
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletestlyricnz
 
Testing In Drupal
Testing In DrupalTesting In Drupal
Testing In DrupalRyan Cross
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...Joel Oleson
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyondmguillem
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneVincenzo Barone
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesChris Davenport
 
Joomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design PresentationJoomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design PresentationChris Davenport
 
Joomla! Day UK 2009 Template Design
Joomla! Day UK 2009 Template DesignJoomla! Day UK 2009 Template Design
Joomla! Day UK 2009 Template DesignAndy Wallace
 
Martin Aspeli Extending And Customising Plone 3
Martin Aspeli   Extending And Customising Plone 3Martin Aspeli   Extending And Customising Plone 3
Martin Aspeli Extending And Customising Plone 3Vincenzo Barone
 
Joomla in the cloud with Openshift
Joomla in the cloud with OpenshiftJoomla in the cloud with Openshift
Joomla in the cloud with OpenshiftEdoardo Schepis
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handlingSuite Solutions
 
TestersChoice_plug-in_tutorial
TestersChoice_plug-in_tutorialTestersChoice_plug-in_tutorial
TestersChoice_plug-in_tutorialLee Seungjong
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three waysMike North
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotTsai Tsung-Yi
 

Similar to ModelSim OverView and Simulation Guide (20)

Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1
 
Slim3 quick start
Slim3 quick startSlim3 quick start
Slim3 quick start
 
How to create a joomla component from scratch
How to create a joomla component from scratchHow to create a joomla component from scratch
How to create a joomla component from scratch
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletest
 
Testing In Drupal
Testing In DrupalTesting In Drupal
Testing In Drupal
 
Selenium
SeleniumSelenium
Selenium
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design PresentationJoomla Day UK 2009 Template Design Presentation
Joomla Day UK 2009 Template Design Presentation
 
Joomla! Day UK 2009 Template Design
Joomla! Day UK 2009 Template DesignJoomla! Day UK 2009 Template Design
Joomla! Day UK 2009 Template Design
 
Martin Aspeli Extending And Customising Plone 3
Martin Aspeli   Extending And Customising Plone 3Martin Aspeli   Extending And Customising Plone 3
Martin Aspeli Extending And Customising Plone 3
 
Joomla in the cloud with Openshift
Joomla in the cloud with OpenshiftJoomla in the cloud with Openshift
Joomla in the cloud with Openshift
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
TestersChoice_plug-in_tutorial
TestersChoice_plug-in_tutorialTestersChoice_plug-in_tutorial
TestersChoice_plug-in_tutorial
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobot
 

More from Ron Liu

Engineer
EngineerEngineer
EngineerRon Liu
 
Start up nations
Start up nationsStart up nations
Start up nationsRon Liu
 
XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07Ron Liu
 
book digest: product design and development
book digest: product design and developmentbook digest: product design and development
book digest: product design and developmentRon Liu
 
The Hero Within
The Hero WithinThe Hero Within
The Hero WithinRon Liu
 
About Thinking
About ThinkingAbout Thinking
About ThinkingRon Liu
 
書摘Teach Your Child How To Think
書摘Teach Your Child How To Think書摘Teach Your Child How To Think
書摘Teach Your Child How To ThinkRon Liu
 
Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Ron Liu
 
Day4 Lab
Day4 LabDay4 Lab
Day4 LabRon Liu
 
Day4 Open
Day4 OpenDay4 Open
Day4 OpenRon Liu
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Ron Liu
 
Day3 Lab
Day3 LabDay3 Lab
Day3 LabRon Liu
 
Day3 Quartus II Tutorial
Day3 Quartus II TutorialDay3 Quartus II Tutorial
Day3 Quartus II TutorialRon Liu
 
Day3 實驗板介紹
Day3 實驗板介紹Day3 實驗板介紹
Day3 實驗板介紹Ron Liu
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Day2.Combinational Logic
Day2.Combinational LogicDay2.Combinational Logic
Day2.Combinational LogicRon Liu
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic CircuitsRon Liu
 
Day2 Open
Day2 OpenDay2 Open
Day2 OpenRon Liu
 
Day1 02.Introduction
Day1 02.IntroductionDay1 02.Introduction
Day1 02.IntroductionRon Liu
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroductionRon Liu
 

More from Ron Liu (20)

Engineer
EngineerEngineer
Engineer
 
Start up nations
Start up nationsStart up nations
Start up nations
 
XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07
 
book digest: product design and development
book digest: product design and developmentbook digest: product design and development
book digest: product design and development
 
The Hero Within
The Hero WithinThe Hero Within
The Hero Within
 
About Thinking
About ThinkingAbout Thinking
About Thinking
 
書摘Teach Your Child How To Think
書摘Teach Your Child How To Think書摘Teach Your Child How To Think
書摘Teach Your Child How To Think
 
Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現
 
Day4 Lab
Day4 LabDay4 Lab
Day4 Lab
 
Day4 Open
Day4 OpenDay4 Open
Day4 Open
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現
 
Day3 Lab
Day3 LabDay3 Lab
Day3 Lab
 
Day3 Quartus II Tutorial
Day3 Quartus II TutorialDay3 Quartus II Tutorial
Day3 Quartus II Tutorial
 
Day3 實驗板介紹
Day3 實驗板介紹Day3 實驗板介紹
Day3 實驗板介紹
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Day2.Combinational Logic
Day2.Combinational LogicDay2.Combinational Logic
Day2.Combinational Logic
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic Circuits
 
Day2 Open
Day2 OpenDay2 Open
Day2 Open
 
Day1 02.Introduction
Day1 02.IntroductionDay1 02.Introduction
Day1 02.Introduction
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroduction
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

ModelSim OverView and Simulation Guide