Sie sind auf Seite 1von 69

Code Coverage and Advanced

Verification Management
Functional Coverage
Randomized Stimulus
Self-Checking Testbenches
Transaction Level Stimulus
Assertions
Test Plan
Code Coverage

The Seven Steps to Fast Lab Debug


Functional Coverage
Randomized Stimulus
Self-Checking Testbenches
Transaction Level Stimulus
Assertions
Test Plan
Code Coverage

The Seven Steps to Fast Lab Debug


Functional Coverage
Randomized Stimulus
Self-Checking Testbenches
Transaction Level Stimulus
Assertions
Test Plan
Code Coverage

Code Coverage

Five Kinds of Code Coverage


1.

Statement Coverage

2.

Branch Coverage

3.

Condition Coverage

4.

Expression Coverage

5.

Finite State Machine (FSM) Coverage

Mnemonic

Some

Beer

For

Extra

Courage

Running Code Coverage

+cover arguments

+cover=sbfec

-coverage option

s
b
c
e
f

Statement
Branch
Condition
Expression
Finite
State Machine
Mnemonic

Some

Beer

For

Extra

Courage

Running Coverage

Compile DUT with +cover option

Compile Testbench without coverage

Simulate with coverage option

Demo: Running Coverage

Compile
Compile DUT
DUTwith
with coverage.
coverage.

Compile
Compile test
test bench
bench without
without
coverage.
coverage.

Compile
Compile test
test without
without coverage
coverage

Simulate
Simulate with
with no
no optimization
optimization
and
and with
with coverage
coverage

ModelSim
ModelSimswitches
switches to
to the
the
coverage
coverage layout
layout

Coverage
Stats

Instance
coverage

Source
Code View

Missing
coverage
Details of
Misses

Statement Coverage

Demo Statement Coverage

Select DUT to See Statement


Coverage

Expand
Expand source
source window
window
to
to see
see missing
missing coverage
coverage

Browse
Browse Missing
Missing
Coverage
Coverage

Demo Branch Coverage

Branch Stats

Missing
Branches

Branch Details

Miss Information

This branch was


never taken

Condition & Expression Coverage

UDP vs. FEC Expression Coverage

OUT = A OR B

UDP Says Three Input Combinations

OUT = A OR B
A

OUT

Rows are Unique Inputs

FEC Says Four Input Combinations

OUT = A OR B
A

OUT

OUT

Rows are # of ways each input can affect the outputs

Demo: Expression and Condition Coverage

UDP and FEC


Coverage

Missed
UDP or FEC
Coverage

Press F5 For
Details

UDP Details

FEC Details
We missed one!

Finite State Machine Coverage

Demo: FSM Coverage

FSM
Statistics

Missed States

Expand to see
State Machine

Missed State
Details

Missed State

Creating Exclusions

Complete Code Coverage

Create Exclusions
in the GUI

Create Exclusions in Scripts

Create Exclusions in
Source Code

Unified Coverage Management


Collects coverage data from all verification engines
Open API for tools to read and write

Test
Functional Assertion
Code
Engine
Coverage Coverage

0-in
Formal

User
Coverage

Test
Specific

Plan

Native UCDB Generation

Test Associated Merging


HTML Export

UCDB

Open Read And Write


API, C Functions & CLI

RD / WR API

UCDB Browser

RD / WR API

Test Ranking

Test Plan Tracking & Analysis

UCDB Demo

Source and
Test Bench

Tests

UCDB
Output

Source
and Test
Bench

Testplan
to UCDB
Testplan

Script to
Run Tests

Create XML Test Plan


Test List

Coverage Goals

Test Bench Script


Compile
CompileDUT
DUTand
andTest
TestBench
Bench

Read
Readtest
testmodules
modulesout
outofofTests
Teststhen
then
compile
compileand
andsimulate.
simulate.

Store
StoreCoverage
Coverageand
andDebug
Debug
information
from
each
information from eachtest
test

Report
ReportResults
Results

Tests

Test
TestRunning
Running

Testing
Testingcache
cachehits
hits

UCDB Directory Contains Coverage

Open
OpenVerification
VerificationBrowser
Browser

Import
ImportTest
TestPlan
PlanXML
XML

Add
AddResult
ResultUCDB
UCDBFiles
Filesfrom
from
UCDB
UCDBDirectory
Directory

Merge
Mergethe
thecoverage
coverageresults
resultsfrom
from
all
allthe
thetests
testswith
withthe
thetest
testplan
plantoto
see
seethat
thatweve
wevecovered
coveredthe
the
complete
completeplan
plan

Merge
Mergethe
thecoverage
coverageresults
resultsfrom
from
all
allthe
thetests
testswith
withthe
thetest
testplan
plantoto
see
seethat
thatweve
wevecovered
coveredthe
the
complete
completeplan.
plan. GREEN
GREENisisgood.
good.
We
Wehave
have100%
100%coverage
coverageininthe
the
types
typesofofcoverage
coveragewe
weused
used

Notice
Noticethat
thatweve
weverun
runall
allthe
thetests
tests
ininthe
theplan.
plan.

Rank
Rankthe
thetests
teststotosee
seewhich
whichgive
give
the
themost
mostcoverage
coverage

You
Youonly
onlyneed
needtwo
twotests
teststotofully
fully
cover
coverthe
thedesign
design

Create
CreateHTML
HTMLReport
Reportfor
forall
all
merged
mergedcoverage
coveragedata
data

Name
Namethe
thedirectory
directorythat
thatwill
willhold
hold
index.html
index.html

All
AllUCDB
UCDBCommands
Commandsare
are
scriptable.
scriptable. This
Thisscript
script
captures
capturesall
alltest
testdata
dataand
and
creates
HTML
Report
creates HTML Report

http://supportnet.mentor.com/

http://communities.mentor.com/

ModelSim SE Users Manual

ModelSim SE Users Manual

Das könnte Ihnen auch gefallen