Passing user-defined types through the port (global variable

Guest
I have had to define a data type to deal with logarithmic values. It's
basically a real number ranging from -10000 to 10000. However, I would like
to use this user-defined data type in the entity of the device, i.e. given
the user-defined type is called llrValue, the architecture port would be

ENTITY sova_decoder IS
PORT (
Approiri : IN llrValue
)

Where do I define the data type such that it would be recognised once it
appears in the entity? Or is there some other way to do this?

cheers



--
- Kwaj
http://alpha400.ee.unsw.edu.au/~p3015094
 
<dougs@dougs.com> wrote in message
news:bvpvpp$slu$1@tomahawk.unsw.edu.au...
I have had to define a data type to deal with logarithmic values.
It's
basically a real number ranging from -10000 to 10000. However, I
would like
to use this user-defined data type in the entity of the device, i.e.
given
the user-defined type is called llrValue, the architecture port
would be

ENTITY sova_decoder IS
PORT (
Approiri : IN llrValue
)

Where do I define the data type such that it would be recognised
once it
appears in the entity? Or is there some other way to do this?
You need to use a package, e.g.

package types is

subtype llrvalue is real range -10000.0 to 10000.0;

end;

Then if you compile it into the same library you are using for your
entity, it will appear in the current working library, so you can
say

use WORK.types.all;
entity sova_decoder is ...


regards

Alan

--
Alan Fitch
Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project
Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
1AW, UK
Tel: +44 (0)1425 471223 mail:
alan.fitch@doulos.com
Fax: +44 (0)1425 471573 Web:
http://www.doulos.com

The contents of this message may contain personal views which are not
the
views of Doulos Ltd., unless specifically stated.
 
On Wed, 4 Feb 2004 16:29:48 +1100, <dougs@dougs.com> wrote:

I have had to define a data type to deal with logarithmic values. It's
basically a real number ranging from -10000 to 10000. However, I would like
to use this user-defined data type in the entity of the device, i.e. given
the user-defined type is called llrValue, the architecture port would be

ENTITY sova_decoder IS
PORT (
Approiri : IN llrValue
)

Where do I define the data type such that it would be recognised once it
appears in the entity? Or is there some other way to do this?
Define the type in a package, then "use" the package before the entity
declaration.

lib mylib;
use mylib.mypkg.all;

entity sova_decoder is
port (
Approiri : IN llrValue



Regards,
Allan.
 
cheers

"Alan Fitch" <alan.fitch@doulos.com> wrote in message
news:bvqcon$aqa$1$8300dec7@news.demon.co.uk...
dougs@dougs.com> wrote in message
news:bvpvpp$slu$1@tomahawk.unsw.edu.au...
I have had to define a data type to deal with logarithmic values.
It's
basically a real number ranging from -10000 to 10000. However, I
would like
to use this user-defined data type in the entity of the device, i.e.
given
the user-defined type is called llrValue, the architecture port
would be

ENTITY sova_decoder IS
PORT (
Approiri : IN llrValue
)

Where do I define the data type such that it would be recognised
once it
appears in the entity? Or is there some other way to do this?

You need to use a package, e.g.

package types is

subtype llrvalue is real range -10000.0 to 10000.0;

end;

Then if you compile it into the same library you are using for your
entity, it will appear in the current working library, so you can
say

use WORK.types.all;
entity sova_decoder is ...


regards

Alan

--
Alan Fitch
Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project
Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
1AW, UK
Tel: +44 (0)1425 471223 mail:
alan.fitch@doulos.com
Fax: +44 (0)1425 471573 Web:
http://www.doulos.com

The contents of this message may contain personal views which are not
the
views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top