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

5.1i XST - Arrays of coefficients are not compiled correctly

Description

Keywords: XST, array, constant, coefficient

Urgency: Standard

General Description:
When I declare an array of coefficients in the architecture, XST does not compile the coefficients correctly.

For example:
****
architecture Behavioral of test is
type data_type is array (NATURAL RANGE <> ) of SIGNED (2 downto 0);
constant single_coeff : signed(2 downto 0) := CONV_SIGNED(10#3#,3);
constant array_coeff : data_type(0 to 1) := (CONV_SIGNED(10#3#,3), CONV_SIGNED(10#3#,3));

begin

P1: process(clk)
begin
if clk'event and clk='1' then
out_1 <= CONV_SIGNED(array_coeff(1),4);
out_2 <= CONV_SIGNED(single_coeff,4);
end if;
end process;

end Behavioral;
****

During simulation, the expected result on out_1 and out_2 is "0011". The actual result obtained is that out_1 is equal to "1111" and out_2 is "0011".

Solution

One way to work around this problem is to change the initial values from decimal to binary values as follows:

****
architecture Behavioral of test is
type data_type is array (NATURAL RANGE <> ) of SIGNED (2 downto 0);
constant single_coeff : signed(2 downto 0) := "011"; --changed initial values base
constant array_coeff : data_type(0 to 1) := ("011","011"); --changed initial values base

begin

P1: process(clk)
begin
if clk'event and clk='1' then
out_1 <= CONV_SIGNED(array_coeff(1),4);
out_2 <= CONV_SIGNED(single_coeff,4);
end if;
end process;

end Behavioral;
****

This problem is fixed in the latest 5.1i Service Pack, available at:
http://support.xilinx.com/support/techsup/sw_updates.
The first service pack containing the fix is 5.1i Service Pack 1.
AR# 15229
Date Created 07/22/2002
Last Updated 07/18/2007
Status Archive
Type General Article