gpt4 book ai didi

vhdl - VHDL 中的字时间

转载 作者:行者123 更新时间:2023-12-03 21:22:35 29 4
gpt4 key购买 nike

我是 VHDL 的新手。
有一行,如下所示:

constant TIME_DELTA : time := 100 ns;

这是什么字 time在行吗?是不是和 integer一样的数据类型?当我在互联网上搜索 VHDL 帮助时,很多人都在使用它,但没有人讨论任何关于它的事情。我也搜索过书籍,但没有用。
有人能解释一下这个关键字是如何 time的吗?用来?

最佳答案

时间是预定义的物理类型

IEEE 标准 1076™-2008 年:

5.2.4.2 Predefined physical types

The only predefined physical type is type TIME. The range of TIME is implementation dependent, but it is guaranteed to include the range –2147483647 to +2147483647. It is defined with an ascending range. All specifications of delays and pulse rejection limits shall be of type TIME. The declaration of type TIME appears in package STANDARD in Clause 16.

By default, the primary unit of type TIME (1 fs) is the resolution limit for type TIME. Any TIME value whose absolute value is smaller than this limit is truncated to zero (0) time units. An implementation may allow a given elaboration of a model (see Clause 14) to select a secondary unit of type TIME as the resolution limit. Furthermore, an implementation may restrict the precision of the representation of values of type TIME and the results of expressions of type TIME, provided that values as small as the resolution limit are representable within those restrictions. It is an error if a given unit of type TIME appears anywhere within the design hierarchy defining a model to be elaborated, and if the position number of that unit is less than that of the secondary unit selected as the resolution limit for type TIME during the elaboration of the model, unless that unit is part of a physical literal whose abstract literal is either the integer value zero or the floating-point value zero.



在模拟器方面,我将其理解为一个整数值,它表示具有主要限制分辨率(例如 1fs)的时间。
它可以在您的代码中用实数值表示,时间更长,时间刻度更大:
-- time1 and time2 are equal
signal time1 : time := 1000.125 ms;
signal time2 : time := 1000125 us;

关于vhdl - VHDL 中的字时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52091706/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com