High level modeling and mitigation of transient errors in nano-scale systems