Passing user-defined types through the port (global variables??)

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
Reply to
<dougs
Loading thread data ...

It's

would like

given

would be

once it

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
 Click to see the full signature
Reply to
Alan Fitch

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.

Reply to
Allan Herriman

cheers

Reply to
Kwaj

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.