Go Back   Velocity Reviews > General Computer Discussion > Hardware
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 11-01-2007, 03:44 PM   #1
Default ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL


Hi,

I'm facing some dificulties when declaring an entity whit an array of std_logic_vector output port.

I want to develop a ping pong buffer with generic width and registers size.

I've tried three possibles "solutions" (but neither worked ) that are shown below with it's respective error messages:

possible solution 1:
Code:
LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY ppbuffer IS -- ping pong buffer GENERIC (SIZE : INTEGER := 8; -- buffer size DATA : INTEGER := 8 ); -- registers size TYPE buff IS ARRAY (0 TO SIZE-1) OF STD_LOGIC_VECTOR (DATA-1 DOWNTO 0); PORT (enable, clk : IN STD_LOGIC; input : IN STD_LOGIC_VECTOR (DATA-1 DOWNTO 0); output : OUT buff); END ppbuffer;

error for solution 1:
Code:
Error (10500): VHDL syntax error at ppbuffer.vhd(16) near text "PORT"; expecting "end", or "begin", or a declaration statement

possible solution 2:
Code:
LIBRARY ieee; USE ieee.std_logic_1164.all; PACKAGE buff IS TYPE buff IS ARRAY (0 TO SIZE-1) OF STD_LOGIC_VECTOR (DATA-1 DOWNTO 0); END buff; LIBRARY ieee; USE ieee.std_logic_1164.all; USE work.buff.all; ENTITY ppbuffer IS -- ping pong buffer GENERIC (SIZE : INTEGER := 8; -- buffer size DATA : INTEGER := 8 ); -- data size PORT (enable, clk : IN STD_LOGIC; input : IN STD_LOGIC_VECTOR (DATA-1 DOWNTO 0); output : OUT buff); END ppbuffer;

error for solution 2:
Code:
Error (10482): VHDL error at ppbuffer.vhd(5): object "SIZE" is used but not declared Error (10482): VHDL error at ppbuffer.vhd(5): object "DATA" is used but not declared

possible solution 3:
Code:
LIBRARY ieee; USE ieee.std_logic_1164.all; PACKAGE buff IS TYPE buff IS ARRAY ( NATURAL RANGE <>) OF STD_LOGIC_VECTOR ( NATURAL RANGE <>); END buff; LIBRARY ieee; USE ieee.std_logic_1164.all; USE work.buff.all; ENTITY ppbuffer IS -- ping pong buffer GENERIC (SIZE : INTEGER := 8; -- buffer size DATA : INTEGER := 8 ); -- data size PORT (enable, clk : IN STD_LOGIC; input : IN STD_LOGIC_VECTOR (DATA-1 DOWNTO 0); output : OUT buff(0 TO SIZE-1)(DATA-1 DOWNTO 0)); END ppbuffer;

error for solution 3:
Code:
Error (10294): VHDL Type Declaration error at ppbuffer.vhd(5): element type for array type cannot be unconstrained

What I need is to declare a flexible port size buffer to use in a pipeline description that uses some buffers of different size. It's just like an std_logic_vector, but with vectors of std_logic inside it. I hope it's possible to describe in VHDL.

Any help would be appreciated


freitass
freitass is offline   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
How to execute an external software from VHDL? And how to interface VHDL with JAVA? becool_nikks Software 0 03-06-2009 07:08 PM
Help!!!! Vhdl sasa General Help Related Topics 0 10-12-2008 08:01 AM
VHDL Help mahdoum Software 0 12-16-2007 06:24 PM
VHDL code jyothikiranmai Software 0 10-04-2007 07:40 AM
Vhdl help melbrowneyes Hardware 0 09-17-2007 12:52 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