简体   繁体   English

在 Verilog 中将信号视为时钟

[英]Treat signal as a clock in Verilog

for example, here is the diagram from previous question in here which I want to ask.例如,这是我想问的上一个问题的图表。

在此处输入图像描述

If I treat an data like the diagram here, and write it into Verilog code What is the disadvantages here.如果我像这里的图一样对待一个数据,并且把它写成Verilog代码,这里有什么缺点。 thanks to answer.感谢回答。

Maybe there will be encounter some problems when we are synthesis or implementation in the tools that we use?也许我们在使用的工具中综合或者实现的时候会遇到一些问题? but actually it's works okay here when I program the code above into my FPGA.但实际上,当我将上面的代码编程到我的 FPGA 中时,它在这里工作正常。

Short Answer简答
Unreliable Sporadic Behaviour!不可靠的偶发行为!

Long Answer长答案
FPGA & ASIC designs use what is sometimes called synchronous design methodology. FPGA 和 ASIC 设计使用有时称为同步设计方法的方法。 The basic idea is that clock pins are always driven by a clock.基本思想是时钟引脚始终由时钟驱动。 This allows synthesis tools to perform an analysis called 'static timing' which gives a degree of confidence that the design will operate properly because the delays have all been analyzed to be within the designers constraints.这使得综合工具能够执行称为“静态时序”的分析,从而在一定程度上确信设计将正常运行,因为所有延迟都已被分析为在设计人员的限制范围内。

In the design shown, the delay on the Q output of the first stage will be a determining factor on the correct operation of the circuit.在所示的设计中,第一级Q output 的延迟将是电路正确运行的决定性因素。 Designers want to reduce the dependence on delay reducing the concerns to those that can be performed by static timing analysis.设计人员希望减少对延迟的依赖,从而减少对 static 时序分析可以执行的关注。

The style shown is used in older references (my college digital design textbook in the 90's had these) and is sometimes part of what is called a 'ripple counter'.显示的样式在较早的参考资料中使用(我 90 年代的大学数字设计教科书有这些)并且有时是所谓的“纹波计数器”的一部分。 This was a popular method of digital design prior to the prevalence of FPGA and ASIC.在 FPGA 和 ASIC 流行之前,这是一种流行的数字设计方法。 In those days digital circuits were done using discrete logic on a printed circuit board, and the design concerns were different.在那些日子里,数字电路是在印刷电路板上使用分立逻辑完成的,设计关注点不同。

Its a bit difficult to find information on this topic.很难找到有关此主题的信息。 This post discussis the same topic a bit but does not go deep on the main point.这篇文章讨论了一些相同的主题,但没有深入讨论要点 go 。
https://electronics.stackexchange.com/questions/115967/what-is-a-ripple-clock https://electronics.stackexchange.com/questions/115967/what-is-a-ripple-clock
One reason that its difficult to find information is that the term 'asynchronous design' has different meanings, and the more ubiquitous meaning pertains to the design of digital circuits where feedback around combinational logic is used.很难找到信息的一个原因是术语“异步设计”具有不同的含义,而更普遍的含义与使用围绕组合逻辑的反馈的数字电路设计有关。 The logic settles or 'latches' into a stable state. This is different than the discussion whose main idea is 'always drive clock pins with a clock'逻辑稳定或“锁存”到稳定的 state。这不同于主要思想是“始终用时钟驱动时钟引脚”的讨论

Another bad practice that was part of asynchronous design was to use the asynchronous reset pin of a flip-flop as control logic.异步设计的另一个不良做法是使用触发器的异步复位引脚作为控制逻辑。 In synchronous design the asynchronous reset pin is often not used, and when it is used, its asserted asynchronously, de-asserted synchronously and used mostly for global power on resets.在同步设计中,异步复位引脚通常不被使用,当它被使用时,它异步置位、同步置低并且主要用于全局上电复位。 This is a reply to a similar issue discussed on the Xilinx question & answer forum.这是对 Xilinx 问答论坛上讨论的类似问题的回复。 https://support.xilinx.com/s/question/0D52E0000757EsGSAU/that-dangerous-asynchronous-reset?language=en_US https://support.xilinx.com/s/question/0D52E0000757EsGSAU/that-dangerous-asynchronous-reset?language=en_US
The author (Xilinx engineer Ken Chapman) used the phrase 'Unreliable Sporadic Behavior' in the answer.作者(Xilinx 工程师 Ken Chapman)在回答中使用了短语“不可靠的零星行为”。

Another (good) synchronous design practice is to use very low skew clock resources to distribute the clock, so that the clock effectively is changing at the same time everywhere in the physical part.另一个(好的)同步设计实践是使用非常低偏移的时钟资源来分配时钟,这样时钟就可以有效地同时在物理部分的任何地方发生变化。

Use synchronous design techniques & static timing as part of verification and to save debug effort for more important issues.使用同步设计技术和 static 时序作为验证的一部分,并为更重要的问题节省调试工作。

The term 'synchronous design' has kind of been forgotten since the 90's and is not widely used, its just the way designs are done. “同步设计”这个词自 90 年代以来就被遗忘了并且没有被广泛使用,它只是设计的方式。 Google searching 'static timing' would be helpful to understand these concepts.谷歌搜索“静态计时”将有助于理解这些概念。 A complete answer to 'what is static timing analysis' is beyond the scope of this question. “什么是 static 时序分析”的完整答案超出了这个问题的 scope。

Do the following as a basis for synchronous design:执行以下操作作为同步设计的基础:

  • Drive clock pins with a clock用时钟驱动时钟引脚
  • Use a clock buffer or clock tree to distribute the clock使用时钟缓冲区或时钟树来分配时钟
  • Have a corresponding reset for each clock每个时钟都有相应的复位
  • Don't use asynchronous reset pins as control不要使用异步复位引脚作为控制
  • Learn how to cross clock domains了解如何跨时钟域
  • Specify a timing constraint for each clock为每个时钟指定时序约束
  • Perform static timing analysis, understand the results进行static时序分析,了解结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM