VHDL for: generate vs loop

Status
Not open for further replies.

robmar

Newbie level 3
Joined
Apr 2, 2016
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
29
Hello, I'm a beginner at VHDL. I couldn't find an answer to this online:
What is the difference between using the for generate and for loop when performing signal assignments?

EX:
Code:
for i in 0 to 7 generate
   a(i) <= b(i);
end generate;

for i in 0 to 7 loop
   a(i) <= b(i);
end loop;

Thank you!
 

The loop statement has to be used in a process. If it's a combinatorial process and the assignment is executed unconditionally it works like the generate statement, just copying the signal. If it's used under an edge sensitive condition like if rising_edge(clk), the assignment generates registers.
 

Thank you for your prompt response.
The generated registers you mentioned in case of an edge condition are generated automatically by the synthesizer, correct?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…