FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-12-2003, 05:41 PM
Max
Guest
 
Posts: n/a
Default where to define a type?

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
Reply With Quote
  #2 (permalink)  
Old 09-12-2003, 06:31 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: where to define a type?

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

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use define in a string? [email protected] Verilog 4 06-26-2008 05:06 PM
FPGA :'define not allowed in ISE ? bijoy FPGA 1 08-16-2007 07:07 PM
How to define reg ports? Chris Carlen Verilog 9 03-01-2004 08:17 PM
`define within a for loop ric Verilog 0 02-02-2004 08:14 AM
define vs parameter a2zasics Verilog 3 09-26-2003 05:58 AM


All times are GMT +1. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved