Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
1,650 Views

[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!
0 Kudos
7 Replies
Highlighted
Valued Contributor III
91 Views

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>
0 Kudos
Highlighted
Valued Contributor III
91 Views

 

--- 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"?
0 Kudos
Highlighted
Valued Contributor III
91 Views

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;
0 Kudos
Highlighted
Valued Contributor III
91 Views

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!
0 Kudos
Highlighted
Valued Contributor III
91 Views

Quartus only has limited 2008 support in prime. Context is not one of them. 

Prime Pro has full 2008 support, so if you have the licence, give that a go. Otherwise, you're limited to this: http://quartushelp.altera.com/14.1/mergedprojects/hdl/vhdl/vhdl_list_2008_vhdl_support.htm
0 Kudos
Highlighted
Valued Contributor III
91 Views

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)?
0 Kudos
Highlighted
Valued Contributor III
91 Views

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.

0 Kudos