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# 22056

8.2i XST - XST Hangs when assigning only some of the bits of a bus in an "if else" block

Description

XST Hangs when assigning only some of the bits of a bus in an "if else" block. 

 

Example Code: 

============================================================ 

process(rst_i, clk_i) 

begin 

if rst_i = '1' then 

general_error <= (others => '0'); 

elsif clk_i = '1' and clk_i'event then 

for f in 0 to 31 loop 

if hw_int_error(f) = '1' then  

general_error(0) <= '1'; 

elsif sw_int_error(f) = '1' then  

general_error(1) <= '1'; 

elsif cpc_int_error(f) = '1' then  

general_error(2) <= '1'; 

end if; 

end loop; 

end if; 

end process; 

================================================== 

 

The above code causes XST to hang.

Solution

XST hangs at times when there are constructs that can infer registers. 

 

The example code above will cause latches, as not all the bits of the bus are assigned. 

 

To work around this issue, you can assign all the bits of the bus in the "if else" block and it will work correctly. 

 

Corrected Example Code: 

============================================== 

process(rst_i, clk_i) 

begin 

if rst_i = '1' then 

general_error <= (others => '0'); 

elsif clk_i = '1' and clk_i'event then 

for f in 0 to 31 loop 

if hw_int_error(f) = '1' then  

general_error <= x"0000_0001"; 

elsif sw_int_error(f) = '1' then  

general_error <= x"0000_0002"; 

elsif cpc_int_error(f) = '1' then  

general_error <= x"0000_0004"; 

end if; 

end loop; 

end if; 

end process; 

=========================================== 

 

Xilinx is currently investigating a fix for this issue in XST. There is no fix scheduled at this time.

AR# 22056
Date Created 09/04/2007
Last Updated 05/19/2014
Status Archive
Type General Article