Use clause usage with XST?

Discussion in 'VHDL' started by Andrew FPGA, Mar 23, 2006.

  1. Andrew FPGA

    Andrew FPGA Guest

    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
    Andrew FPGA, Mar 23, 2006
    #1
    1. Advertising

  2. 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
    Rolf Eike Beer, Mar 27, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan
    Replies:
    2
    Views:
    1,415
    Mike Treseler
    Dec 16, 2004
  2. crazyrdx

    use clause

    crazyrdx, Aug 30, 2005, in forum: VHDL
    Replies:
    1
    Views:
    604
  3. =?Utf-8?B?RGFiYmxlcg==?=
    Replies:
    6
    Views:
    13,345
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Apr 4, 2006
  4. feiyang
    Replies:
    1
    Views:
    1,631
    Ajeetha
    Nov 23, 2006
  5. Replies:
    3
    Views:
    435
    Mike Treseler
    Jul 20, 2007
Loading...

Share This Page