Forum Discussion
Altera_Forum
Honored Contributor
15 years agoUsing multiple LPMs of same type but different characteristics
Hi all, I was trying to find a way to use the sam LPM Megafunction but with different settings. For example, the lpm_add_sub function, I would like to have both an adder and subtractor but can...
Altera_Forum
Honored Contributor
15 years agoAt some point the compiler will search for the entity "lpm_sub", which you probably haven't created as you want to invoke an existing LPM function. Hence the error.
LPM_TYPE is to be seen as a constant rather than a parameter. LPM functions go back a long time, at some point it was an industry standard. You could do it like this
library lpm ;
use lpm.lpm_components.all ;
- - -
lpm_sub_component1 : lpm_add_sub
generic map (
lpm_direction : STRING := "ADD";
. . .
)
port map (
. . .
) ;
lpm_sub_component2 : lpm_add_sub
generic map (
lpm_direction : STRING := "SUB";
. . .
)
port map (
. . .
) ;