Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21607 Discussions

How to simulate pll module, generated using megafunction wizard, in Altera-Modelsim

Altera_Forum
Honored Contributor II
2,653 Views

Hi, 

 

I have generated a PLL.v module using Quartus II megafunction wizard engine. I am tryiing to simulate my design, with PLL.v as an instance, in altera-modelsim. 

 

I am invoking the modelsim tool from within Quartus II. By doing so, I get a the elaboration of PLL and PLL_ALTPLL modules done inside the "work" directory. On the top of this I am elaborating my testbench, which instantiates the top level module of my design. When I am running following command: vsim -t ps work.<toplevel_module_name>, I am getting follwoing error: "Instantiation of 'altpll' failed. The design unit was not found." 

 

Would anyone help me inthis regards, please? 

 

It seems to me that the PLL.v module has an instantiation of ALTPLL module. But the automatic flow has compiled the module PLL_ALTPLL. Is my analysis correct? If yes, would you please tell me how to resolve this problem. I tried to rename the module names, but didnt help. 

 

Any help is appreciated! 

 

Thanks 

Kapil
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,523 Views

OK, I tried it myself and you are right, altpll is not found. I solved the problem by importing the library. 

 

As you can read in the header of the pll it will need altpll from altera_mf. Normally I would think this is already imported, but when I create the PLL as v it does not work here. Same error as you got. So I import the library by: 

 

vlib altera_mf_ver 

vmap altera_mf_ver altera_mf_ver 

vlog -work altera_mf_ver $env(QUARTUS_ROOTDIR)/eda/sim_lib/altera_mf.v 

 

You will then have to run: 

vsim -L altera_mf_ver -t ps work.<toplevel> 

 

Only thing then is, that my results don't look like I would expect them, but I think I messed up with the input or there is something else to consider. I took this idea from an outdated document of the altera Website. Perhaps you like to look into it yourself under http://www.altera.com/support/examples/modelsim/exm-pll-simulation.html 

 

There are also some scripting examples under http://www.altera.com/support/examples/tcl/tcl-modelsim.html?gsa_pos=1&wt.oss_r=1&wt.oss=tcl%20modelsim perhaps you have to import more libraries for your design. 

 

Yours, Peet!
0 Kudos
Altera_Forum
Honored Contributor II
1,523 Views

Thank you very much Peet! 

 

I will try the apropos suggestions given by you and will get back to you if I still face any issues. 

 

Thanks and regards, 

Kapil
0 Kudos
Reply