0
\$\begingroup\$

I know that in VHDl, there is a multitude of library, I have come to the conclusion that the only 2 library that should always be used are:

library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;

Sometimes, I believe, we could also need some other library, for math or string purpose:

use IEEE.MATH_REAL.all;
use IEEE.MATH_COMPLEX.all; 
use IEEE.STD_LOGIC_TEXTIO.all;

And that we should avoid the “false” library made by Synopsis in the early days of VHDL:

use IEEE.STD_LOGIC_ARITH.all; 
use IEEE.STD_LOGIC_SIGNED.all; 
use IEEE.STD_LOGIC_UNSIGNED.all;

https://stackoverflow.com/questions/45704135/when-to-use-vhdl-library-std-logic-unsigned-and-numeric-std

But, I have recently learned that other (official ?) IEEE library exist like:

use IEEE.NUMERIC_BIT.all; 
Use IEEE.NUMERIC_STD_UNSIGNED.all; --seems to be VHDL 2008 only

Are those last two libraries useful? Should we use them?

\$\endgroup\$
  • 2
    \$\begingroup\$ The argument for not using ieee.std_logic_arith/_signed/_unsigned has been around since before I started in VHDL, with engineers claiming these libraries could be withdrawn at any time. They haven't, they won't and they're fine to use. (However, this subject seems to attract heavy opinions from many, many reasonable and many not so.) In any event, to use any libraries properly please understand clearly how VHDL handles datatypes and overloading. Then you can write clear and simple VHDL, avoiding the cast-laden monstrosities I've often been paid to hoover away by lots of different clients :-) \$\endgroup\$ – TonyM Sep 13 '19 at 11:08
  • \$\begingroup\$ Your question is asking for an opinion, which is considered off-topic for this site. Perhaps you could narrow your question down to a specific application or use for the libraries in question. \$\endgroup\$ – Elliot Alderson Sep 13 '19 at 14:01
  • \$\begingroup\$ Hum... Hard to do, I just wanted some experienced people to say which library to use and why. I do not have any specific application, it is just for code improvement. \$\endgroup\$ – air78 Sep 13 '19 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.