返回介绍

30.8.1 VPI read initialization and load access initialization

发布于 2020-09-09 22:56:03 字数 5964 浏览 831 评论 0 收藏 0

Selecting an object is done in 3 steps:

1) The first step is to initialize the read access with a call to vpi_load_extension() to load the reader extension and set:

a) Name of the reader library to be used specified as a character string. This is either a full pathname to this library or the single filename (without path information) of this library, assuming a vendor specific way of defining the location of such a library. The latter method is more portable and therefore recommended. Neither the full pathname, nor the single filename shall include an extension, the name of the library must be unique and the appropriate extension for the actual platform should be provided by the application loading this library More details are in Section 30.10.

b) Name of the database holding the stored data or flush database in case of vpiAccessPostProcess or vpiAccessInteractive respectively; a NULL can be used in case of vpiAccessLimitedInteractive. This is the logical name of a database, not the name of a file in the file system. It is implementation dependent whether there is any relationship to an actual on-disk object and the provided name. See access mode below for more details on the access modes.

c) Access mode: The following VPI properties set the mode of access

— vpiAccessLimitedInteractive: Means that the access shall be done for the data stored in the tool memory (e.g. simulator), the history (or future) that the tool stores is implementation dependent. If the tool does not store the requested info then the querying routines shall return a fail. The database name argument to vpi_load_extension() in this mode shall be ignored (even if not NULL).

— vpiAccessInteractive: Means that the access shall be done interactively. The tool shall then use the database specified as a “flush” area for its data. This mode is very similar to the vpiAccessLimitedInteractive with the additional requirement that all the past history (before current time) shall be stored (for the specified scope/collection, see the access scope/collection description of vpi_load_init().

— vpiAccessPostProcess: Means that the access shall be done through the specified database. All data queries shall return the data stored in the specified database. Data history depends on what is stored in the database, and can be nothing (i.e. no data).

vpi_load_extension() can be called multiple times for different reader interface libraries (coming from different tools), database specification, and/or read access. A call with vpiAccessInteractive means that the user is querying the data stored inside the simulator database and uses the VPI routines supported by the simulator. A call with vpiAccessPostProcess means that the user is accessing the data stored in the database and uses the VPI services provided by the waveform tool. The application, if accessing several databases and/or using multiple read API libraries, can use the routine vpi_get(vpiBelong, <vpiHandle>) to check whether a handle belongs to that database. The call is performed as follows:

reader_extension_ptr->vpi_get(vpiBelong, <vpiHandle>);

where reader_extension_ptr is the reader library pointer returned by the call to vpi_load_extension(). TRUE is returned if the passed handle belongs to that extension, and FALSE otherwise.

If the application uses the built-in library (i.e. the one provided by the tool it is running under), there is no need to use indirection to call the VPI routines; they can be called directly. An initial call must however be made to set the access mode, specify the database, and check for error indicated by a NULL return.

vpi_close() shall be called in case of:

  • vpiAcessLimitedInteractive to perform any tool cleanup. The validity of VPI handles after this call is left up to the particular reader implementation.
  • vpiAccessPostProcess or vpiAccessInteractive mode to perform any tool cleanup and close the opened database. Handles obtained before the call to vpi_close() are no longer valid after this call.
Multiple databases, possibly in different access modes (for example a simulator database opened in vpi- AccessInteractive and a database opened in vpiAccessPostProcess, or two different databases opened in vpiAccessPostProcess) can be accessed at the same time. Section 30.10 shows an example of how to access multiple databases from multiple read interfaces simultaneously.

2) Next step is to specify the elements that shall be accessed. This is accomplished by calling vpi_load_init() and specifying a scope and/or an item collection. At least one of the two (scope or collection) needs to be specified. If both are specified then the union of all the object elements forms the entire set of objects the user can access.

  • Access scope: The specified scope handle, and nesting mode govern the scope that access returns. Data queries outside this scope (and its sub-scopes as governed by the nesting mode) shall return a fail in the access routines unless the object belongs to access collection described below. It can be used either in a complementary or in an exclusive fashion to access collection. NULL is to be passed to the collection when access scope is used in an exclusive fashion.
  • Access collection: The specified collection stores the traverse object handles to be loaded. It can be used either in a complementary or in an exclusive fashion to access scope. NULL is to be passed to the scope when access collection is used in an exclusive fashion.
vpi_load_init() enables access to the objects stored in the database and can be called multiple times. The load access specification of a call remains valid until the next call is executed. This routine serves to initialize the tool load access and provides an entry point for the tool to perform data access optimizations.

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

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

发布评论

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