Code coverage in Modelsim

Source: Internet
Author: User

ModelSim code coverage function code coverage, which can report statement, branch, condition, expression, and toggle) and FSM (finite state machine.

1. Compile option ):

In The Modelsim workspace, select the file for viewing code coverage, and right-click compile-> compile properties, as shown in.

 

Select the "coverage" option. In the displayed window, select the options as needed. Here, select statement, branch, condition, expression, and toggle. Click OK.

 

2. Compile (compile)

 

Click in the toolbar to compile all the selected files. After successful compilation, perform the following steps.

 

3. Simulation)

 

In the toolbar, the following window is displayed:

 

(Note: Do not select "enable optimization ")

Select others. The window shown in is displayed:

 

After "Enable code coverage" is selected, click "OK" and the following window appears:

4. observed results

After the preceding operations, the code coverage window appears. After you click (run-all), the code coverage will appear in each window.

 

The following sections describe the subwindows: (1) Workspace windows

 

 

Select the files tab in the workspace window and drag the scroll bar to the right. Each file designed displays the summary statistics of the execution coverage of statements, branches, conditions, expressions, and other statements.

 

Select the files tab in the workspace window and drag the scroll bar to the right. This window displays the overwrite statistics for each entry in the design.

(2) missed coverage (not covered in the Object List window)

This window displays the unexecuted statements, branches, conditions, expressions, or signals of the selected file that have not been flipped.

Select different files on the files Tab Of the workspace window. The display of the missed coverage window is updated with the selected files.

 

Indicates the branch coverage rate.

 

Statement coverage. In this case, select any entity to display the corresponding row in the source code window. If the design contains the row of the executed statement or branch, it will be highlighted in pink, as shown in. The figure contains the hits and BC columns used to display statement execution (statement hits) and branch overwrite (BC.

 

As shown in, select tool> code coverage> show coverage number in the menu bar of the main window.

 

Each row of icons in the hits and BC columns is replaced by numbers, which represent the number of times the statement or branch is executed.

 

 

The following table describes the meanings of icons:

Icon

Description

Indicates that this statement has been executed

Indicates that a statement in this row has never been executed.

Or

Indicates that the "true" or "false" branch of the condition statement has not been executed.

Indicates that this row is instructed not to overwrite the code.

 

 

(3) current exclusion (the coverage rate statistics List window is not currently available)

 

This window is used to list all specified files and rows that do not overwrite statistics.

3.1 set the file to be discharged

, Right-click the selected item, and operate as shown in the figure,

 

After the operation, the excluded files will appear in the current exclusion window, and some lines in the hits column of the source code window will appear, indicating that these lines do not overwrite the code.

 

In the current exclusion window, right-click the file for which you want to cancel the exclusion settings, select cancel selected exclusions, and restore to the original state. code coverage can be implemented.

 

 

3.2 set trip Scheduling

In the source code window, right-click the icon of the row to be excluded in the hits column, and select the first option for row 105 in the figure.

 

Then, the excluded row information is displayed in the current exclusion window. In the source code window, the hits column of the excluded row appears, indicating that the row does not overwrite the code.

 

The same operation is performed to cancel the exclusion line.

 

(4) Details window:

 

This window shows details that are not covered, such as truth tables or flip details.

When selecting a row in the missed coverage window, you can view the details in the Details window, such:

 

(5) instance coverage (instance coverage List window)

 

This window displays the overwrite statistics for each instance.

 

(6) Objects window (signal window)

 

In this window, you can view the status flip statistics. The flip overwrite statistics count the number of times the signal is changed from one status to another.

The specific operation is as follows:

 

The objects window appears after the above operations, so that you can view the specific situation of each signal flip.

 

5. Create a code coverage report

 

As shown in, select tool> code coverage> reports from the menu bar of the main window.

 

The subwindow shown is displayed (report setting window). You can set the options and report storage path as required.

 

Click OK to view the code coverage report:

Address: http://wenku.baidu.com/view/b5b2f0c39ec3d5bbfd0a74b9.html

: Http://download.csdn.net/detail/jackinzhou/4518813

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.