Adding to a sum variable produces a "reals can't be synthesized" error in verilog
It's rally as simple as the message says. The tool can't map reals to hardware. I don't know if your target chip has hardware real support. But if it does, you likely need to instantiate that block.