Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

The library usage in Quartus

In menu of setting, there is a category "Libraries". I have never use any other libraries so this category is always empty.

I just wonder what is the library used for? When I programmed VHDL, we always need to put

LIBRARY IEEE ;

USE IEEE.STD_LOGIC_1164.ALL;

But in Verilog, we don't need it.

Is the library can be put into category "Libraries" similar as the library IEEE? And how to use library in Verilog?

Thanks.

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This is just a VHDL library to declare the std_ulogic, std_ulogic_vector (and std_logic etc) types. Because of the VHDL typing rules you cannot do alot without them for synthesisable logic.

    The libraries tab in quartus are for user libraries. it also dictates the search path for any .inc files (if for some reason you're using AHDL).

    So there is no way to use std_logic_1164 in verilog because it doesnt exist. it is a VHDL only thing because of the way the language works.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    This is just a VHDL library to declare the std_ulogic, std_ulogic_vector (and std_logic etc) types. Because of the VHDL typing rules you cannot do alot without them for synthesisable logic.

    The libraries tab in quartus are for user libraries. it also dictates the search path for any .inc files (if for some reason you're using AHDL).

    So there is no way to use std_logic_1164 in verilog because it doesnt exist. it is a VHDL only thing because of the way the language works.

    --- Quote End ---

    Thanks very much. Yes, Verilog does not need VHDL library. But user libraries can be used for both in VHDL and Verilog, right?

    Another question I have is: what kind of files is inside user libraries? Customized IP?

    Thanks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    VHDL modules and packages.

    It's a nice way to organize stuff, when you're writing re-usable stuff.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    VHDL modules and packages.

    It's a nice way to organize stuff, when you're writing re-usable stuff.

    --- Quote End ---

    Thanks, so that means even user libraries are only for VHDL? I am a little confused by this.

    Thanks again.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What are you trying to do?

    All the libraries in Quartus really lets you do is add a search path. I dont really use it, even for reusable stuff.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    What are you trying to do?

    All the libraries in Quartus really lets you do is add a search path. I dont really use it, even for reusable stuff.

    --- Quote End ---

    Hi, I just want to understand what is usage of libraries. I have never use them. I just wonder whether libraries will like libraries in software programming language (such as C++), there are designed modules inside them (definitely no class since there is no class definition in HDL).

    As you mentioned, "All the libraries in Quartus really lets you do is add a search path", If I want to use some IPs from third-party vendor (not IP come from Altera), I actually need is the .v or .vhd file of IP, right?

    Thanks very much.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you know C++, then it's easy: the concept of a VHDL library is akin to a C++ namespace. That's all.

    In Verilog, there's no notion of this.

    If you need to use third-party IP, you'll need some kind of Verilog/VHDL/AHDL file.

    It may not be the original source code, though.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    If you know C++, then it's easy: the concept of a VHDL library is akin to a C++ namespace. That's all.

    In Verilog, there's no notion of this.

    If you need to use third-party IP, you'll need some kind of Verilog/VHDL/AHDL file.

    It may not be the original source code, though.

    --- Quote End ---

    That is clear. Thanks very much!