A design flow for protecting FPGA-based systems against single event upsets