完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好
在for循环中写入的语句是顺序执行的。 谢谢& 问候 Madhur 以上来自于谷歌翻译 以下为原文 Hi The statements written inside a for loop are executed concurrently of sequentially. Thanks & regards Madhur |
|
相关推荐
3个回答
|
|
|
|
|
|
嗨,
答案不止一个方面。 在模拟器中,循环内的语句按顺序执行,就像进程内的每个语句一样。 (请注意,您还有for..generate“循环”,用于实例化并发代码段或模块。) 但是当涉及到合成时,这种“seqential执行”已经没有任何有用的意义了。 循环将展开为多个同时执行的逻辑函数。 这可以提供与for..generate的使用类似的结果,但通常更方便。 或者循环内部的计算会折叠成一些非常简单的硬件。 当您编写功能代码而不了解综合结果时,就会发生这种情况。 但是,循环可以帮助您使代码可伸缩和可重用,因为循环边距可以由泛型定义。 有一个很好的综合 Eilert 以上来自于谷歌翻译 以下为原文 Hi, the answer has more than one aspect. In a simulator the statements inside a loop are executed sequentially, as every statement inside a process. (Be aware that you also have for..generate "loops" that instantiate concurrent code segments or modules.) But when it comes to synthesis this "seqential execution" has no useful meaning anymore. The loop will either be unrolled into a number of logic functions that act concurrently. This can give a similar result as the usage of for..generate but is often more convenient. Or the calculation inside the loop collapses to some very simple hardware. This can happen when you write functional code whithout having an idea about the synthesis results. However, loops can help you to make code scalable and reusable, since the loop margins can be defined by generics. Have a nice synthesis Eilert |
|
|
|
关于综合/模拟的一些观点:
如果代码是可综合的,那么虽然循环将在模拟中“按顺序执行”,但在执行期间模拟时间不会提前(除了下面的最后一点),因此实际上它在时间线或波形视图上同时发生 。 如果循环内有任何事件等待,它将无法合成,在这种情况下,模拟将显示时间线或波形视图中的顺序执行。 如果循环中存在基于时间的等待(不是事件等待),它们将被合成忽略,并且循环仍将合成,但现在模拟和合成之间将存在不匹配,因为合成将同时执行循环,而 模拟将在每次循环迭代中插入基于时间的延迟。 - Gabor 以上来自于谷歌翻译 以下为原文 Some points about synthesis/simulation: If the code is synthesizable, then although the loop will "execute sequentially" in simulation, the simulation time will not advance during this execution (except see last point below), so in effect it happens concurrently as viewed on a time line or waveform view. If there are any event waits inside the loop, it will not be synthesizable, and in this case the simulation will show sequential execution in a time line or waveform view. If there are time-based waits inside the loop (not event waits) they will be ignored by synthesis and the loop will still synthesize, but now there will be a mismatch between simulation and synthesis as the synthesis will execute the loop concurrently, while the simulation will insert the time-based delays in each loop iteration. -- Gabor |
|
|
|
只有小组成员才能发言,加入小组>>
2384 浏览 7 评论
2800 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2264 浏览 9 评论
3336 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2431 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
757浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
547浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
369浏览 1评论
1965浏览 0评论
684浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 19:24 , Processed in 1.387802 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号