Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - ERROR: Selector is an unconstrained array

 
Thread Tools Search this Thread
Old 03-08-2009, 08:18 PM   #1
Default ERROR: Selector is an unconstrained array


ERROR MESSAGE :
"Selector (Signal 'addr' of type std_logic_vector) is an unconstrained
array."

Architecture body, declarative part (before begin) can use entity
generics but statement part can't ?

I'm I right? Little explanation on this please.



entity rom1 is
generic (
ADDR_WIDTH : integer :=4;
DATA_WIDTH : integer :=8
);
port (
addr : in std_logic_vector (ADDR_WIDTH-1 downto 0);
dout : out std_logic_vector (DATA_WIDTH-1 downto 0)
);
end rom1;

architecture beh of rom1 is
begin
with addr select
dout <= "11001101" when "0000",
"01011100" when "0001",
"01010101" when "0010",
"00000000" when "0011",
...............
...............


Mad I.D.
  Reply With Quote
Old 03-08-2009, 10:19 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: ERROR: Selector is an unconstrained array
Mad I.D. wrote:
> ERROR MESSAGE :
> "Selector (Signal 'addr' of type std_logic_vector) is an unconstrained
> array."
>
> Architecture body, declarative part (before begin) can use entity
> generics but statement part can't ?



I would code a constant array as Jonathan did.
http://mysite.verizon.net/miketreseler/sync_rom.vhd
Generic dimensions are ok for arrays, but not for case selections.
The only way to make an asynchronous one-liner,
is to use fixed widths as shown below.

-- Mike Treseler
__________________
library ieee;
use ieee.std_logic_1164.all;
entity rom1 is
port (
dout : out std_logic_vector(7 downto 0);
addr : in std_logic_vector(3 downto 0));
end entity case_vs_if;

architecture sim of rom1 is
begin
with addr select
dout <=
"11001101" when "0000",
"01011100" when "0001",
"01010101" when "0010",
"00000000" when "0011",
"00000000" when others;
end architecture sim;


Mike Treseler
  Reply With Quote
Old 03-09-2009, 05:34 PM   #3
Mad I.D.
 
Posts: n/a
Default Re: ERROR: Selector is an unconstrained array
Thanks all !


Mad I.D.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL and EDK: Custom IP core containing an array as a port using EDK allsey_1987 Hardware 0 10-27-2009 02:26 PM
constants as of array of integers, for loops octavsly Hardware 0 04-25-2009 11:53 AM
How to retrieve array parameter ( JAVA ) naruponk Software 1 04-16-2009 10:20 AM
Array Programme rits Software 2 03-04-2009 05:18 PM
need help Invalid length for a Base-64 char array rrwestva Hardware 0 07-04-2006 09:36 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46