Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

"For... Loop" simulates differently then discrete assignments?

$
0
0
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:
HTML Code:

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':
HTML Code:

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;


Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>