Use clause usage with XST?

A

Andrew FPGA

Hi,
When I heavily make use of a package in a particular source file, I use
the following syntax:

library work;
use work.PkgMisc.all;

....and then happily use anything declared in the package.

But recently I had a situation where I only wanted to use a few things
from a package. According to the "The designers guide to VHDL,
Ashenden", I can do the following:

library work;
use work.PkgMisc; -- no all suffix

then when I come to use specific items from the package:

variable MyVbl : PkgMisc.MyVbl_type;

I like the idea of this syntax when I'm not heavily using the package,
it makes it immediately obvious to the reader where the defintion of
MyVbl_type is located. However, XST gives me this error when I try to
use something from the package:

ERROR:HDLParsers:1217 - "C:/project/.../Src/PcmRxInterface.vhd" Line
167. Symbol PkgMisc can't be used as a prefix in a selected name.

Is there an error in my syntax I'm missing? Does XST support this usage
of the USE clause? Has anyone sucessfully done this before?

Regards
Andrew
 
R

Rolf Eike Beer

Von Andrew FPGA:
When I heavily make use of a package in a particular source file, I use
the following syntax:

library work;
use work.PkgMisc.all;

...and then happily use anything declared in the package.

But recently I had a situation where I only wanted to use a few things
from a package. According to the "The designers guide to VHDL,
Ashenden", I can do the following:

library work;
use work.PkgMisc; -- no all suffix

then when I come to use specific items from the package:

variable MyVbl : PkgMisc.MyVbl_type;

I like the idea of this syntax when I'm not heavily using the package,
it makes it immediately obvious to the reader where the defintion of
MyVbl_type is located. However, XST gives me this error when I try to
use something from the package:

ERROR:HDLParsers:1217 - "C:/project/.../Src/PcmRxInterface.vhd" Line
167. Symbol PkgMisc can't be used as a prefix in a selected name.

Is there an error in my syntax I'm missing? Does XST support this usage
of the USE clause? Has anyone sucessfully done this before?

use work.PkgMisc.MyVbl_type;
....
variable MyVbl: MyVbl_type;

HTH

Eike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top