返回介绍

第二十三章 系统任务与系统函数

发布于 2020-09-09 22:55:57 字数 4424 浏览 1083 评论 0 收藏 0

主题

主题描述
23.1 简介(一般信息)SystemVerilog加入了几个将在下面几节中描述的系统任务和系统函数。

另外,SystemVerilog扩展了几个Verilog-2001系统任务的行为,这些扩展将在23.14节中描述。

23.2 确立时的typeof函数
23.3 typename函数
23.4 表达式尺寸系统函数
23.5 范围系统函数
23.6 Shortreal转换Verilog 2001 defines a real data type, and the system functions $realtobits and $bitstoreal to permit exact bit pattern transfers between a real and a 64 bit vector. SystemVerilog adds the shortreal type, and in a parallel manner, $shortrealtobits and $bitstoshortreal are defined to permit exact bit transfers between a shortreal and a 32 bit vector.
23.7 数组查询系统函数
23.8 断言严重性系统任务
23.9 断言控制系统任务
23.10 断言系统函数
23.11 随机数系统函数To supplement the Verilog $random system function, SystemVerilog provides three special system functions for generating pseudorandom numbers, $urandom, $urandom_range and $srandom. These system functions are presented in Section 12.12.
23.12 程序控制In addition to the normal simulation control tasks ($stop and $finish), a program can use the $exit control task. When all programs exit, the simulation finishes and an implicit call to $finish is made. The usage of $exit is presented in Section 16.6 on program blocks.
23.13 覆盖系统函数SystemVerilog has several built-in system functions for obtaining test coverage information: $coverage_control, $coverage_get_max, $coverage_get, $coverage_merge and $coverage_save. The coverage system functions are described in Section 29.2.
23.14 对Verilog-2001系统任务的增强SystemVerilog adds system tasks and system functions as described in the following sections. In addition, SystemVerilog extends the behavior of the following:

  • %u and %z format specifiers:
    • For packed data, %u and %z are defined to operate as though the operation were applied to the equivalent vector.
    • For unpacked struct data, %u and %z are defined to apply as though the operation were performed on each member in declaration order.
    • For unpacked union data, %u and %z are defined to apply as though the operation were performed on the first member in declaration order.
    • %u and %z are not defined... more
23.15 $readmemb与$readmemh
23.16 $writememb and $writememhSystemVerilog introduces system tasks $writememb and $writememh:
23.17 File format considerations for multi-dimensional unpacked arraysIn SystemVerilog, $readmemb, $readmemh, $writememb and $writememh can work with multi-dimensional unpacked arrays.

The file contents are organized in row-major order, with each dimension’s entries ranging from low to high address. This is backward compatible with plain Verilog memories.

In this organization, the lowest dimension (i.e. the right-most dimension in the array declaration) varies the most rapidly. There is a hierarchical sense to the file data. The higher dimensions contain words of lowerdimension data, sorted in row-major order. Each successive lower dimension is entirely enclosed as part of higher dimension words.

As an example of file format organization, here is... more

23.18 System task arguments for multi-dimensional unpacked arraysThe $readmemb, $readmemh, $writememb, and $writememh signatures are shown below:

链接

主题

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

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

发布评论

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