Design of carry chain on Cyclone IV
You need to convince the synthesizer that a and b can change at any time &mdash; if it believes that they are constants, it will optimize them away.

It doesn't matter how they can change. One simple way would be to have a shift register whose serial input comes from an external pin, and whose outputs drive a and b.

You can ground the pin externally, and then put logic (e.g., XOR gates) between the shift register and the adder to produce the bit patterns you actually want.