Circular self-test path for FSMs