嗨,
答案不止一个方面。
在模拟器中,循环内的语句按顺序执行,就像进程内的每个语句一样。
(请注意,您还有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
嗨,
答案不止一个方面。
在模拟器中,循环内的语句按顺序执行,就像进程内的每个语句一样。
(请注意,您还有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
举报