Altera_Forum
Honored Contributor
11 years agoLPM_ADD_SUB result right-shifted on Arria V
I created an lpm_add_sub megafunction using Quartus 13.1 to add two 16-bit unsigned numbers. In ModelSim, everything works as expected. I put X"0001" on both inputs and get X"0002". However once I try the same test on an Arria V GX FPGA, I get X"0001" out. My tests seem to show that the output sum is right-shifted by a bit. Any ideas about what could be wrong?
Megawizard initiated the lpm_add_sub as follows. The clock is 100Mhz and Quartus does not indicate any timing issues. aclr is held at 0 and clken is held at 1 for my tests. LPM_ADD_SUB_component : LPM_ADD_SUB GENERIC MAP (
lpm_direction => "ADD",
lpm_hint => "ONE_INPUT_IS_CONSTANT=NO,CIN_USED=NO",
lpm_pipeline => 1,
lpm_representation => "UNSIGNED",
lpm_type => "LPM_ADD_SUB",
lpm_width => 16
)
PORT MAP (
aclr => aclr,
clock => clock,
datab => datab,
clken => clken,
dataa => dataa,
overflow => sub_wire0,
result => sub_wire1
);