# Dynamic Initialization

Below is a list of commands that are available directly off of the ipc object:

    ipc.init.<functions>

class IpcInit(base)

  Provides dynamic initialization functionality.

  finish()

    Finalizes dynamic initialization.

  get_available_scenarios()

    Returns the available configuration preset scenarios.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> ipc.init.get_available_scenarios()
        ['Auto', 'DCI', 'XDPA', ...]

  get_connected_probes()

    Returns a list of all supported probes currently connected to the host.

    Each probe is represented as a tuple with the probe type and the probe’s unique identifier (e.g. USB port path, serial number, etc).

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> ipc.init.get_connected_probes()
        [('XDPA', '13102644'), ('CCA', '1-3')]

  get_supported_tap_controllers()

    Returns a list of all supported TAP controllers.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> ipc.init.get_supported_tap_controllers()
        [('SKL_U_UC', 'A0'), ('SKL_U_UC', 'B0'), ...]

  initialize_probe(debugport)

    Initialize the probe of the specified debug port device.

    Once a probe is initialized, its interfaces will be added to the device list.

    Parameters

      debugport (int) – The debug port device representing the probe to initialize.

  load_config()

    Restores the saved configuration from disk created from the last successful call to save_config().

    Restoring a saved configuration is akin to “replaying” the steps taken in dynamic initialization before the configuration was originally saved.

    Warning: Saved configurations from a previous version of the IPC implementation may be incompatible

      and unable to be restored.

  prespecify_device_configs(device_search_pattern, config_name_value_pairs)

    Prespecifies device configuration settings to be applied when device(s) matching the search pattern are added to the device tree.

    No error will be returned immediately from this function if any of the provided device configs are invalid in any way. A warning message will be published if any of the prespecified device configs fail to apply for any reason.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Parameters

      - device_search_pattern (str) – The regex search pattern used to select which device(s) the provided configuration settings apply to based on device name.

      - config_name_value_pairs (list of tuples) – The list of name/values of the device configs to prespecify.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> ipc.init.prespecify_device_configs("JtagScanChain0", [('Jtag.TclkRate', '100000')])
        >>> ipc.init.finish()

  prespecify_tap_controllers(debugport, jtag_chain_index, tap_controllers)

    Prespecifies which TAP controllers are expected to be present on the specified JTAG chain of a selected probe before the probe is initialized.

    Prespecifying TAP controllers does not disable TAP discovery. It does, however, provide a hint to the implementation to allow for non-default configuration settings to be applied before TAP discovery based on which TAPs are expected, which is might be necessary for certain use cases.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Parameters

      - debugport (int) – The debug port device representing the probe to prespecify TAP controllers for.

      - jtag_chain_index (int) – The index of the JTAG chain.

      - tap_controllers (list of tuples) – The list of the TAP controllers to prespecify.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> probe = ipc.init.select_probe('CCA')
        >>> ipc.init.prespecify_tap_controllers(probe, 0, [('SKL_U_UC', 'A0')])
        >>> ipc.init.prespecify_tap_controllers(probe, 1, [('SKL_U_UC', 'A0')])
        >>> ipc.init.finish()

  save_config()

    Saves the active configuration to disk.

    The active configuration consists of the steps taken during dynamic initialization (e.g. probe selection, TAP controller discovery/specification, etc) along with any device configs set.

    Note: The saved configuration is written to an opaque binary file stored in the user’s home

      directory.

  select_probe(probe_type, unique_identifier=None)

    Selects the specified probe to be active in the current configuration. This function can be called multiple times to select multiple probes.

    A probe can be selected using the results of get_connected_probes() or alternatively by manually specifying a specific probe type expected to be present. Once a probe is selected, a debug port device is added to the device list which can be used to set configuration parameters on the probe before it is fully initialized.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Parameters

      - probe_type (str) – The probe type of the probe to select.

      - unique_identifier (str) – The unique identifier of the probe to select (e.g. port path, serial number).

    Examples

    Selecting a probe by probe type:

          >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
          >>> ipc.init.select_probe('CCA')
          >>> ipc.init.finish()

    Selecting a probe by probe type and unique identifier (port path):

          >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
          >>> ipc.init.select_probe('CCA', '1-3')
          >>> ipc.init.finish()

    Selecting a probe and changing configuration settings:

          >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
          >>> probe = ipc.init.select_probe('CCA')
          >>> probe.config.Jtag.DisableAllInterfaces = 'true'
          >>> ipc.init.finish()

  select_scenarios(scenarios)

    Selects one or more configuration preset scenarios to apply to the active configuration.

    Note: This function can only be used after dynamic initialization has begun and before it has

      finished.

    Parameters

      scenarios (list) – A list of configuration scenario presets to apply.

    Examples

        >>> ipc = ipccli.baseaccess(dynamic_initialization=True)
        >>> ipc.init.select_scenarios(['DCI', 'NoDetectTaps'])
        >>> ipc.init.finish()