def METHOD_NAME(self):
    """Generate a sequence of test steps.
    This coroutine calls yield to wait for the input from the device
    (the reset_reason). If the device gives the wrong response, the
    generator raises a RuntimeError exception and fails the test.
    """
    # Ignore the first reason.
    __ignored_reset_reason = yield
    self.raw_reset_reasons.clear()
    self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
    __ignored_clear_ack = yield
    # Request a NVIC_SystemReset() call.
    expected_reason = 'SOFTWARE'
    if expected_reason not in self.device_reasons:
        self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
    else:
        # Request a NVIC_SystemReset() call.
        self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_NVIC)
        __ignored_reset_ack = yield
        time.sleep(self.sync_delay)
        self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
        reset_reason = yield
        raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
        self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
        __ignored_clear_ack = yield
    # Reset the device using DAP.
    expected_reason = 'PIN_RESET'
    if expected_reason not in self.device_reasons:
        self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
    else:
        self.reset()
        __ignored_reset_ack = yield  # 'reset_complete'
        time.sleep(self.sync_delay)
        self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
        reset_reason = yield
        raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
        self.send_kv(MSG_KEY_RESET_REASON, MSG_VALUE_RESET_REASON_CLEAR)
        __ignored_clear_ack = yield
    # Start a watchdog timer and wait for it to reset the device.
    expected_reason = 'WATCHDOG'
    if expected_reason not in self.device_reasons or not self.device_has_watchdog:
        self.log('Skipping the {} reset reason -- not supported.'.format(expected_reason))
    else:
        self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_WATCHDOG)
        __ignored_reset_ack = yield
        time.sleep(self.sync_delay)
        self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
        reset_reason = yield
        raise_if_different(RESET_REASONS[expected_reason], reset_reason, 'Wrong reset reason. ')
    # The sequence is correct -- test passed.
    yield True