Forum Discussion

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

[Quartus] how to define the compilation libraries for VHDL files?

Hi All,

In Quartus Prime, how can I define the compilation library each VHDL file?

For example, I'd like the file top.vhd file will be compiled into 'work' library and all the *_pkg.vhd files will be compiled into 'pkgs' lib, etc.

How can I do so?

Thank you!

7 Replies

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

    why would you put all the packages in their own library? packages should be in appropriate libraries.

    To set the library in the gui, in the file list in assignments-> settings, click properties and change the file's library there.

    Otherwise, in the .qsf:

    set_global_assignment -name VHDL_FILE <myfile> -library <mylib>
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    why would you put all the packages in their own library? packages should be in appropriate libraries.

    --- Quote End ---

    if I want to use the 'context' in the libraries clause, I must compile the context's related packages in a separate library (not to 'work' lib).

    Example:

    library pkgs;
    context pkgs.all_func;
    ...
    contect all_func is
      library pkgs;
      use f1_pkg.all;
      use f2_pkg.all;
      ...
    end context;
    

    --- Quote Start ---

    packages should be in appropriate libraries

    --- Quote End ---

    What do you mean "appropriate libraries"?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    A context can contain multiple libraries and multiple use clauses. No need to have all of the packages in a single library. A context also exists within a library.

    eg:

    
    context my_ctx is
      library lib1;
      use lib1.pkg1.all;
      library lib2;
      use lib2.lib2pkg.all;
    end context my_ctx;
    ....
    library some_othter_lib;
    context some_other_lib.my_ctx;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    BTW, does Quartus Prime supports the context statement?

    I'm receiving the following error:

    Error (10500): VHDL syntax error at t_all.vhd(6) near text "context";  expecting "entity", or "architecture", or "use", or "library", or "package", or "configuration"

    for the following file contents (this file is defined as VHDL-2008 file in the Project Settings):

    
    context t_all is
      library pkgs;
      use     pkgs.t_bit.all;  
      use     pkgs.t_lpfsm.all;      
      use     pkgs.t_des.all;  
      use     pkgs.t_fifo.all;  
      use     pkgs.t_ports.all;  
      use     pkgs.t_tbl.all;  
    end context t_all;
    

    It seems Questa Prime does not recognize the context keyword...

    So, how to fix/workaround?

    How can I use VHDL-2008 context statements with Quartus Prime? I'm using QuestaPrime v16.1.

    Thank you!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    No, I don't have a Pro license...

    Can I include packages inside of other packages (just to make a walk around for 'context' problem)?

    Is there another way to walk around this issue (bisides declaring a long list of packets, which were included in the 'context' declaration)?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    no, packages cannot be included with other packages (hence why context was added to vhdl 2008). You just need to write out the long list.