A simulation-based approach to test pattern generation for synchronous circuits