where to define a type?

M

Max

Guest
I need to define a type, and I need to use it in port defenition of my
entity.

for example:

entity my_entity is
Port ( A: inout my_type);

I have write a package to define my_type.

The problem is that ModelSim 5.6 starter don't support pakages other
then standard (ieee).

Can I define my_type outside of package? I tried to put the definition
at the beginnig of file and also in the entity definition, but it
doesn't compile.

thanks
 
Max wrote:
I need to define a type, and I need to use it in port defenition of my
entity.

for example:

entity my_entity is
Port ( A: inout my_type);

I have write a package to define my_type.
That's correct, or if it's just a vector length
use a generic:

entity my_entity is
generic (cnt_len : natural := 32);
Port ( A: inout my_cnt(cnd_len-1 downto 0) );


The problem is that ModelSim 5.6 starter don't support pakages other
then standard (ieee).
I expect that it does.
Be sure to compile the package and put a:

use work.my_package.all;

before the entity.


Can I define my_type outside of package? I tried to put the definition
at the beginnig of file and also in the entity definition, but it
doesn't compile.
No, a generic can instance a type, but cannot define one.

Consider keeping port types standard and define
your custom types in the architecture or in a process.

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top