VHDL Simulation: Test Bench
VHDL Simulation: Test Bench
Introduction
Test Bench Structures
Modelsim-Altera simulation
Advanced Test Bench
Introduction
What is a VHDL Test Bench?
VHDL Testbench is a piece of code, which purpose is to verify the
functional correctness of HDL model.
The main objectives are:
• Instantiate the Design Under Test (DUT) or Unit Under Test
(UUT)
• Generate stimulus waveforms for it
• Generate reference outputs and compare them with the
outputs of DUT
• Automatically provide a pass or fail indication
Introduction
Test Bench Structures
Modelsim-Altera simulation
Advanced Test Bench
Question:
How to verify that the function of the test
bench is correct?
Simulation
Simulation
Introduction
Test Bench Structures
Modelsim-Altera simulation
Advanced Test Bench
Setup path:
Quartus II > Tools > Options
Post-layout
(Gate-Level)
Simulation
Slower, but detailed timing
information available.
10/11/13 VHDL Simulation: Test Benches 31
Modelsim-Altera Simulation
Test Bench: functional vs. timing simulation
Functional:
• Ideal, “instantaneous” response.
Hierarchy
navigation
Introduction
Test Bench Structures
Modelsim-Altera simulation
Advanced Test Bench
Simulation
Results:
Uniform distribution:
gives a real between
0 and 1
Procedure:
• Initialize seeds
– Each pair of values
Result can
produce the same result be scaled
(each time the simulation and
converted to
is executed on the same integer
simulator; they are
pseudo-random
numbers).
• Use uniform() function Qualification
required on
and scale its result. Modelsim
Component based-transactions
• More powerful.
• Can contain multiple internal processes. This allows modeling
concurrently-executed sections within a transaction.
• Can be triggered asynchronously from within an executing
transaction without causing it to suspend.
• Procedure:
– Relies on external
variables or signals.
– Not-reusable.
– DIY Lab:
» Make it reusable.
• Call:
10/11/13 VHDL Simulation: Test Benches 45
VHDL Simulation: Test benches TOC
Introduction
Test Bench Structures
Modelsim-Altera simulation
The End
Advanced Test Bench