cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
4,120 Views
Registered: ‎01-14-2017

OTHERS choice cannot be used in unconstrained array aggregate !

Hi everyone !
By wanting to synthesize my code, I had this error in this line :

 

leftright <= '0' when (w_beta and curr_depth) = (others => '0') else '1';

 

Can somwene help me :(

 

 

Tags (1)
0 Kudos
3 Replies
Highlighted
Professor
Professor
4,093 Views
Registered: ‎08-14-2007

Re: OTHERS choice cannot be used in unconstrained array aggregate !

It sounds like the synthesizer is having trouble determining the size (in bits) of:

 

(w_beta and curr_depth)

 

Can you post the declarations for these two:

 

w_beta

curr_depth

 

Also, what libraries have you included?

-- Gabor
0 Kudos
Highlighted
Observer
Observer
4,070 Views
Registered: ‎01-14-2017

Re: OTHERS choice cannot be used in unconstrained array aggregate !

Thank you for your reply,
It is solved by replacing "Othres" by "9 downto 0" 

 

But now i have another problem, i get others errors : Line 71: Expression has 32 elements ; expected 16

                                                                                    Line 47: Expression has 9 elements ; expected 16

The declarations of generic and ports are the following with the signals also :

 

generic (
MAX_DEPTH : integer := 9; -- max tree depth
HASH_LENGTH : integer := 2; -- hash length in words
BLOCK_LENGTH : integer := 32; -- block length in words
MEM_WIDTH : integer := 16); -- word width

port (
clk : in std_logic;
rstb : in std_logic; -- active low async reset
start : in std_logic; -- start bit
path_depth : in std_logic_vector(MAX_DEPTH-1 downto 0); -- one hot
w_beta : in std_logic_vector(MAX_DEPTH-1 downto 0); -- selected node;
ptr : out std_logic_vector(MEM_WIDTH-1 downto 0); -- pointer value
wr : out std_logic_vector(MEM_WIDTH-1 downto 0); -- enable ptr writre
status : out std_logic); -- finish bit

 

 

signal curr_depth, curr_depth_buf, curr_depth_bufbuf : std_logic_vector(MAX_DEPTH-1 downto 0);
signal leftright, leftright_buf, status_tmp, leaf : std_logic; -- 1 is goto branch 1
signal shift_w, shift_p, w_addr, p_addr : unsigned(MEM_WIDTH-1 downto 0);
constant root_addr : integer := 2**MAX_DEPTH;

0 Kudos
Highlighted
Observer
Observer
4,061 Views
Registered: ‎01-14-2017

Re: OTHERS choice cannot be used in unconstrained array aggregate !

I forgot to specify the two lines 

 

 

line 47 : wr <= curr_depth_bufbuf;

line 71 : shift_p <= 2*shift_p;

0 Kudos