增量周期和波形

Delta Cycles and Waveforms

谁能解释增量周期如何影响 VHDL 模拟的波形?我知道这与 VHDL 如何确定优先级有关,但我不确定如何确定。

VHDL 作为硬件描述语言本质上是并行的,即同时有多个信号可以更改其值。但是所描述的硬件行为的模拟是在 CPU 上完成的,并且 CPU 按顺序执行命令,因此需要引入这种并行信号分配机制,即 Delta 周期。

每当某个信号改变它的值时, 实时停止并且信号值发生变化,并且实时仍然停止,模拟​​继续进行增量循环并更改受此变化影响的所有其他信号的值。如果任何信号受到影响,仿真将继续进行另一个增量循环,检查所有其他受影响的信号,并且只要所有受影响信号的值都变为静态,该过程就会以这种方式继续。只有这样才能继续实时模拟。

您不会在 VHDL 标准 (IEEE Std 1076-2008) 中找到相关信息,而且增量循环的作用并未得到广泛了解(此处提示您作为语言用户实际需要了解多少, 一个抽象的知识就足够了)。

增量循环先于 VHDL。您可以在 Internet 上找到可追溯到 1971 年的参考资料。VHDL 从 CONLAN BCL 时间模型中获取它的增量周期,在该模型中它们被称为步骤(请注意,我们今天看到交互式模拟器命令,请参阅 On the Origin of VHDL's Delta Delays,SUMIT GHOSH,Int. J. Engng Ed. Vol. 20, No. 4, pp. 638-645, 2004, and CONLAN Report, R. Piloty, M. Barbacci, D. Borrione, D. Dietmeyer, F. Hill, P. Skelly, Springer-Verlag 1983).

Ishiura Nagisa 的博士论文 Studies on Logic Simulation and Hardware Description Languages 中有一个简单的参考解释了这个概念,其中第 7 章描述了 NES:硬件描述语言的非确定性行为模型。

7.2.2 Modeling of a Zero Delay

In designing hardware, timing relations among events are very important. HDL's must have a framework of specification of timing relations. Thus one of the most important issues in developing a behavioral model of hardware is how to model time.

Probably one of the simplest way of modeling time is to represent a waveform by a sequence of symbols, each of which is associated with a minimum unit of the discrete time.

在 VHDL 术语中,这些符号是一种类型的值,离散时间由模拟时间的值表示。

... Then the behavior of a hardware component is represented by a sequential machine over the set of the symbols. Although this modeling realizes simple mathematical handling, it lacks the ability to express the occurrence of multiple events at the same place within a unit time. So it is very difficult to explain the behavior of the circuits that contain loops consisting of zero delay components.

仿真 VHDL 模型会在仿真时间内产生一系列波形事件。 VHDL 实际上根本不会处理具有零延迟组件的反馈循环。第 7 章的重点是描述如何使用替代 HDL 来做到这一点。

... Here, zero delay means the delay less than the unit time. It is a product of the quantitization of time. If the delay time of a component is less than the minimum unit of the time, it is specified as 0. The zero delay also comes up when we take a clock cycle as a unit time. In such a case, delay of gates is treated as zero delay because it is not measured by the unit time. The zero delay expresses before-after relationship or causality whose delay time is 0 measured by the unit time,

在 VHDL 仿真周期中,在没有提前仿真时间的情况下发生的周期是由信号分配产生的增量周期,默认增量延迟为 0。我们可以看到 Jayaram Bhasker 在 A VHDL Primer 中对增量周期的描述 (AT&T) 受到这段话的影响。 VHDL Primer 对 delta 循环的描述被广泛引用,但仍然没有启发性,导致搜索计算机科学家关于该主题的著作。

请注意,VHDL 模型通过等待语句中进程的恢复和随后的重新挂起来运行(具有敏感列表的进程有一个带有敏感列表的隐式等待语句,作为进程的最后一条语句)。未指定进程执行恢复顺序,VHDL 可以用进程运行ning 并行模拟。

为了处理这个信号,更新会被安排并且在所有进程都挂起后才会生效。如果为当前仿真时间安排了任何更新,则下一个仿真周期是增量周期,否则仿真时间提前到下一个仿真周期发生预定信号更新的时间。当没有安排更多事件时,模拟时间提前到时间'HIGH,模拟结束。

这些增量循环允许模型执行中的确定性,其中进程可以通过使用具有 历史记录 的信号并行执行。信号在进程执行期间不会改变,每个进程每次都会执行相同的操作。 VHDL 是一种形式化符号,旨在支持对其符合条件的综合子集进行形式化验证,确定性在这里很重要。

In order to deal with the zero delay, the time models of bcl (Conlan)[Pi183] and VHDL [Coe89] are designed on the basis of a sub-unit time named a step and a Δ-delay, respectively. The signal value at a unit time is the final result of the infinite repetition of the computation in a step or a Δ-delay. Since these models are invented to compute the final result at

a unit time, no attention is paid to the order of the computation within a unit time. Actually, a step or a Δ-delay is associated with simulation under the unit delay model. There are cases where the final result depends on the order of the computation. For example, in Fig. 7.2, while the circuit is impractical, there may be a hazard on D which changes the signal value on Q. By using the models of bcl and VHDL, we will never get this result. This is again because these languages are based on the deterministic computation model.

这个不是很清楚。连续增量周期内的执行顺序由当前仿真时间的信号更新决定。增量循环将以确定的顺序发生。

作者继续阐述了非确定性行为模型作为替代方案的优点,此处剩余的叙述与 VHDL 关系不大。

除了图 7.2 所示的全理论模型的非确定性。 VHDL 无法处理零延迟反馈回路。为了捕获这些情况,VHDL 仿真器实现了在仿真停止之前允许的最大增量周期数。虽然这个数字有时可以通过命令行选项设置,但 [Coe89] 参考(The VHDL Handbook 由 Vantage Analysis Systems 的 David R. Coelho 于 1989 年撰写)在作者的时代模拟器开始时的增量循环最大值为 127,反映了更简单的模型,并且必然会随着时间的推移而增加。在现代模拟器中,默认最大值通常是 5,000 或 10,000,反映了模型的复杂性。这个想法是允许足够的增量循环来克服模型的复杂性,而不让零延迟循环 运行 肆无忌惮。

在图 7.2 中,如果 A、B、C 和 D 是 VHDL 中的信号,其中反相器、缓冲器和与门表示具有一个增量延迟(零延迟模型)的信号分配,则信号 D 将没有单个增量周期脉冲(毛刺,小于可测量时间)。如果你想要一个脉冲,你需要延迟,依靠反相器和缓冲器的下降时间的不同。

当使用 0 延迟建模时,VHDL 可能需要额外的信号作为缓冲器来提供增量延迟或补偿由于逻辑路径中不同数量的信号分配而具有增量延迟的信号。另一方面,综合会忽略延迟(除了偶尔提供警告的工具)。

因此,使用信号更新的增量循环为零延迟模型提供了确定性——基于所有进程暂停后发生的信号更新的正确结果。如果没有这种确定性,您将依赖于赋值顺序,就像使用变量一样。使用信号允许您在任意边界上分解设计。可以在不考虑它们之间顺序的情况下描述进程和其他并发语句。

Precedence在标准中有特定的含义(运算符优先级),说'determinism'比较稳妥。您每次都会得到相同的答案,因为即使对于零延迟分配,信号更新也不会在流程执行期间发生。