An improved chip-level test generation algorithm