返回介绍

28.3.2.1 Using vpi_get_assertion_info

发布于 2020-09-09 22:55:59 字数 1945 浏览 993 评论 0 收藏 0

Static information can be obtained directly from an assertion handle by using vpi_get_assertion_info(), as shown below.

typedef struct t_vpi_source_info {
    PLI_BYTE8 *fileName;
    PLI_INT32 startLine;
    PLI_INT32 startColumn;
    PLI_INT32 endLine;
    PLI_INT32 endColumn;
} s_vpi_source_info, *p_vpi_source_info;

typedef struct t_vpi_assertion_info {
    PLI_BYTE8 *assertName; /* name of assertion */
    vpiHandle instance; /* instance containing assertion */
    PLI_BYTE8 defname; /* name of module/interface containing assertion */
    vpiHandle clock; /* clocking expression */
    PLI_INT32 assertionType; /* vpiSequenceType, vpiAssertType, vpiCoverType,*/
                             /* vpiPropertyType, vpiImmediateAssertType */
    s_vpi_source_info sourceInfo;
} s_vpi_assertion_info, *p_vpi_assertion_info;

PLI_INT32 vpi_get_assertion_info (assert_handle, p_vpi_assertion_info);

This call obtains all the static information associated with an assertion.

The inputs are a valid handle to an assertion and a pointer to an existing s_vpi_assertion_info data structure. On success, the function returns TRUE and the s_vpi_assertion_info data structure is filled in as appropriate. On failure, the function returns FALSE and the contents of the assertion data structure are unpredictable.

Assertions can occur in modules and interfaces: for assertions defined in modules, the instance field in the s_vpi_assertion_info structure shall contain the handle to the appropriate module or interface instance. Note that VPI does not currently define the information model for interfaces and therefore the interface instance handle shall be implementation dependent. The clock field of that structure contains a handle to the event expression representing the clock for the assertion, as determined by Section 17.14.

NOTE: a single call returns all the information for efficiency reasons.

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

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

发布评论

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