Detection, diagnosis and modeling of ESD-induced soft failures - a gate-level and mixed-signal approach