Multidimentional arrays of std_logic

W

willem

Guest
I have declared in a package:

type Silly_In is array (natural range <>) of std_logic_vector;

I want to use generics in a entity to define the ranges:

entity test_Gates is
generic
( InBits : integer := 3
);
port
( clk : in std_logic;
Din : in Silly_In(2**Inbits-1 downto 0)(Inbits-1 downto 0); --??????
Q : out std_logic_vector(2**Inbits-1 downto 0)
);
end test_Gates;

The Din line gives errors. How do I code it correctly so that Din is a
array (255 downto 0) of std_logic_vector(2 downto 0) ? or I will want to
try for different InBits sizes.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 
Small mistake:

How do I code it correctly so that Din is a array (255 downto 0) of
std_logic_vector(2 downto 0) ?
Should be:

How do I code it correctly so that Din is a
array (7 downto 0) of std_logic_vector(2 downto 0) ?

On Tue, 15 Feb 2005 15:17:33 +0200, willem <willy@asic.co.za> wrote:

I have declared in a package:

type Silly_In is array (natural range <>) of std_logic_vector;

I want to use generics in a entity to define the ranges:

entity test_Gates is
generic
( InBits : integer := 3
);
port
( clk : in std_logic;
Din : in Silly_In(2**Inbits-1 downto 0)(Inbits-1 downto 0);
--??????
Q : out std_logic_vector(2**Inbits-1 downto 0)
);
end test_Gates;

The Din line gives errors. How do I code it correctly so that Din is a
array (255 downto 0) of std_logic_vector(2 downto 0) ? or I will want to
try for different InBits sizes.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 
Willem,

I'd declare the type in the pacakge as:

constant Inbits: constant:=3;
type Silly_In is array (2**Inbits-1 downto 0) of
std_logic_vector(Inbits-1 downto 0); --

and use the Silly_In type in the entity for both Din and Q.

regards,

cristian



willem wrote:
Small mistake:

How do I code it correctly so that Din is a array (255 downto 0) of

std_logic_vector(2 downto 0) ?

Should be:

How do I code it correctly so that Din is a
array (7 downto 0) of std_logic_vector(2 downto 0) ?

On Tue, 15 Feb 2005 15:17:33 +0200, willem <willy@asic.co.za> wrote:

I have declared in a package:

type Silly_In is array (natural range <>) of std_logic_vector;

I want to use generics in a entity to define the ranges:

entity test_Gates is
generic
( InBits : integer := 3
);
port
( clk : in std_logic;
Din : in Silly_In(2**Inbits-1 downto 0)(Inbits-1 downto 0);
--??????
Q : out std_logic_vector(2**Inbits-1 downto 0)
);
end test_Gates;

The Din line gives errors. How do I code it correctly so that Din
is a
array (255 downto 0) of std_logic_vector(2 downto 0) ? or I will
want to
try for different InBits sizes.





--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 

Welcome to EDABoard.com

Sponsor

Back
Top