Automatic inference from general VHDL code in Quartus II

Discussion in 'VHDL' started by Thomas Thorsen, Apr 9, 2006.

  1. I have been trying to create a 20bit adder/subtractor in VHDL, but no matter
    how i define it, Quartus II won't infer the appropriate megafunction
    lpm_add_sub. Even if i use the code that can be downloaded from:
    http://www.altera.com/support/examples/vhdl/vhd-add-sub.html

    it still does not infer the lpm_add_sub as it should, according to the
    description. The reason i want this, is that my adder takes up 41 logic
    cells. If i directly instantiate the lpm_add_sub it only takes up 21 logic
    cells (the 2's complement negation is merged into the same logic cells).
    However, if i directly instantiate the lpm_add_sub the code is not general
    VHDL anymore and i need that to (for simulation in ModelSim that does not
    know about the megafunctions). So question is, how do i tell Quartus II that
    my adder should be implemented as an lpm_add_sub (automatic inference)?

    Any helpfull comments are greatly appreciated.
    Thomas Thorsen, Apr 9, 2006
    #1
    1. Advertising

  2. Thomas Thorsen

    Guest

    Thomas Thorsen wrote:
    > I have been trying to create a 20bit adder/subtractor in VHDL, but no matter
    > how i define it, Quartus II won't infer the appropriate megafunction
    > lpm_add_sub. Even if i use the code that can be downloaded from:
    > http://www.altera.com/support/examples/vhdl/vhd-add-sub.html
    >
    > it still does not infer the lpm_add_sub as it should, according to the
    > description. The reason i want this, is that my adder takes up 41 logic
    > cells. If i directly instantiate the lpm_add_sub it only takes up 21 logic
    > cells (the 2's complement negation is merged into the same logic cells).
    > However, if i directly instantiate the lpm_add_sub the code is not general
    > VHDL anymore and i need that to (for simulation in ModelSim that does not
    > know about the megafunctions). So question is, how do i tell Quartus II that
    > my adder should be implemented as an lpm_add_sub (automatic inference)?
    >
    > Any helpfull comments are greatly appreciated.


    The code from their web site does infer an lpm_add_sub; at least it
    does for me.

    Verify that it does for you, and then you can just instantiate that
    entity.

    Modelsim does know about megafunctions. You just need to add the
    correct library.
    , Apr 11, 2006
    #2
    1. Advertising

  3. Mike Treseler, Apr 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Leventis

    Re: Quartus bug or wrong VHDL?

    Paul Leventis, Jun 24, 2003, in forum: VHDL
    Replies:
    0
    Views:
    2,456
    Paul Leventis
    Jun 24, 2003
  2. Shannon
    Replies:
    20
    Views:
    9,681
  3. fons
    Replies:
    0
    Views:
    744
  4. ssylee
    Replies:
    1
    Views:
    1,259
    Mike Treseler
    Oct 26, 2008
  5. Tricky

    Quartus Inference Challenge

    Tricky, May 19, 2009, in forum: VHDL
    Replies:
    4
    Views:
    834
    Jacko
    May 21, 2009
Loading...

Share This Page