Code Coverage – Can we get a little help here? - Blog - Company - Aldec (2024)

Code Coverage – Can we get a little help here? - Blog - Company - Aldec (1)

Don’t get me wrong, coverage analysis has been used by engineers for years now and it usefulness in improving productivity and verification environment quality can’t be stressed enough. Code coverage, specifically popular statement and branch coverages, is already pretty awesome.

It’s the less talked about areas of code coverage, condition coverage and path coverage, that I’m talking about today. The latest release of Riviera-PRO™ 2015.06 offers a little help here in the form of both condition and path coverage for its UCIS-compatible coverage database.

Let’s talk about these coverage types, and they can enhance the coverage analysis process.

Condition Coverage

Condition coverage monitors and factorizes logical expressions used in conditional statements. This is considered as an extension to expression coverage, which factorizes logical expressions, but condition coverage monitors expressions that occur as a condition within constructs such asif, then, while, and so on.

Let’s consider following example, where you have following conditional expression in your code:

(ce = '1') = TRUE

When you run condition coverage on such code – it gives you following results.

Code Coverage – Can we get a little help here? - Blog - Company - Aldec (2)

Fig1: Condition Coverage Summary

Code Coverage – Can we get a little help here? - Blog - Company - Aldec (3)

Fig2: Condition Coverage Details

In the condition coverage report you will notice that there are two expressions that have been tested - (ce = '1') = TRUE and ce = '1'

For both of these expressions, it turns out that our test case is evaluating only 1 out of 2 possible cases. This is reflected in coverage summary table that shows that only 2 out of 4 coverage bins were covered. The total number of coverage bins corresponds to the number of rows displayed in all the truth tables for the given conditional expressions.

Now think about this, your statement coverage might tell you that this line has been covered but it does not give you full details if this expression was fully exercised for all the conditions.

Path Coverage

As we have pointed out above, Expression/Condition coverage shows more detail compared to statement coverage, similarly this holds true when analyzing path coverage data with branch coverage. Conditional statements like if-else and case create different paths for the stimulus to flow in your design. While branch coverage shows you the execution of branches, path coverage shows you the execution of the program paths and analyzes all possible sequences of program execution.

So what is a program path? It is a sequence of execution of conditional statements performed in a specific order. So basically Path Coverage collects information about in which order the consecutive statements are executed, the branches that are examined and how logical conditions evaluated during simulation.

Analysis of a path coverage report is not an easy task as it requires deeper understanding of a particular design. So for the purpose of this blog, let’s use a simple example.

Consider following sample code:

Code Coverage – Can we get a little help here? - Blog - Company - Aldec (4)

Fig3: Example Code

Here two conditional blocks are formed by if statements - Block1(1) andBlock2(2). Each block has two branches, ifreturningtrue(T) andelsereturningfalse(F).

Typically when you force a=1,b=1anda=0,b=0 – your statement/branch coverage will give you 100% coverage. Table below shows the path covered by these test.

Code Coverage – Can we get a little help here? - Blog - Company - Aldec (5)

Fig4: Program Path

But these two data sets allow testing only 2 (T1-T2 and F1-F2) of 4 possible paths (T1-T2, T1-F2, F1-T2, and F1-F2), meaning path coverage would be only 50%. The sample code is not tested with a=0, b=1 and a=1, b=0 which covers path F1-T2 and T1-F2. This means that statement/branch coverage would not detect the path leading to the divide-by-zero error, which occurs for a=0,b=1, i.e. for the F1-T2 path.

Now if your code contains more branches, then the total number of possible path combinations would skyrocket. For a simulation that has very large number of paths to analyze, it may be very difficult to create a complete set of test-vectors to examine all the paths. Using path coverage will allow you to analyze a subset of paths instead of verifying thousands of sub path combinations.

So in a nutshell – condition and path coverage adds more useful details to your coverage analysis allowing you to complete your verification process more confidently.

If you’d like to learn more, I invite you to explore our many online resources for Riviera-PRO, including Fast Track to Riviera-PRO, Part 1: Design Entry and Simulation, and Fast Track to Riviera-PRO, Part 2: Advanced Debugging, Code Coverage and Scripting.

To take a test drive, visit www.aldec.com/products/riviera-pro or contact [email protected].

Code Coverage – Can we get a little help here?  - Blog - Company - Aldec (2024)
Top Articles
Annual Wellness Visit
Call Rates to Austria and How to Call | Lebara Australia
Northern Counties Soccer Association Nj
Great Clips Mount Airy Nc
Skylar Vox Bra Size
Brady Hughes Justified
13 Easy Ways to Get Level 99 in Every Skill on RuneScape (F2P)
Seething Storm 5E
Aces Fmc Charting
Craigslist Nj North Cars By Owner
Mr Tire Rockland Maine
Which Is A Popular Southern Hemisphere Destination Microsoft Rewards
Student Rating Of Teaching Umn
Craigslist Farm And Garden Tallahassee Florida
iLuv Aud Click: Tragbarer Wi-Fi-Lautsprecher für Amazons Alexa - Portable Echo Alternative
Mail.zsthost Change Password
How Much Is Tay Ks Bail
Kountry Pumpkin 29
Full Standard Operating Guideline Manual | Springfield, MO
zom 100 mangadex - WebNovel
Boscov's Bus Trips
Myhr North Memorial
Stoney's Pizza & Gaming Parlor Danville Menu
Pearson Correlation Coefficient
Glover Park Community Garden
Sunset Time November 5 2022
Village
Dark Entreaty Ffxiv
Bay Area Craigslist Cars For Sale By Owner
The Boogeyman (Film, 2023) - MovieMeter.nl
Free T33N Leaks
Healthy Kaiserpermanente Org Sign On
Co10 Unr
Stubhub Elton John Dodger Stadium
Dailymotion
Blush Bootcamp Olathe
Sun Haven Pufferfish
What Time Does Walmart Auto Center Open
Kstate Qualtrics
Craigslist Hamilton Al
Spinning Gold Showtimes Near Emagine Birch Run
Pillowtalk Podcast Interview Turns Into 3Some
Mckinley rugzak - Mode accessoires kopen? Ruime keuze
Pepsi Collaboration
How to Get a Better Signal on Your iPhone or Android Smartphone
Tacos Diego Hugoton Ks
Bf273-11K-Cl
Missed Connections Dayton Ohio
Naomi Soraya Zelda
Ret Paladin Phase 2 Bis Wotlk
Zalog Forum
Texas 4A Baseball
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6373

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.