Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20789 Discussions

benefits of LPM functions?

Altera_Forum
Honored Contributor II
1,159 Views

Hi All, 

 

Is there a benefit for using LPM functions rather than coding them yourself? Except for allowing you to pipeline 'canned' functions, there doesn't seem to be much else. Actually, I've noticed that using certain LPM versions are slower than the ones hand-coded. 

 

Thoughts? 

 

-Mux
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
424 Views

Long ago they were handy for making sure you get exactly the behavior you want from the synthesis engine (or if you developed hardware using schematics). These days I use them if there is no easy way to code in HDL the behavior I want. So I use them for instantiating memory, FIFOs, floating point hardware, or something that targets the DSP blocks but I think it's a waste of time to use them for things like adders, flipflops, etc... if you are already developing using HDL.

0 Kudos
Altera_Forum
Honored Contributor II
424 Views

Yeah, kinda the same here. I've gone back and forth at times to see if there was a speed increase but most of the time, they came out slower unless you pipelined them, as I mentioned earlier. 

So yeah, just wondered if there was another advantage besides that...  

 

-Mux
0 Kudos
Altera_Forum
Honored Contributor II
424 Views

Infer everything you can - it allows portability (to xilinx) and easy simulation. 

The only arithmetic function you have to use lpm for is dividers, or if you want to customise your DSP blocks. 

 

Btw, if you watch the info messages, you'll actually see quartus infer LPM library blocks from your generic code.
0 Kudos
Reply