UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 50934

14.1 - ISIM - Nested Loop Statments behaving incorrectly

Description

My code contains the following:

   ladder2: for i in 0 to 14 generate begin
  process (clk, rst) begin 
   if rst = '1' then
--     xin(i+1,3) <= "00" & x"000";
--     xin(i+1,2) <= "00" & x"000";
--     xin(i+1,1) <= "00" & x"000";
--     xin(i+1,0) <= "00" & x"000";
    LADD:
    for j in 0 to 3 loop
     xin(i+1,j) <= "00" & x"000";
    end loop;
    

 

The commented out lines work, however the loop below them executes but does not behave as expected.

Solution

The issue is due to loops and generate statements having different behaviors.

 

Below is an alternative method to achieve this behavior:

 

ladder2: for i in 0 to 14 generate begin
  gen1:  for j in 0 to 3 generate begin
     process (clk, rst) begin           
        if rst = '1' then
             xin(i+1,j) <= "00" & x"000";
        elsif rising_edge(clk) then
             xin(i+1,?) <= xin(i,j);
        end if;
     end process;   
  end generate;
end generate;

AR# 50934
Date Created 07/20/2012
Last Updated 12/16/2014
Status Active
Type General Article
Devices
  • Virtex-6 SXT
Tools
  • ISE Design Suite - 14