Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > numeric_std_unsigned

Reply
Thread Tools

numeric_std_unsigned

 
 
Andy Peters
Guest
Posts: n/a
 
      01-31-2011
So, what's the point? People still like to use the old Synopsys
libraries and can't be bothered declaring unsigned signals?
 
Reply With Quote
 
 
 
 
rickman
Guest
Posts: n/a
 
      02-11-2011
On Feb 10, 11:19*pm, David Bishop <dbis...@vhdl.org> wrote:
> On 1/31/2011 11:16 AM, Andy Peters wrote:
>
> > So, what's the point? People still like to use the old Synopsys
> > libraries and can't be bothered declaring unsigned signals?

>
> It was done because users requested it. *So we did it. * I helped write
> it and I thought it was a bit redundant.


I've never looked at this package. Does it work like the synopsys
library where it provides unsigned arithmetic for the SLV data type?

One of the things I like about the numeric_std library is that I don't
have to type std_logic_vector anymore! I hated that and signed/
unsigned are so much easier on the fingers!

But then I'm currently using Verilog. After a brief trial run I am
finding it is pleasant to work with saving both my fingers and my
brain for the real work I need to get done. I'm not fully conversant
with the language however and may yet find some issues with it that
make me very unhappy. But for now I'm putting aside my VHDL.

Rick
 
Reply With Quote
 
 
 
 
Andy
Guest
Posts: n/a
 
      02-11-2011
On Feb 11, 10:19*am, rickman <gnu...@gmail.com> wrote:
> On Feb 10, 11:19*pm, David Bishop <dbis...@vhdl.org> wrote:
>
> > On 1/31/2011 11:16 AM, Andy Peters wrote:

>
> > > So, what's the point? People still like to use the old Synopsys
> > > libraries and can't be bothered declaring unsigned signals?

>
> > It was done because users requested it. *So we did it. * I helped write
> > it and I thought it was a bit redundant.

>
> I've never looked at this package. *Does it work like the synopsys
> library where it provides unsigned arithmetic for the SLV data type?
>
> One of the things I like about the numeric_std library is that I don't
> have to type std_logic_vector anymore! *I hated that and signed/
> unsigned are so much easier on the fingers!
>
> But then I'm currently using Verilog. *After a brief trial run I am
> finding it is pleasant to work with saving both my fingers and my
> brain for the real work I need to get done. *I'm not fully conversant
> with the language however and may yet find some issues with it that
> make me very unhappy. *But for now I'm putting aside my VHDL.
>
> Rick


Yes, afaik, it defines arithmetic operators that work on slv, and
assumes an unsigned binary interpretation of the bits.

I always create a subtype:

subtype slv is std_logic_vector;

Then I can use "slv" anywhere I would use
"std_logic_vector" (declarations, type conversions, etc.)

I'm betting that if you ever do much fixed point arithmetic, you'll be
back. But it's a good thing to know more than one HDL language.

Andy
 
Reply With Quote
 
JimLewis
Guest
Posts: n/a
 
      02-15-2011

> > > So, what's the point? People still like to use the old Synopsys
> > > libraries and can't be bothered declaring unsigned signals?

>
> > It was done because users requested it. *So we did it. * I helped write
> > it and I thought it was a bit redundant.

>
> I've never looked at this package. *Does it work like the synopsys
> library where it provides unsigned arithmetic for the SLV data type?
>
> One of the things I like about the numeric_std library is that I don't
> have to type std_logic_vector anymore! *I hated that and signed/
> unsigned are so much easier on the fingers!


I think using the types unsigned and signed everywhere instead of SLV
is a good idea. In fact, if you don't use numeric_std_unsigned and
you use std_logic_vector with a relational operator, life is bad.
OTOH, if you are careful, you never need numeric_std_unsigned for
RTL.

The one place I like numeric_std_unsigned though is in testbenches.
When an address input to a DUT is std_logic_vector and I want to
algorithmically add one to it, I find the code much more readable
if I use numeric_std_unsigned than use one of the numerous different
approaches that use type conversions. When you consider readability,
you need to consider not just people who are at your skill level, but
also the people who will take on maintaining the design.

As Andy mentioned, mentioned, what is the point, people still use the
old std_logic_arith and std_logic_unsigned. My answer to that is it
is hard to get people to transition if you don't give them the
packages they want to use when they transition - namely
numeric_std_unsigned
was missing. So hopefully we can get them to transition.

Going further, it would be nice if vendor documentation, notably
Xilinx (at least through 12.1) replacing std_logic_arith with
numeric_std.

Best,
Jim




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57