返回介绍

第二十章 覆盖

发布于 2020-09-09 22:55:56 字数 5218 浏览 941 评论 0 收藏 0

主题
主题描述
20.1 简介(一般信息)Functional verification comprises a large portion of the resources required to design and validate a complex system. Often, the validation must be comprehensive without redundant effort. To minimize wasted effort, coverage is used as a guide for directing verification resources by identifying tested and untested portions of the design.

Coverage is defined as the percentage of verification objectives that have been met. It is used as a metric for evaluating the progress of a verification project in order to reduce the number of simulation cycles spent in verifying a design Broadly speaking, there are two types of coverage metrics. Those... more
20.2 定义覆盖模型:covergroupThe covergroup construct encapsulates the specification of a coverage model. Each covergroup specification can include the following components:
  • A clocking event that synchronizes the sampling of coverage points
  • A set of coverage points
  • Cross coverage between coverage points
  • Optional formal arguments
  • Coverage options
The covergroup construct is a user-defined type. The type definition is written once, and multiple instances of that type can be created in different contexts. Similar to a class, once defined, a covergroup instance can be created via the new() operator. A covergroup can be defined in a module, program, interface, or class.
20.3 在类中使用covergroupBy embedding a coverage group within a class definition, the covergroup provides a simple way to cover a subset of the class properties. This integration of coverage with classes provides an intuitive and expressive mechanism for defining the coverage model associated with a class. For example, In class xyz, defined below, members m_x and m_y are covered using an embedded covergroup:
20.4 定义覆盖点A covergroup can contain one or more coverage points. A coverage point can be an integral variable or an integral expression. Each coverage point includes a set of bins associated with its sampled values or its valuetransitions. The bins can be explicitly defined by the user or automatically created by SystemVerilog. The syntax for specifying coverage points is given below.
20.5 Defining cross coverageA coverage group can specify cross coverage between two or more coverage points or variables. Cross coverage is specified using the cross construct. When a variable V is part of a cross coverage, SystemVerilog implicitly creates a coverage point for the variable, as if it had been created by the statement coverpoint V;. Thus, a cross involves only coverage points. Expressions cannot be used directly in a cross; a coverage point must be explicitly defined first.

The syntax for specifying cross coverage is given below.
20.6 Specifying coverage optionsOptions control the behavior of the covergroup, coverpoint and cross. There are two types of options: those that are specific to an instance of a covergroup, and those that specify an option for the covergroup type as a whole.

The following table lists instance specific covergroup options and their description. Each instance of a covergroup can initialize an instance specific option to a different value. The initialized option value affects only
that instance.

Table 20-1: Instance specific coverage options

20.7 Predefined coverage methodsThe following coverage methods are provided for the covergroup. These methods can be invoked procedurally at any time.

Table 20-5: Predefined coverage methods

20.8 Predefined coverage system tasks and functionsSystemVerilog provides the following system tasks and functions to help manage coverage data collection.

$set_coverage_db_name ( name ) — Sets the filename of the coverage database into which coverage information is saved at the end of a simulation run.

$load_coverage_db ( name ) — Load from the given filename the cumulative coverage information for all coverage group types.

$get_coverage ( ) — Returns as a real number in the range 0 to 100 the overall coverage of all coverage group types. This number is computed as described above.
20.9 Organization of option and type_option membersThe type and type_option members of a covergroup, coverpoint, and cross items are implicitly declared structures with the following composition:
链接 主题

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文