SlideShare a Scribd company logo
1 of 30
MODEL SIMULATION
Prepared by
Abdullah Fadel
Outline
Abstract
Simulation
Writing a Test Bench
- Waveform Generation
. Repetitive Patterns
. Using Vectors
- Monitoring Behavior
Abstract
 describes the environment necessary for simulating hardware
models written in VHDL.
 These models can be tested by writing test bench models which can
themselves be described in VHDL.
 Some approaches to writing test bench models .
Simulation
• Decide what type of simulation will be performed.
• what values would be used during simulation.
• Would all objects (signals and variables) take values '0' or 'V only, or would
they take values '0', 'V, 'V', or 'Z', or use other logic levels?
• number of values used during simulation will define the basic types used to
model hardware(prior to writing any model), the predefined types that the
language provides are not sufficient to model values such as "U'
(undefined) and 'Z' (high-impedance).
• The language, however, does provide the capability of creating user-
defined types that can be used to model the values required for a
particular simulation. In certain cases, it may be sufficient to model
hardware using the predefined types of the language, for example, when
modeling hardware at an abstract level where all data may be represented
strictly as integers
Example
• we shall assume that we are interested in performing a four-value simulation, 'U'
to represent undefined, '0' to represent logic 0, 'Y to represent logic I, and 'Z' to
represent high-impedance. The basic types are, therefore, defined as:
• The leftmost value of the MVL type is defined to be a 'U' so that all objects that
are defined to be of this base type will have an initial value of 'U' at start of
simulation. "This accurately models real hardware.
• These new basic types are still insufficient to model hardware. What is lacking is a
set of operations that can operate on these types. Most of the operators in the
language are defined for the predefined types only.
• Therefore, to allow operations on these new types, we need to provide
overloaded operator functions for all the language operators that are needed to
operate on these types. Often, it is useful to put all such information into a
package.
Example
Example : using the new package
Example : Package in structural model
Example : Package in behavioral model
Writing a Test Bench
• A test bench is a model that is used to exercise and verify the
correctness of a hardware model . A test bench has three main
purposes:
• Generate stimulus for simulation
(waveforms)1
• Apply this stimulus to the entity under
test and to monitor the output
responses
2
• monitor output responses with
expected known values3
A format of a test bench
Waveform Generation
Main approaches in generating stimulus values:
1. create waveforms and apply stimulus at certain discrete time
intervals
2. generate stimulus based on the state of the entity, that is, based on
the output response of the entity.
Two types of waveforms are typically needed :
1. Repetitive Patterns
2. Using Vectors
1-Repetitive Patterns
• A repetitive pattern with a constant on-off delay can be created using
a concurrent signal assignment statement.
• - Signal A is assumed to be of type BIT.A <= not A after 20 ns;
• A clock with varying on-off period can be created using a process
statement
A problem
both of these approaches is that if the host environment provides no control
over the amount of time simulation is to be performed, simulation would go on
until time is equal to TIME'HIGH causing a lot of simulation time to be wasted.
Solution
One way to avoid this is to put an assertion statement in the process that will
cause the assertion to fail after a specific time. Here is such an example of an
assertion statement.
• Assertion would fail when simulation time exceeds 1000 ns and simulation would stop
(assuming that the simulator stops on getting a severity level of ERROR).
Another Ways To Generate Clock
• An alternate way to generate a clock with a varying on-off period is
by using a conditional signal assignment statement. Here is an
example.
Another Ways To Generate Clock(Cont.)
• A clock that is phase delayed from another clock can be generated by
using the DELAYED predefined attribute. For example:
Another Ways To Generate Clock(Cont.)
• Two overlapping clocks can be generated in a similar manner by making sure that
the time specified for the DELAYED attribute is larger than the clock's on-period.
• A sequential set of values can also be generated for a signal by using multiple
waveforms in a concurrent signal assignment statement. For example,
Another Ways To Generate Clock(Cont.)
• The previous waveform can be made to repeat itself by placing the
signal assignment statement inside a process statement along with a
wait statement. The following example of a two-phase clock shows
such a repeated waveform.
2-Using Vectors
• Another way to apply stimulus to a set of signals is to store the set of
vectors in a constant table or in an ASCII file.
• Example :stores the input vectors in a table
INPUT_VECTORS (1-5)
1001
1000
0010
0000
0110
• Assume that the entity under test has four inputs. A, B, C, and D. If
the vectors are to be applied at regular time intervals, a generate
statement can be used as shown :
If the vectors were to be applied at arbitrary intervals, a concurrent
signal assignment statement with multiple waveforms can be used.
• Example :stores the input vectors in an ASCII file as a sequence of
values.
 A complete test bench that uses the waveform application method is
shown next. The entity being simulated is called DIV. The output value is
written into a file for later comparison.
• Consider an entity in which the objective is to compute the factorial of an
input number. The handshake mechanism between the entity under test
and the test bench model is shown bellow
• RESET input to the entity resets the
factorial model to an initial state.
• START signal is set after the DATA input is
applied.
• DONE signal is set when computation is
complete,
• FAC_OUT and EXP_OUT outputs signals
to indicate output
• . The resulting factorial value is [ FAC.OUT *
2^EXP_OUT ].
Hands on Example
 The test bench model applies the data, sets the START signal, waits for DONE signal,
and then applies the next input data. Assertion statements are used to make sure that
the values appearing at the output are correct.
Cont.
Monitoring Behavior
• Another common way to monitor the output response of an entity is to
apply a vector, sample the output after a specific time and then verify to
make sure that the output response matches the expected values.
• Remember :In the test bench model for the FACTORIAL entity, we saw
how the test bench can monitor the behavior of the entity and apply
different patterns based on the output response .
Example
The input and output vectors are stored in tables. Alternately,
they could have been read from an ASCII file.
• In this test bench example, the application of test vectors is expressed
as a process. After a test vector is applied, the process suspends for
time (CYCLE_TIME - STROBE_DELAY), samples the output and then
checks to see if the expected output is equal to the specified output
vector. The process then suspends for STROBE_DELAY time before
reapplying the next vector.
Model simulation VHDL

More Related Content

What's hot

Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7ashhadiqbal
 
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and TensorfowAaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and TensorfowAminaRepo
 
Effective Java - Design Method Signature Overload Varargs
Effective Java - Design Method Signature Overload VarargsEffective Java - Design Method Signature Overload Varargs
Effective Java - Design Method Signature Overload VarargsRoshan Deniyage
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersRebecca Bilbro
 
Pj01 3-java-variable and data types
Pj01 3-java-variable and data typesPj01 3-java-variable and data types
Pj01 3-java-variable and data typesSasidharaRaoMarrapu
 
Intro To Scala
Intro To ScalaIntro To Scala
Intro To Scalachambeda
 
Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7ArraLafuente
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7helpido6
 
Aaa ped-22-Artificial Neural Network: Introduction to ANN
Aaa ped-22-Artificial Neural Network: Introduction to ANNAaa ped-22-Artificial Neural Network: Introduction to ANN
Aaa ped-22-Artificial Neural Network: Introduction to ANNAminaRepo
 
Handling inputs via scanner class
Handling inputs via scanner classHandling inputs via scanner class
Handling inputs via scanner classsimarsimmygrewal
 
Lesson 4 ar-ma
Lesson 4 ar-maLesson 4 ar-ma
Lesson 4 ar-maankit_ppt
 
Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialKuntal Bhowmick
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)Henry Muccini
 

What's hot (18)

Towards Automated A/B Testing
Towards Automated A/B TestingTowards Automated A/B Testing
Towards Automated A/B Testing
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and TensorfowAaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
 
Effective Java - Design Method Signature Overload Varargs
Effective Java - Design Method Signature Overload VarargsEffective Java - Design Method Signature Overload Varargs
Effective Java - Design Method Signature Overload Varargs
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
 
Pj01 3-java-variable and data types
Pj01 3-java-variable and data typesPj01 3-java-variable and data types
Pj01 3-java-variable and data types
 
Intro To Scala
Intro To ScalaIntro To Scala
Intro To Scala
 
Qtp Training
Qtp Training Qtp Training
Qtp Training
 
Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7Software Engineering - Module 3: Lesson7
Software Engineering - Module 3: Lesson7
 
Static variable
Static variableStatic variable
Static variable
 
Functions
FunctionsFunctions
Functions
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
Aaa ped-22-Artificial Neural Network: Introduction to ANN
Aaa ped-22-Artificial Neural Network: Introduction to ANNAaa ped-22-Artificial Neural Network: Introduction to ANN
Aaa ped-22-Artificial Neural Network: Introduction to ANN
 
Handling inputs via scanner class
Handling inputs via scanner classHandling inputs via scanner class
Handling inputs via scanner class
 
Lesson 4 ar-ma
Lesson 4 ar-maLesson 4 ar-ma
Lesson 4 ar-ma
 
Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorial
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)
 

Similar to Model simulation VHDL

Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Abhishek Bose
 
Java Unit Test - JUnit
Java Unit Test - JUnitJava Unit Test - JUnit
Java Unit Test - JUnitAktuğ Urun
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsSteven Li
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0PMILebanonChapter
 
Lecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfLecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfNikhilSoni177492
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designMaitree Patel
 
Test pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXTest pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXUrmilasSrinivasan
 
Test Coverage: An Art and a Science
Test Coverage: An Art and a ScienceTest Coverage: An Art and a Science
Test Coverage: An Art and a ScienceTeamQualityPro
 
Lect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersLect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersDr.YNM
 
Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test Gregory Solovey
 
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...Daniel Katz
 

Similar to Model simulation VHDL (20)

Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Java Unit Test - JUnit
Java Unit Test - JUnitJava Unit Test - JUnit
Java Unit Test - JUnit
 
Sva.pdf
Sva.pdfSva.pdf
Sva.pdf
 
Mini Project- ROM Based Sine Wave Generator
Mini Project- ROM Based Sine Wave GeneratorMini Project- ROM Based Sine Wave Generator
Mini Project- ROM Based Sine Wave Generator
 
TDD Training
TDD TrainingTDD Training
TDD Training
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementations
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
 
Lecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdfLecture-07 Modelling techniques.pdf
Lecture-07 Modelling techniques.pdf
 
Junit
JunitJunit
Junit
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
 
Test pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUXTest pattern Generation for 4:1 MUX
Test pattern Generation for 4:1 MUX
 
Application Security
Application SecurityApplication Security
Application Security
 
E0463137
E0463137E0463137
E0463137
 
Test Coverage: An Art and a Science
Test Coverage: An Art and a ScienceTest Coverage: An Art and a Science
Test Coverage: An Art and a Science
 
Lect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersLect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute Beginners
 
Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test
 
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 7, 8 - Pr...
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 

Recently uploaded

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Model simulation VHDL

  • 2. Outline Abstract Simulation Writing a Test Bench - Waveform Generation . Repetitive Patterns . Using Vectors - Monitoring Behavior
  • 3. Abstract  describes the environment necessary for simulating hardware models written in VHDL.  These models can be tested by writing test bench models which can themselves be described in VHDL.  Some approaches to writing test bench models .
  • 4. Simulation • Decide what type of simulation will be performed. • what values would be used during simulation. • Would all objects (signals and variables) take values '0' or 'V only, or would they take values '0', 'V, 'V', or 'Z', or use other logic levels? • number of values used during simulation will define the basic types used to model hardware(prior to writing any model), the predefined types that the language provides are not sufficient to model values such as "U' (undefined) and 'Z' (high-impedance). • The language, however, does provide the capability of creating user- defined types that can be used to model the values required for a particular simulation. In certain cases, it may be sufficient to model hardware using the predefined types of the language, for example, when modeling hardware at an abstract level where all data may be represented strictly as integers
  • 5. Example • we shall assume that we are interested in performing a four-value simulation, 'U' to represent undefined, '0' to represent logic 0, 'Y to represent logic I, and 'Z' to represent high-impedance. The basic types are, therefore, defined as: • The leftmost value of the MVL type is defined to be a 'U' so that all objects that are defined to be of this base type will have an initial value of 'U' at start of simulation. "This accurately models real hardware. • These new basic types are still insufficient to model hardware. What is lacking is a set of operations that can operate on these types. Most of the operators in the language are defined for the predefined types only. • Therefore, to allow operations on these new types, we need to provide overloaded operator functions for all the language operators that are needed to operate on these types. Often, it is useful to put all such information into a package.
  • 7. Example : using the new package
  • 8. Example : Package in structural model
  • 9. Example : Package in behavioral model
  • 10. Writing a Test Bench • A test bench is a model that is used to exercise and verify the correctness of a hardware model . A test bench has three main purposes: • Generate stimulus for simulation (waveforms)1 • Apply this stimulus to the entity under test and to monitor the output responses 2 • monitor output responses with expected known values3
  • 11. A format of a test bench
  • 12. Waveform Generation Main approaches in generating stimulus values: 1. create waveforms and apply stimulus at certain discrete time intervals 2. generate stimulus based on the state of the entity, that is, based on the output response of the entity. Two types of waveforms are typically needed : 1. Repetitive Patterns 2. Using Vectors
  • 13. 1-Repetitive Patterns • A repetitive pattern with a constant on-off delay can be created using a concurrent signal assignment statement. • - Signal A is assumed to be of type BIT.A <= not A after 20 ns;
  • 14. • A clock with varying on-off period can be created using a process statement
  • 15. A problem both of these approaches is that if the host environment provides no control over the amount of time simulation is to be performed, simulation would go on until time is equal to TIME'HIGH causing a lot of simulation time to be wasted. Solution One way to avoid this is to put an assertion statement in the process that will cause the assertion to fail after a specific time. Here is such an example of an assertion statement. • Assertion would fail when simulation time exceeds 1000 ns and simulation would stop (assuming that the simulator stops on getting a severity level of ERROR).
  • 16. Another Ways To Generate Clock • An alternate way to generate a clock with a varying on-off period is by using a conditional signal assignment statement. Here is an example.
  • 17. Another Ways To Generate Clock(Cont.) • A clock that is phase delayed from another clock can be generated by using the DELAYED predefined attribute. For example:
  • 18. Another Ways To Generate Clock(Cont.) • Two overlapping clocks can be generated in a similar manner by making sure that the time specified for the DELAYED attribute is larger than the clock's on-period. • A sequential set of values can also be generated for a signal by using multiple waveforms in a concurrent signal assignment statement. For example,
  • 19. Another Ways To Generate Clock(Cont.) • The previous waveform can be made to repeat itself by placing the signal assignment statement inside a process statement along with a wait statement. The following example of a two-phase clock shows such a repeated waveform.
  • 20. 2-Using Vectors • Another way to apply stimulus to a set of signals is to store the set of vectors in a constant table or in an ASCII file. • Example :stores the input vectors in a table INPUT_VECTORS (1-5) 1001 1000 0010 0000 0110
  • 21. • Assume that the entity under test has four inputs. A, B, C, and D. If the vectors are to be applied at regular time intervals, a generate statement can be used as shown : If the vectors were to be applied at arbitrary intervals, a concurrent signal assignment statement with multiple waveforms can be used.
  • 22. • Example :stores the input vectors in an ASCII file as a sequence of values.
  • 23.  A complete test bench that uses the waveform application method is shown next. The entity being simulated is called DIV. The output value is written into a file for later comparison.
  • 24. • Consider an entity in which the objective is to compute the factorial of an input number. The handshake mechanism between the entity under test and the test bench model is shown bellow • RESET input to the entity resets the factorial model to an initial state. • START signal is set after the DATA input is applied. • DONE signal is set when computation is complete, • FAC_OUT and EXP_OUT outputs signals to indicate output • . The resulting factorial value is [ FAC.OUT * 2^EXP_OUT ]. Hands on Example
  • 25.  The test bench model applies the data, sets the START signal, waits for DONE signal, and then applies the next input data. Assertion statements are used to make sure that the values appearing at the output are correct.
  • 26. Cont.
  • 27. Monitoring Behavior • Another common way to monitor the output response of an entity is to apply a vector, sample the output after a specific time and then verify to make sure that the output response matches the expected values. • Remember :In the test bench model for the FACTORIAL entity, we saw how the test bench can monitor the behavior of the entity and apply different patterns based on the output response .
  • 28. Example The input and output vectors are stored in tables. Alternately, they could have been read from an ASCII file.
  • 29. • In this test bench example, the application of test vectors is expressed as a process. After a test vector is applied, the process suspends for time (CYCLE_TIME - STROBE_DELAY), samples the output and then checks to see if the expected output is equal to the specified output vector. The process then suspends for STROBE_DELAY time before reapplying the next vector.