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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar wzab
Scholar
7,743 Views
Registered: ‎08-24-2011

Vivado 2015.4 - Generated AXI4 peripherial with Master interface causes error "[Synth 8-403] loop limit (65538) exceeded" (wrong clogb2 implementation)

I wanted to create a simple AXI4 Peripheral to be used a base for tests and further development.

I've selected "Create and package IP", then "Create a new AXI4 Peripheral" and in section "Add interfaces" I've added one slave interface and one master interface.

The peripheral worked perfectly for small number of Master Interface transactions (parameter C M00 AXI TRANSACTIONS NUM in the customization GUI).

However, later I wanted to use it to test transfer of bigger sets of data, and I increased the number of transactions to 1048576.

This resulted in the following compilation error:

 [Synth 8-403] loop limit (65538) exceeded [".../sources_1/bd/top/ipshared/user.org/wzab_ip_ms_v1_0/hdl/wzab_ip_ms_v1_0_M00_AXI.vhd":104]

[Synth 8-421] mismatched array sizes in rhs and lhs of assignment [".../sources_1/bd/top/ipshared/user.org/wzab_ip_ms_v1_0/hdl/wzab_ip_ms_v1_0_M00_AXI.vhd":123]

 

I checked the sources and found that the problem is associated with the strange implementation of the clogb2 function:

 

 

   -- function called clogb2 that returns an integer which has the
    -- value of the ceiling of the log base 2
    function clogb2 (bit_depth : integer) return integer is            
         variable depth  : integer := bit_depth;                               
         variable count  : integer := 1;                                       
     begin                                                                   
          for clogb2 in 1 to bit_depth loop  -- Works for up to 32 bit integers
          if (bit_depth <= 2) then                                           
            count := 1;                                                      
          else                                                               
            if(depth <= 1) then                                              
                count := count;                                                
              else                                                             
                depth := depth / 2;                                            
              count := count + 1;                                            
              end if;                                                          
            end if;                                                            
       end loop;                                                             
       return(count);                                                          
     end;         

   Basing on the decscription, that it should return the ceiling of the log2, I ve prepared equivalent, but much simpler implementation, which works correctly even for bigger arguments:

 

                                                       

  function clogb2 (bit_depth : integer) return integer is
    variable depth : integer := 1;
    variable count : integer := 1;
  begin
    count := 0;
    while depth < bit_depth loop        
      count := count + 1;
      depth := depth * 2;
    end loop;
    return(count);
  end;

I have successfully tested the above solution with 4MB transfers (1024*1024 32-bit transactions).

 

Regards,

Wojtek

0 Kudos