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

NCO-simulation in modelsim not successful

Altera_Forum
Honored Contributor II
1,778 Views

Hello, 

 

i have a problem with my NCO-block. 

I have created an nco-block in quartus 11.1 and want to simulate it with modelsim altera. 

I wrote a testbench (without creating errors) and simulated it in modelsim. 

The input signals are created in the right way. 

The outputs (sin, cos, valid) are constants (0). 

It seems that the block does not know what to do.  

 

It would be fine if anyone could help me! 

Thanks! :)
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
859 Views

 

--- Quote Start ---  

 

It would be fine if anyone could help me! 

 

--- Quote End ---  

 

 

Create a zip file containing your NCO instance and your testbench code. If you know how to create a Modelsim Tcl script, add that too. Post the zip file to this thread, and then we can look at it. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
859 Views

Did you create a functional simulation model in the MegaWizard? Did your simulation load this simulation model?

0 Kudos
Altera_Forum
Honored Contributor II
859 Views

Hello, 

 

attached you can find the zip-file (included: tcl-file). 

 

Best regards!
0 Kudos
Altera_Forum
Honored Contributor II
859 Views

 

--- Quote Start ---  

 

attached you can find the zip-file (included: tcl-file). 

 

--- Quote End ---  

There is no Tcl simulation file in there that you wrote. Only you know what component should be simulated, so you should really write one yourself. 

 

Here's what I did. 

 

1) Unzipped the zip file, into eg., c:/temp/klause, which created c:/temp/klause/D8PSK 

 

2) Started Modelsim-ASE and changed directory to c:/temp/klause and typed 

 

vlib work 

 

to create a work folder. Typing 'vmap work' shows that the work folder maps to the default location ./work. If you don't see that, type 'vmap work ./work' 

 

3) Compile the source 

 

vcom D8PSK/nco.vho 

vcom D8PSK/MY_TESTBENCH/tb_D8PSK.vhd 

 

this fails, since your testbench is trying to simulate your project top-level entity, whereas you want to simulate the nco, so I edited the file and changed the code to 'dut : entity work.nco', and then it compiled fine. 

 

4) Simulate 

 

vsim -novopt tb_D8PSK 

add wave * 

run 10 us 

 

It worked fine. What didn't work for you? 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
859 Views

thank you! now it works! :) 

i did not realized that i have to refer to the nco.vho and not to the top level entity. 

 

but if i have more blocks than one i have to use the top level entity, isn't it? 

or is there anything else that i have to consider to make the simulation work?
0 Kudos
Altera_Forum
Honored Contributor II
859 Views

 

--- Quote Start ---  

 

thank you! now it works! :) 

 

--- Quote End ---  

 

 

Great! 

 

 

--- Quote Start ---  

 

i did not realized that i have to refer to the nco.vho and not to the top level entity. 

 

--- Quote End ---  

 

 

It depends on what you are trying to simulate. Your forum title requested NCO simulation, so that is what I helped you with. 

 

 

--- Quote Start ---  

 

but if i have more blocks than one i have to use the top level entity, isn't it? 

or is there anything else that i have to consider to make the simulation work? 

--- Quote End ---  

 

 

If you have a top-level design, then you just need to make sure you compile all the components it uses, and then edit the testbench to instantiate the top-level design (making sure that all the port names match). When you use vsim to simulate the top-level, look at the log messages in the Modelsim window and you will see all of the other components being loaded. 

 

Cheers, 

Dave
0 Kudos
Reply