def tick(self, domain="sync", *, context=None):
        """Wait until an active clock edge or an asynchronous reset occurs.

        This method returns a :class:`TickTrigger` object that, when awaited, pauses the execution
        of the calling process or testbench until the active edge of the clock, or the asynchronous
        reset (if applicable), occurs. The returned object may be used to repeatedly wait for one
        of these events until a condition is satisfied or a specific number of times. See
        the :ref:`tick trigger reference <sim-tick-trigger>` for more details.

        The :py:`domain` may be either a :class:`ClockDomain` or a :class:`str`. If it is
        a :class:`str`, a clock domain with this name is looked up in
        the :ref:`elaboratable <lang-elaboration>` :py:`context`, or in :py:`toplevel` if
        :py:`context` is not provided.

        Raises
        ------
        :exc:`ValueError`
            If :py:`domain` is :py:`"comb"`.
        :exc:`ValueError`
            If :py:`domain` is a :class:`~.hdl.ClockDomain` and :py:`context` is provided and not
            :py:`None`.
        :exc:`ValueError`
            If :py:`context` is an elaboratable that is not a direct or indirect submodule of
            :py:`toplevel`.
        :exc:`NameError`
            If :py:`domain` is a :class:`str`, but there is no clock domain with this name in
            :py:`context` or :py:`toplevel`.
        """
        if domain == "comb":
            raise ValueError("Combinational domain does not have a clock")
        if isinstance(domain, ClockDomain):
            if context is not None:
                raise ValueError("Context cannot be provided if a clock domain is specified "
                                 "directly")
        else:
            try:
                domain = self._design.lookup_domain(domain, context)
            except KeyError:
                raise NameError(f"Clock domain named {domain!r} does not exist")
        return TickTrigger(self._engine, self._process, domain=domain)
Wait until an active clock edge or an asynchronous reset occurs.

        This method returns a :class:`TickTrigger` object that, when awaited, pauses the execution
        of the calling process or testbench until the active edge of the clock, or the asynchronous
        reset (if applicable), occurs. The returned object may be used to repeatedly wait for one
        of these events until a condition is satisfied or a specific number of times. See
        the :ref:`tick trigger reference <sim-tick-trigger>` for more details.

        The :py:`domain` may be either a :class:`ClockDomain` or a :class:`str`. If it is
        a :class:`str`, a clock domain with this name is looked up in
        the :ref:`elaboratable <lang-elaboration>` :py:`context`, or in :py:`toplevel` if
        :py:`context` is not provided.

        Raises
        ------
        :exc:`ValueError`
            If :py:`domain` is :py:`"comb"`.
        :exc:`ValueError`
            If :py:`domain` is a :class:`~.hdl.ClockDomain` and :py:`context` is provided and not
            :py:`None`.
        :exc:`ValueError`
            If :py:`context` is an elaboratable that is not a direct or indirect submodule of
            :py:`toplevel`.
        :exc:`NameError`
            If :py:`domain` is a :class:`str`, but there is no clock domain with this name in
            :py:`context` or :py:`toplevel`.
        
amaranth/sim/_async.py