完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我使用Spartan III和ISE v13.1作为构建工具。 现在我正在研究一些模块的参数化。 以下是我遇到的一些问题: 1)看看下面的两个代码块: ... 参数NEGATE_CLOCK = 1; 输入InputClock; 电线ModuleClock; 生成 if(NEGATE_CLOCK)开始 assign ModuleClock = ~InputClock; 结束其他开始 assign ModuleClock = InputClock; 结束 endgenerate 总是@(posedge ModuleClock)开始 //这里有用的东西 结束 ... 这是另一个:smileyindifferent: ... 参数NEGATE_CLOCK = 1; 输入InputClock; 电线ModuleClock; assign ModuleClock = InputClock; 生成 if(NEGATE_CLOCK)开始 总是@(negedge ModuleClock)开始 //这里有用的东西 结束 结束其他开始 总是@(posedge ModuleClock)开始 //再次在这里有用 结束 结束 endgenerate ... 什么方式更好,为什么? 我注意到与使用相同的设计相比,使用总是导致更糟糕的时间。 2)如何实现#1dynamicaly中描述的时钟切换的任何想法(例如使用寄存器来处理时钟极性)? 3)我有与整个设计分开的模块。 它使用一些FPGA引脚作为输出,一些作为输入。 但它需要分频时钟(明显少于任何大师GCLK)。 是的,DCM是最简单的解决方案,但我已经全部使用过了。 从简单的寄存器计数器提供分频时钟来为这个模块提供时钟会不好? 4)时钟域重新同步,见下图。 实际上,SerialClock可能比MasterClock(DataBus是32位)更大(但少于2 x MasterClock)。 这是重新同步的正确方法吗? 我还没有在硬件中测试过这个...我需要做什么时间限制才能确保它正常工作? 并且2xFF足以减少毛刺,可能为偏执安全添加另一个? 问候, 阿列克谢 以上来自于谷歌翻译 以下为原文 Hi there, I'm using Spartan III and ISE v13.1 as build tool. Now I'm working on parametrization of some my modules. Here is some issues I've encountered: 1) Just look at two code chunks bellow: ...parameter NEGATE_CLOCK = 1;input InputClock;wire ModuleClock;generate if (NEGATE_CLOCK) begin assign ModuleClock = ~InputClock; end else begin assign ModuleClock = InputClock; endendgeneratealways @(posedge ModuleClock) begin // Usefull stuff hereend...And here is another one:smileyindifferent: ...parameter NEGATE_CLOCK = 1;input InputClock;wire ModuleClock;assign ModuleClock = InputClock;generate if (NEGATE_CLOCK) begin always @(negedge ModuleClock) begin // Usefull stuff here end end else begin always @(posedge ModuleClock) begin // Usefull stuff here again end endendgenerate... What way is better and why? I've noticed that using 2) Any ideas how to implement clock switching decribed in #1dynamicaly (e.g. using register to handle clock polarity)? 3) I have module which is separate from whole design. It uses some FPGA pins as output and some as input. But it needs divided clock (significantly less than any masters GCLK). Yep, DCM is simpliest solution but I've already used them all. Is supplying divided clock from simple register counter for clocking this module will be bad? 4) Clock domain resynchronization, see picture bellow. Actually, SerialClock may be greater (but less 2 x MasterClock) than MasterClock (DataBus is 32 bit). Is it right way to do resynchronization? I haven't tested this in hardware yet... What timing constraints I need to put to make sure it works right? And is 2xFF enough for reducing glitches, may be for paranoid safety add another one? Regards, Alexey |
|
相关推荐
2个回答
|
|
首先,关于时钟否定:
1)没有理由说你展示的一种方式应该比另一种更好。 两者是等价的,在两种情况下,反转都应该在负载触发器中, 不是在全球时钟网。 您可以使用几个寄存器的简单情况来检查这一点 并查看技术原理图或查看FPGA编辑器中的信号。 2)因为每个片的时钟输入多路复用器实际上执行了反转,所以 不能动态。 这些多路复用器在配置时设置。 你可以 使用DCM创建时钟和180度相移时钟,然后使用BUFGMUX 选择一个或另一个。 任何其他动态时钟反转方法都会增加很多 延迟到时钟路径。 其次,对于底部的原理图,不清楚时序参数可能需要什么, 因为我不知道断言后数据总线保持稳定的时间 ReadyFlag。 添加更多触发器不会减少毛刺,只会减少出现故障 亚稳态事件 通常两个触发器足以使亚稳态变得不再 关心。 事实上,如果MastClock足够慢,我认为你可以取消 原理图设计中显示的第一个触发器。 亚稳态影响的可能性 ReadyFlagMSync信号将取决于第二个路径中的松弛量 翻牌如数据缓冲输入所示。 问候, 的Gabor - Gabor 以上来自于谷歌翻译 以下为原文 First, regarding clock negation: 1) There is no reason that one way you showed should be any better than the other. The two are equivalent and in both cases the inversion should be in the load flip-flops, not at the global clock net. You can check this using a simple case of a few registers and looking at the technology schematic or by looking at the signals in the FPGA editor. 2) Because the clock input multiplexer at each slice actually performs the inversion, this cannot be made dynamic. These multiplexers are set at configuration time. You could use a DCM to create clock and 180 degree phase-shifted clock and then use a BUFGMUX to select one or the other. Any other approach to dynamic clock inversion will add a large delay to the clock path. Second, for your schematic at the bottom, it's not clear what you might need for timing parameters, because I don't know how much time the data bus remains stable after the assertion of ReadyFlag. Adding more flip-flops does not reduce glitching, it only reduces the occurence of metastable events. Usually two flip-flops is sufficient to make metastability no longer a concern. In fact if MastClock is slow enough, I would think that you could do away with the first flip-flop shown in the schematic design. The chance of metastability affecting the ReadyFlagMSync signal will depend on the amount of slack in the path from the second flop as shown to the data buffer inputs. Regards, Gabor -- Gabor |
|
|
|
我的答案可能与Gabor的答案相同,但我只是在一个全能的时候从小睡中醒来,所以我的大脑不能很好地解析Gabor的帖子。
写出自己的回复会更容易。 前提:否定设计的全局时钟有两种(并且只有两种)可能的效果。 输入信号的采样延迟1/2个时钟周期。 输出信号的时序延迟1/2个时钟周期。 这些效果中的任何一个(或两个)都可以通过使用(或两者)的简单(和动态)来实现 输入DDR寄存器块后跟输入信号的2:1多路复用器。 2:1 mux,然后输出DDR寄存器用于输出信号。 输入采样和输出重新计时之间发生的事情完全隐藏在外部世界之外。 时钟极性无关紧要,因此反转全局时钟没有意义。 瞧! 问题解决了。 - 鲍勃埃尔金德 签名:新手的自述文件在这里:http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369总结:1。 阅读手册或用户指南。 你读过手册了吗? 你能找到手册吗?2。 搜索论坛(并搜索网页)以寻找类似的主题。 不要在多个论坛上发布相同的问题。 不要在别人的主题上发布新主题或问题,开始新的主题!5。 学生:复制代码与学习设计不同.6“它不起作用”不是一个可以回答的问题。 提供有用的详细信息(请与网页,数据表链接).7。 您的代码中的评论不需要支付额外费用。 我没有支付论坛帖子的费用。 如果我写一篇好文章,那么我一无所获。 以上来自于谷歌翻译 以下为原文 My answer may be the same as Gabor's, but I just woke up from a nap after an all-nighter, so my brain can't function well enough to parse Gabor's post. It's easier to just write up my own response. Premise: There are two (and ONLY two) possible effects from negating a design's global clock.
Either (or both) of these effects can be achieved simply (and dynamically) with the use of either (or both) of
What happens between the input sampling and output re-clocking is completely hidden from the outside world. Clock polarity just doesn't matter, so there is no point in inverting the global clock. Voila! Problem solved. -- Bob Elkind SIGNATURE: README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369 Summary: 1. Read the manual or user guide. Have you read the manual? Can you find the manual? 2. Search the forums (and search the web) for similar topics. 3. Do not post the same question on multiple forums. 4. Do not post a new topic or question on someone else's thread, start a new thread! 5. Students: Copying code is not the same as learning to design. 6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please). 7. You are not charged extra fees for comments in your code. 8. I am not paid for forum posts. If I write a good post, then I have been good for nothing. |
|
|
|
只有小组成员才能发言,加入小组>>
2163 浏览 7 评论
2605 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2078 浏览 9 评论
3149 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2193 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
423浏览 1评论
1523浏览 1评论
在使用xc5vsx95T时JTAG扫片不成功,测量TDO无信号输出
2177浏览 0评论
508浏览 0评论
1640浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-24 10:08 , Processed in 1.378317 second(s), Total 76, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号