Online self-test, diagnostics, and self-repair for robust system design