【发布时间】:2021-10-25 14:19:49
【问题描述】:
在对动态数组执行new[SIZE] 时,我们可以在Systemverilog 中使用的SIZE 是否有限制?
【问题讨论】:
标签: arrays system-verilog dynamic-arrays
在对动态数组执行new[SIZE] 时,我们可以在Systemverilog 中使用的SIZE 是否有限制?
【问题讨论】:
标签: arrays system-verilog dynamic-arrays
LRM 第 7.4.2 节 Unpacked arrays 说
实现可能会限制数组的最大大小,但它们应允许至少 16 777 216 (224) 个元素。
但如果您尝试访问这么多元素,您可能会受到时间而非空间的限制。如果您只打算访问一小部分地址空间,则关联数组可能是大型数组的更好选择。
【讨论】:
限制很大。
IEEE Std 1800-2017,第 7.5.1 节新[] 状态
[ expression ]:
The desired size of the dynamic array. The type of this operand is longint.
It shall be an error if the value of this operand is negative.
longint 是 64 位签名的。
【讨论】: