赛灵思
直播中

李代三

7年用户 174经验值
私信 关注
[问答]

应该抓两种方法并使用DCM作为25MHz信号吗?

我有一个由50MHz晶体驱动的电路,我通过DCM加倍。
在100MHz之外,我需要一些其他时钟来驱动较慢的电路部分。
其中一个是用于VGA同步的25MHz时钟。
最初我有一个分频器电路,它产生25MHz“时钟”信号,周期为50/50。
我就像主时钟那样使用那个信号:
如果rising_edge(clk50mhz)那么
一切都工作正常,但我正在阅读一些其他代码,其中使用“启用”信号。
因此,25MHz使能信号仅在每4个时钟的1个主时钟周期有效,我会像这样使用它:
如果rising_edge(clk)那么
如果en50mhz ='1'则
在更改了我的所有代码之后,现在综合报告我的电路将以70MHz的频率运行,而之前的频率为104MHz,而我的VGA输出现在搞砸了。
在我尝试制作VHDL工作的“启用”版本之前,我想知道哪种更好的做法?
或者,我应该抓两种方法并使用DCM作为25MHz信号吗?
那么,我应该:
1.使用计数器从主时钟(来自单个DCM的输出)导出“时钟”信号?
2.从主时钟发出“启用”信号,这些信号仅对主时钟的单个时钟有效?
3.使用单独的DCM来获取我需要的所有信号?
谢谢,
马修

以上来自于谷歌翻译


以下为原文

I have a circuit driven by a 50MHz crystal which I'm doubling via a DCM.  Out of that 100MHz, I need a few other clocks to drive slower parts of the circuit.  One of them is a 25MHz clock for the VGA sync.

Originally I had a divider circuit that was making a 25MHz "clock" signal with a 50/50 period.  I was using that signal just like the main clock:

if rising_edge(clk50mhz) then

Everything was working fine, but I was reading some other code where an "enable" signal was used instead.  So, the 25MHz enable signal is only active for 1 main clock tick every 4 ticks, and I would use it like this:

if rising_edge(clk) then
  if en50mhz = '1' then

After changing all my code, synthesis now reports the max my circuit will run at is 70MHz vs the 104MHz I had before, and my VGA output is now messed up.

Before I try to make the "enable" version of my VHDL work, I'd like to know which is a better practice?  Or, should I scratch both methods and use a DCM for the 25MHz signal?

So, should I:

1. Derive "clock" signals from the main clock (output from the single DCM) with counters?

2. Make "enable" signals from the main clock that are only active for a single tick of the main clock?

3. Use individual DCMs for all the signals I need?

Thanks,
Matthew

回帖(6)

李振云

2019-1-14 13:27:32
1.如果这样做,则不要假设所有时钟的边缘都重合。
主时钟和分频时钟之间的偏差将根据路由而变化,因此您应将它们视为不相关的时钟,并处理跨时钟域的异步信号(太麻烦)。
我经常这样做,效果很好。
在某些部分,您可以使用BUFG进行时钟使能,以减少路由延迟。
或者,您可以对合成中的启用设置扇出限制,以强制复制并减少延迟。
3.也做到了这一点,它工作正常。
在你的情况下,你的晶体将驱动DCM,DCM的CLK0输出将是50MHz,其CLK2X输出将是100MHz,我认为有一个CLKDIV输出可以给你25MHz。
将所有这些连接到BUFG以进行全局路由,您可以安全地将它们视为重合时钟边缘。
您的部分用户指南和应用说明将包含使用DCM生成多个时钟的示例。
巴里

以上来自于谷歌翻译


以下为原文

1.  If you do this, then do not assume the edges of all the clocks are coincident.  The skew between the main clock and the divided clock will vary depending on the route, so you should treat them as unrelated clocks and handle signals that cross clock domains as asynchronous (too much trouble).
 
2. I have done this often, it works well.  In some parts you can use a BUFG for the clock enable to reduce routing delay.  Or you can put a fanout limit on the enable in synthesis to force replication and reduce delay.
 
3. Also done this, and it works fine.  In your case, your crystal would drive the DCM, the DCM's CLK0 output would be 50MHz, its CLK2X out would be 100MHz, and I think there is a CLKDIV output that would give you 25MHz.  Connect all of these to BUFGs for global routing, and you can safely treat them as coincident clock edges.
 
Your part's user guide and app notes will have examples of using DCMs to generate multiple clocks.
 
Barry
举报

李艳

2019-1-14 13:40:03
谢谢。
我试图找到一些关于如何使用BUFG来查看是否有助于时序报告的示例。
我仍然不明白如何将信号视为启用与时钟相比,从104MHz到70MHz。
马修

以上来自于谷歌翻译


以下为原文

Thanks.  I'm trying to find some example on how to use BUFG to see if that helps the timing report.  I still don't understand how I could go from 104MHz to 70MHz just by treating the signal as an enable vs. a clock.
 
Matthew
 
举报

杨玲

2019-1-14 13:47:18
基本上这些工具不够智能,无法推断多周期路径的时间。

可以使用计时组来提高性能,让工具知道您的实际情况
从您的25 MHz时钟使能启用的任何触发器开始,在100 MHz时有4个时钟周期
在同一组中的任何其他触发器。
如果不这样做,那么所有25 MHz路径都是
由于它们的时钟输入,因此需要单个100 MHz时钟周期进行评估
现在与100 MHz相关联。
您可以使用时钟使能信号来定义25 MHz时序组。
只是确定
产生使能信号的触发器本身不会无意中落在其中
时间组。
如果在循环中使用信号,则会发生这种情况。
它通常发生在

你只是使用像ck_ena 以下为原文

Basically the tools are not smart enough to infer the timing for multicycle paths.  You
can increase the performance using timing groups to let the tools know that you actually
have 4 clock cycles at 100 MHz to go from any flip-flop enabled by your 25 MHz clock enable
to any other flip-flop in that same group.  If you don't, then all of your 25 MHz paths are
evaluated as requiring a single cycle of the 100 MHz clock, since their clock input
is tied to 100 MHz now.
 
You can use the clock enable signal to define your 25 MHz timing group.  Just be sure
that the flip-flop that generates the enable signal itself doesn't inadvertently land in that
timing group.  This can happen if you use the signal in a loop.  It usually happens when
you're only dividing the clock by two using an assignment like ck_ena <= !clk_ena.
-- Gabor

李艳

2019-1-14 14:03:21
这听起来很酷,但我不知道如何制作计时组。
你说的有道理,我只是还不知道实施这个想法。
我现在所做的是使用DCM中的CLKDV而不是自己导出它。
这似乎很有效,因为我的整体时间从变化后的107MHz变为113MHz。
我仍然想知道关于时间的理由。
你手头有链接吗?
我使用的是Spartan 3E,如果这有任何区别的话。
马修

以上来自于谷歌翻译


以下为原文

That sounds cool, but I have no idea how to make a timing group.  What you say makes sense, I just don't know enough yet to implement the idea.
 
What I did do for now is to use the CLKDV from the DCM instead of deriving it myself.  This seemed to work good becaues my overall timing went from 107MHz to 113MHz after the change.
 
I'd still like to know about timing grounds though.  Do you have any links off hand?  I'm using a Spartan 3E if that makes any difference.
 
Matthew
 
举报

更多回帖

×
20
完善资料,
赚取积分