Title: Simulation and Testbench
1Simulation and Testbench
Nov. 3rd 2005
2Simulation
3Chip tester
4Test bench
5A Simple Test Bench
6Simulation result
7Using Assert Statement
Assert boolean-expression report
string-expression severity expression
The boolean-expression is evaluated and if the
expression is false, the string-expression
specified in report statement is displayed in the
simulator window. The severity statement then
indicates to the simulator what action should be
taken in response to the assertion
failure. Severity NOTE, WARNING, ERROR, FAILURE.
8Using Assert Example
9Simulation result
10continued
Wrong AND code
11Failed assert
12Can we change assert positions?
changed
13Simulation of wrong test bench
14Explain the simulation result
15Using Loop and Multiple Processes
data_in
data_out
clock
16Simulation results
17Using Test Vectors
18Simulation Results
19Reading and Writing Files
THE TEXTIO PACKAGE TEXTIO is a package of VHDL
functions that read and write text files. To make
the package visible use std.textio.all Data
Types text -- a file of character strings
line -- one string from a text file Example
Declarations   file Prog text is in
"file_name" --text file "file_name" Â Â
variable L line             -- read lines
from file to L Reading Values From a
File readline --Read one line from "text" file
F to "line" L read --Read one value from "line"
L into variable VALUE Writing values to a
file writeline --Write one line to "text" file
F from "line" L Â write --Write one value to
"line" L from variable VALUE
20Reading File Example
21Simulation Results
22Writing File Example
23Simulation Results
24Reading Assignment
Chapter 11 Model Simulation