Forum Discussion
benefits of LPM functions?
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? -Mux3 Replies
- Altera_Forum
Honored Contributor
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.
- Altera_Forum
Honored Contributor
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 - Altera_Forum
Honored Contributor
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.