Altera_Forum
Honored Contributor
8 years ago"For... Loop" simulates differently then discrete assignments?
Can someone help me understand why the first code snippet works as I would expect it, but the second snippet simulation holds all values at 'U'?
Note: WRITE_ENABLE_FIBRE_REG(0) is assigned in a different process; Works fine:process (CLK, RESET_N) is
begin
if CLK'event and CLK = '1' then -- rising clock edge
WRITE_ENABLE_FIBRE_REG(1) <= WRITE_ENABLE_FIBRE_REG(0);
WRITE_ENABLE_FIBRE_REG(2) <= WRITE_ENABLE_FIBRE_REG(1);
end if;
end process; Nothing but 'U': process (CLK, RESET_N) is
begin
if CLK'event and CLK = '1' then -- rising clock edge
for i in 1 to 2 loop
WRITE_ENABLE_FIBRE_REG(i) <= WRITE_ENABLE_FIBRE_REG(i - 1);
end loop; -- i
end if;
end process;