Forum Discussion

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

LPM_CONTANT in Quartus II 10.0

Hello,

it seems that LPM_CONSTANT (along with many other LPM megafunctions) is no more supported in Quartus 10.0.

It is sometimes useful to me to place constants in .bdf source files; any suggestion about how to replace it?

Also, I'm not sure if .bdf files created with previous version of Quartus, with instances of LPM_CONSTANT, will be properly compiled: when I click on the symbol of the constant, nothing happens: no warning, no error, just nothing!

5 Replies

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

    I just tried and it appears you are correct. I was able to type lpm_constant directly into the symbol window and instantiate it via the symbol and parametrize it directly though.

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

    the lpm's are supposed to compile correctly, i also verified this on chip with STII.

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

    i took a stab at creating an lpm_constant alternative. its just a couple lines of parametrized Verilog with a bsf symbol included. here's the readme.txt:

    my_constant is an lpm_constant replacement

    to use my_constant, set the my_constant directory as a Global or Project Library path in Quartus II. to add the directory path, go to Assignments > Settings > Libraries and add the my_constant directory. you will also need to add my_constant.qip as a file in the project. in the Settings window, go to Files and add my_constant/my_constant.qip.

    my_constant is written with two user configurable parameters: WIDTH and VALUE. the bit width of the constant should be specified as WIDTH and the value of the constant should be set as VALUE. signed and unsigned values are supported.

    note that there is no type checking to see if WIDTH is valid for the specified VALUE. for example, if WIDTH is 8 and VALUE is 256 the constant will have a value of 8'b00000000 without any warning.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i had to build a .bdf today which contained 8 lpm_constant functions. having to go into the MegaWizard to create each variation was actually quite painful. i would have rather used this library since i could have copy and pasted 8 times, then just changed the parameters of each block in the schematic editor.

    i think creating an lpm alternative library could actually work out well, increasing efficiency in the schematic editor and teaching people the HDL behind the symbols along the way
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you instantiate the LPM without using the megawizard manager and then parameterize the symbol in the schematic then you should be able to copy and paste it while retaining the parameterization settings. It's been a while since I've done much with schematics but that's how it used to work.... if I remember correctly.