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

simulating transciver based design in modelsim altera starter.

Altera_Forum
Honored Contributor II
1,857 Views

I have a cyclone v design written in verilog with a transciver in it. I can synthesize it in quartus successfully but I can't get it to simulate in modelsim. I get Instantiation of 'altera_xcvr_native_av' failed. The design unit was not found. 

 

I've looked through the libraries panel in modelsim and can't seem to find that entity. Can anyone tell me how I can add it?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
571 Views

Hello, are you doing an RTL simulation or an Functional simulation?

0 Kudos
Altera_Forum
Honored Contributor II
571 Views

I had the same problem. I figure out how to use the tcl files produced by quartus to get the create the simulation libraries for the Configuration controller but when I tried the same process with the xcvr it didn't work! After executing the Configuration controller msim_setup.tcl script I had a resource library with the same name as the controller. I expanded the library and could see all the components that make up that ip. When I tried the same with the CustomPhy transceiver I was left with an empty library. 

I then manually entered the vlog commands from the tcl file. Some files would result in entries in the library but following files would then cause the library to become empt again. It seemed that the generic files would compile fine but then the files in the modelsim folder below that would make them disappear. 

 

So I added the xvcr files to the modelsim project and simulated the code that way. It took a while to get the compile order correct but it works. 

 

Strange about the xcvr sim files. 

 

Anyway, here's what I learned: 

 

In modelsim create a project. The project wizard will allow you to select a folder for the project and create a work library. 

The work library is the default location for compiled sources.  

Add the your existing source files to the project. 

Locate the modelsim_setup.tcl file for the transceiver and open it in an editor. Near the top of the file find the QUARTUS_INSTALL_DIR variable. Make sure it matches your installation. Correct it if it is not. 

Look further down in the file and find "alias com". 

This is a list of the simulation source files and the commands to compile them. Look to the end of the line and you'll find the -wok switch which names the library where the file will be compiled to. 

Now in the transcript window of modelsim enter the following commad: "set QSYS_SIMDIR <path_to_your_quartus_project_directory_ip_folder_sim>" 

In my case its "set QSYS_SIMDR ./src/transport/custom_phy_sim" 

now type "source <path_to_your_quartus_project_directory_ip_folder_sim/mentor/msim_setup.tcl" 

In m case its "source ./src/transport/custom_phy_sim/mentor/msim_setup.tcl" 

now type com 

This will execute all those vlog command you saw in the tcl file. 

Now do the same for any other ip you have. 

When you add to project a simulation configuration you must add these libraries to the list under the libraries tab to be accessable to your code. 

 

Hope this help! 

 

 

 

I'm using subscription Quartus 14.1 and modelsim AE 10.1e. 

 

By the way, the Transceiver Design Flow articles in the Alter wiki was a big help in getting started with the tcl files. It's under Interfaces. 

 

Thanks for listening, 

Kevin
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

Hi Kevin, 

 

thank you very much for sharing this. I am experiencing the same exact problem, I also tried to enter the vlog and vcom command manually from the modelsim prompt but I couldn't get the simulation working. It seems like some libraries are complied but are not somehow visible from modelsim, for example the cyclone_hssi_ver. Could you please explain what was the correct order for you? 

 

Monica
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

Hi Monica, 

 

Sorry for taking so long. 

 

I added the files in the order that they appear in the com section of the mentor/msim.setup.tcl file. 

 

It's tedious, I know, but worked for me.  

 

I create a folder in the modelsim project window just to organize the transceiver files. 

In modelsim click on project/add to project/folder, type in the name for the folder and press enter. 

Open the msim_setup,.tcl file in text editor. 

In modelsim click on project/add to project/existing file, navigate to the directory for the transceiver. In my case the transceiver was name custom_phy. Navigate to directory of the first file named in the tcl file. Select the altera_xcvr_functions.sv, click open, select the folder in the drop down menu then click OK. 

Do that for each file until finished.  

When there are a bunch of files in the list that come from the same directory you can select all the ones in that group in one operation. 

 

Let me know how works out for you. 

 

Kevin
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

Hi Kevin, 

 

thanks a lot for your feedback. I had temporarily given up but I decided to give it a try following your indications and it actually works! 

 

Cheers, 

 

Monica
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

That's great! 

I still don't know why the transceiver needs such special care since the reconfiguration controller doesn't. I've asked but received no replies. 

 

Glad I could help. 

 

Kevin
0 Kudos
Reply