Analysis and mitigation of single event effects on flash-based FPGAS