Use package with selected function

This is a discussion on Use package with selected function within the vhdl forums in Programming Languages category; Hi everyone, Here is the syntaxe you usually use to include packages: use ieee.std_logic_arith.all Now, if I only want the + function included, I know that you can use use ieee.std_logic_arith."+" Is it possible to include a whole package without one particular function like : use ieee.std_logic_arith."all \+" to get the whole arith but without plus? thanks a lot. Florent...

Go Back   Application Development Forum > Programming Languages > vhdl

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-12-2008, 03:09 AM
Flo
Guest
 
Default Use package with selected function

Hi everyone,

Here is the syntaxe you usually use to include packages:
use ieee.std_logic_arith.all

Now, if I only want the + function included, I know that you can
use
use ieee.std_logic_arith."+"

Is it possible to include a whole package without one particular
function like :
use ieee.std_logic_arith."all \+" to get the whole arith
but without plus?

thanks a lot.

Florent
Reply With Quote
  #2  
Old 08-12-2008, 04:18 AM
Tricky
Guest
 
Default Re: Use package with selected function

Hi Flo

First off, change over from using std_logic_arith (and I also assume
you have std_logic_unsigned somewhere) and use numeric_std instead. It
is an actual standard, which is defined by the IEEE. The
std_logic_arith library is vendor defined and varies from vendor to
vendor, so makes your code less portable. There was a link somewhere
to a document that showed the differences between two vendors
definitions of std_logic_arith, and difference was quite significant
right down to one vendors functions having completly different names,
but I cant find it atm.

Secondly, why would you want to ignore a single function? are you
trying to overload it? This I think you can do simply by defining a
new version in a more local scope, eg the architecture body.
Otherwise, just create a function with a different name.

Flo wrote:

> Hi everyone,
>
> Here is the syntaxe you usually use to include packages:
> use ieee.std_logic_arith.all
>
> Now, if I only want the + function included, I know that you can
> use
> use ieee.std_logic_arith."+"
>
> Is it possible to include a whole package without one particular
> function like :
> use ieee.std_logic_arith."all \+" to get the whole arith
> but without plus?
>
> thanks a lot.
>
> Florent

Reply With Quote
  #3  
Old 08-12-2008, 07:22 AM
Flo
Guest
 
Default Re: Use package with selected function

Hi,
thanks for the tips about numeric.

Regarding the use, it's not for ieee package especially (maybe for
personnal packages).I have no particular use for that (but might get
soon if it's possible to do so) I was just wondering if it was
possible...

florent

On 12 août, 04:18, Tricky <Trickyh...@gmail.com> wrote:
> Hi Flo
>
> First off, change over from using std_logic_arith (and I also assume
> you have std_logic_unsigned somewhere) and use numeric_std instead. It
> is an actual standard, which is defined by the IEEE. The
> std_logic_arith library is vendor defined and varies from vendor to
> vendor, so makes your code less portable. There was a link somewhere
> to a document that showed the differences between two vendors
> definitions of std_logic_arith, and difference was quite significant
> right down to one vendors functions having completly different names,
> but I cant find it atm.
>
> Secondly, why would you want to ignore a single function? are you
> trying to overload it? This I think you can do simply by defining a
> new version in a more local scope, eg the architecture body.
> Otherwise, just create a function with a different name.
>
> Flo wrote:
> > Hi everyone,

>
> > Here is the syntaxe you usually use to include packages:
> > use ieee.std_logic_arith.all

>
> > Now, if I only want the + function included, I know that you can
> > use
> > use ieee.std_logic_arith."+"

>
> > Is it possible to include a whole package without one particular
> > function like :
> > use ieee.std_logic_arith."all \+" to get the whole arith
> > but without plus?

>
> > thanks a lot.

>
> > Florent


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 01:29 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.