Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Megafunctions in ModelSim

Hello

I making sort of test here: I made adder using Quartus megafunction LPM_ADD_SUB and I want to simulate in ModelSim-Altera.

The adder has only dataA/B inputs and RESULT output.

The ModelSim project contains the adder verilog file from the megafunction wizard and lpm_add_sum.v.

For defining the inputs using modelsim console with the following:

force dataa 01111000 0

force datab 01111100 0

run 6000000

The result is Z... :eek: :confused: :(

WHY??

When I add clock/clocken/reset to the adder the result is the same.

I think i have all the libraries included.

Or i cant simulate megafunctions with ModelSim??

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Of course you can simulate designs containing Megafunctions, but you may have to reference libraries. With Verilog, this seems always somewhat more complicated to me, but it should work anyway. The important point is: You get a clear warning when ModelSim fails to instantiate a modul referenced in your design, but by default, it won't stop simulation on this error. (You can change the default behaviour e.g. in ModelSim.ini).

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    could you please elaborate on how to reference libraries? or may be point to a link which does so?

    thnx...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Can you share the vlog + vsim commands that you have run ? 220model.v is required to the compiled or referenced from work directory while simulating LPM modules.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    please help me, i synthesis exponential and logarithm in quartuos, but modelsim dont answer.