docs: def _get_minimal_core_reservations(core_resource, cores, chip=None):
      """Yield a minimal set of
      :py:class:`~rig.place_and_route.constraints.ReserveResourceConstraint`
      objects which reserve the specified set of cores.
  
      Parameters
      ----------
      core_resource : resource type
          The type of resource representing cores.
      cores : [int, ...]
          The core numbers to reserve *in ascending order*.
      chip : None or (x, y)
          Which chip the constraints should be applied to or None for a global
          constraint.
  
      Yields
      ------
      :py:class:`~rig.place_and_route.constraints.ReserveResourceConstraint`
      """
      reservation = None
  
      # Cores is in ascending order
      for core in cores:
          if reservation is None:
              reservation = slice(core, core + 1)
          elif reservation.stop == core:
              reservation = slice(reservation.start, core + 1)
          else:
              yield ReserveResourceConstraint(
                  core_resource, reservation, chip)
              reservation = slice(core, core + 1)
  
      if reservation is not None:
          yield ReserveResourceConstraint(core_resource, reservation, chip)