Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17254 Discussions

Modelsim-Altera Error VHDL package file

Altera_Forum
Honored Contributor II
2,201 Views

Hi , 

 

I am working on a VHDL project with many components , i have written a package file with all components declared in it and its been added as a library in my Top file . 

 

The project compiles with no errors , but when i try to do modelsim-altera simulation i get error that this package file is not specified ??? 

 

do i have to specify complete path for modelsim in my library declaration ??? 

 

How to get rid of this error ? 

 

I am using Quartus and Modelsim of version 13.0. 

 

Regards ,
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,136 Views

Have you included the package in the list of files to be compiled?  

You dont add the full path - you just add: 

 

library <mylib> 

use <mylib>.<mypackage>.all; 

 

But using a package of components for VHDL entities is now redundant and can be error prone. For a start, it requires almost identical copies of the entities in the package, which means you need to maintain two bits of code that are bascially the same. If there is a missmatch, you will not notice until elaboration (which can take a while in large synthesis runs). The use of direct instantiation avoids both of these problems because the checks are done at compile time and you dont need to maintain the code twice (ie. you dont need a package of components at all). 

 

direct instantiation is done like this: 

 

my_inst : entity <mylib>.<myent> generic map ( ) port map ( );  

 

This is a feature that all synthesis tools support and has been a part of VHDL for more than 20 years (but is hardly ever taught in books unfortunately). 

 

Components are still required if you have an entity that comes from a non VHDL source eg. Verilog, netlist etc.
0 Kudos
Altera_Forum
Honored Contributor II
1,136 Views

Yes your right this how i have listed my library : 

 

LIBRARY ieee; 

USE ieee.std_logic_1164.ALL; 

 

LIBRARY CPU; 

USE CPU.cpu_components_pkg.ALL; 

 

It compiles in Quartus without any warning or errors , its only when i do RTL simulation , that Modelsim spits out error about the package library . 

 

All files are in the same folder . 

 

I guess i have to use direct instantiation in my top file to get rid of this error
0 Kudos
Altera_Forum
Honored Contributor II
1,136 Views

what errors? did you create the cpu library in modelsim? did you compile the cpu_components_pkg into the cpu library?

0 Kudos
Reply