完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在设计一个HDLC接收器接口。
该接口看起来非常类似于SPI从器件,除了没有外部芯片选择进入。帧同步发生在数据中使用唯一的令牌。 因此有2个信号进入FPGA: EXT_CLK:在我的情况下几兆 DIN:与EXT_CLK同步的数据 在同步和反序列化之后,数据被写入FIFO,供处理器使用。 我目前看到了2种设计策略,我希望您就他们之间的选择提出意见/建议/反馈,如果有更好的策略,我甚至会选择第3种策略。 随意评论一些或所有问题。 策略1:CDC使用异步FIFO 基本上整个串行接收系统(FSM +串行移位寄存器)在“外部时钟域”中实现。 双域FIFO负责时钟域交叉。 Q1:在我的应用程序中,EXT_CLK可以以不规则的方式断开连接/重新连接,EXT_CLK输入上有临时的“故障”→这可能会在使用此策略时将FSM置于未知状态? 策略2:CDC上的输入CLK和数据 在此策略中,传入的EXT_CLK和EXT_DIN被视为异步输入。 它们使用“CDC单”与时钟域交叉到内部FPGA时钟域(FPGA_CLK)。 时钟的CDC之后是边沿检测器,它在上升沿产生单个标记(宽度= 1 FPGA_CLK周期)。 一旦在CDC之后,FSM,移位寄存器和FIFO的两端都在同一时钟域上工作。 Q2:FPGA时钟应该比EXT_CLK_IN(因子)高一个因子才能工作,是否有一些'规则'表明它至少应该是4x,8x,......? 问题3:作为对此的直接结论,策略1可能以比策略2更高的EXT_CLK频率运行? 这就是网上大多数设计使用策略1的原因吗? 问题4:如果我在网上浏览并查看SPI从设备实现(找不到很多HDLC实现,并且SPI从设备接近这一点),我大多看到实现的第一个策略。 然而,这种将CDC单一放在输入信号上的策略对我来说似乎更加严格,特别是当EXT_CLK可以随机断开/重新连接时。 或者我在这里遗漏了什么? 问题5:我认为策略2的另一个优点是FSM可以在单个EXT_CLK周期内转换多个状态,因此在FSM实现中具有更多“灵活性”。 问题6:看起来策略2可能比策略1使用更高的功率,这是正确的吗? **如果答案是有帮助的话,那就是kudo。 如果您的问题得到解答,请接受解决方案 以上来自于谷歌翻译 以下为原文 I'm designing a HDLC receiver interface. This interface looks very similar to an SPI slave, except that there's no external chip select coming in. Frame synchronisation happens using unique tokens in the data. So there are 2 signals coming into the FPGA :
I currently see 2 design strategies, and I'd like your opinion / advice / feedback on choosing between them, or even a 3rd strategy if there would be a better one. Feel free to comment to some or all questions. strategy 1 : CDC using async FIFO basically the entire serial receive system (FSM + serial shift reg) is implemented in the 'external clock domain'. A dual domain FIFO takes care of the clock domain crossing. Q1 : in my application, EXT_CLK can be disconnected / reconnected in irregular fashion, with temporary 'glitches' on the EXT_CLK input → can this put the FSM into an unknown state when using this strategy? strategy 2 : CDC on the input CLK and data In this strategy, the incoming EXT_CLK and EXT_DIN are considered as asynchronous inputs. They are clock domain crossed to the internal FPGA clock domain (FPGA_CLK) using a 'CDC single'. The CDC of the clock is followed by an edge detector, which generates a single tick (width = 1 FPGA_CLK period) on a rising edge. Once after the CDC's, the FSM, shift reg and both sides of the FIFO all work on the same clock domain. Q2 : FPGA clock should be (a factor) higher than EXT_CLK_IN for this to work, is there some 'rule' that says it should be at least 4x, 8x, ... ? Q3 : as an immediate conclusion to that, strategy 1 can probably run at a higher EXT_CLK frequency than strategy 2? Is that a reason why most designs on the web use strategy 1? Q4: if I browse on the web and look at SPI slave implementations (couldn't find many HDLC implementations, and SPI slave comes close to this), I mostly see the first strategy implemented. However, this strategy of putting the CDC single on the input signals seems to be more rigid to me, especially when EXT_CLK could be disconnected/reconnected randomly. Or am I missing something here? Q5 : I think another advantage of strategy 2 is that the FSM could transit multiple states during a single EXT_CLK cycle, hence having more 'flexibility' in FSM implementation. Q6 : it looks like strategy 2 might use higher power than strategy 1, is that correct? ** kudo if the answer was helpfull. Accept as solution if your question is answered ** |
|
相关推荐
3个回答
|
|
谢谢@markcurry,我非常感兴趣地阅读了应用笔记。
我还发现了XAPP523,它描述了相同但7系列和Zynq(我正在使用)。 我刚刚在我的邮箱中安装了XAPP1274,这似乎更深入了解了这个主题。 虽然这一切都非常非常有趣,但我觉得这对我的“低速”HDLC界面来说有点过分。 它在64kbits ... 2 MBits的范围内。 因此,您可以将其与进入FPGA的慢速SPI主接口进行比较。 它实际上是一个类似SPI的接口,SPI时钟和SPI数据正在进入FPGA,没有芯片选择。 我需要搜索标记数据包开头和结尾的独特模式(使用FSM),而不是芯片选择。 有了这些额外的知识(我应该在开始时对此进行更好的解释),你还会建议去过采样吗? **如果答案是有帮助的话,那就是kudo。 如果您的问题得到解答,请接受解决方案 以上来自于谷歌翻译 以下为原文 Thanks @markcurry, I read the app notes with great interest. I also discovered XAPP523 which describes the same but for 7 series and Zynq (which I'm using). And I just got XAPP1274 in my mailbox, which seems to go even deeper into the subject. Though this is all very, very interesting, I have the feeling it's somewhat overkill for my 'low speed' HDLC interface. It's in the range of 64kbits ... 2 MBits. So you can compare it with a slow SPI master interface entering the FPGA. It's actually an SPI-like interface, with the SPI clock and SPI data are entering the FPGA, without the chip select. Instead of a chip select I need to search for unique patterns that mark the beginning and ending of a packet (using a FSM). With that extra knowledge (I should have explained this better in the beginning), would you still suggest to go for oversampling? ** kudo if the answer was helpfull. Accept as solution if your question is answered ** |
|
|
|
感谢@ allanherriman给你的回复,那个看起来像当时一些严肃的HDL项目:-)
实际上,HDLC通常嵌入到其他流中。 在我的情况下它略有不同,我只是得到带有时钟的HDLC流,但没有帧信息。 在某些情况下,我甚至需要自己生成时钟,或者在其他情况下,它使用曼彻斯特编码进入(不知道所有细节) 所以我想知道如何与时钟和数据信号接口,它可能是一种“常见的”FPGA技术,因为它类似于SPI接口,但没有芯片选择。 如果我查看SPI从设备的开源代码(在我的情况下FPGA是从设备,它接收时钟),大多数只是按原样使用时钟,并在fifo中执行CDC。 但在我的情况下,连接是不可靠的,所以电缆可以随时连接/断开,我担心我的FSM可能会疯狂,并陷入未定义状态(冷FSM)。 **如果答案是有帮助的话,那就是kudo。 如果您的问题得到解答,请接受解决方案 以上来自于谷歌翻译 以下为原文 thanks @allanherriman for your reply, that looks like some serious HDL project at that time :-) indeed the HDLC is often embedded into other streams. In my case it's slightly different, I just get the HDLC stream with a clock, but no framing info. In some cases, I even need to generate the clock myself, or in other cases it enters with manchester encoding (don't know all the details yet) So I was wondering how to interface with the clock and data signals, it's probably a 'common' FPGA technique, as it is similar to an SPI interface, but without the chip select. If I look at open source code for SPI slave devices (FPGA is a slave in my case, it receives the clock), most of them just use the clock 'as is', and perform the CDC in the fifo. But in my case the connection is unreliable, so the cable can get connected / disconnected at any time, and I'm worrying that my FSM might go crazy on that, and get stuck in an undefined state (cold FSM). ** kudo if the answer was helpfull. Accept as solution if your question is answered ** |
|
|
|
ronnywebers写道:
虽然这一切都非常非常有趣,但我觉得这对我的“低速”HDLC界面来说有点过分。 它在64kbits ... 2 MBits的范围内。 因此,您可以将其与进入FPGA的慢速SPI主接口进行比较。 ... 有了这些额外的知识(我应该在开始时对此进行更好的解释),你还会建议去过采样吗? 罗尼, 我不知道。 使用同步或异步(过采样)解决方案? 最后,两者之间的差异只是工程时间 - 我不认为两者之间的资源差异那么大。 我偶尔会得到那个内部唠叨“我是不是想过这个?” 但话说回来,我从未后悔设计一个强大的,可重复使用的解决方案。 而且,作为奖励,你将学习一路上的东西。 作为一名工程师的麻烦之一 - 正常工作的东西并没有引起注意。 在你脸上爆炸的东西(即不能可靠地工作) - 现在引起注意...... - 标记 以上来自于谷歌翻译 以下为原文 ronnywebers wrote:Ronny, I don't know. Use the synchronous, or asynchronous (oversampled) solution? In the end, the difference between both is only engineering time - I don't think the resource differences between the two matters all that much. I get that internal nag occasionally "am I overthinking this?" But then again, I've never regretted engineering a robust, reusable solution either. And, as bonus, you'll learn stuff along the way. One of the troubles with being an engineer - the stuff that just works doesn't get noticed. The stuff that blows up in your face (i.e. doesn't work reliably) - now that gets attention... --Mark |
|
|
|
只有小组成员才能发言,加入小组>>
2379 浏览 7 评论
2794 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2261 浏览 9 评论
3335 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2427 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
755浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
543浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
364浏览 1评论
1960浏览 0评论
681浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 04:51 , Processed in 1.355921 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号