GET_JTAG_DEVICE

The GET_JTAG_DEVICE function gets a device reference for a JTAG device at a given position in a given chain. JTAG chains are indexed on the JTAG Chain screen starting from one, and devices within each chain are also indexed starting from one. Use GET_JTAG_DEVICE_COUNT to determine how many devices are in a given chain.

If the project uses dynamic chains, then only devices on subchains that are part of the current profile will be returned. If a chain is not included in the current profile, then it considered to be empty, and GET_JTAG_DEVICE_COUNT will return zero.

Syntax

GET_JTAG_DEVICE( INT chainIndex, INT deviceIndex )

Parameters

chainIndex
The index of the JTAG chain, as defined on the JTAG Chain screen.
deviceIndex
The index of the JTAG device in the chain to query.

Return value

A STRING value containing a device reference for the JTAG device at the specified index in the specified chain. The device reference will contain the board name as well if there are multiple boards in the project. If the device is a multicore device then the returned string will contain the device reference and the name of the core, e.g. IC2.core0.

Errors

If zero is passed in for either index, then an error occurs. If the index value is constant, then the verification can be done at compile-time and an error is emitted then, otherwise the error will occur at run-time, when the function is run.

Example

CONST INT MAX_CHAIN_COUNT := 4;

GLOBAL EnumerateDevices()()
  INT chainIndex, deviceIndex;
  INT count;
  STRING deviceRef;

  FOR chainIndex := 1 TO MAX_CHAIN_COUNT
    count := GET_JTAG_DEVICE_COUNT(chainIndex);
    IF count > 0 THEN
      FOR deviceIndex := 1 TO count
        deviceRef := GET_JTAG_DEVICE(chainIndex, deviceIndex);
        PRINT("Chain #", chainIndex, " device #", deviceIndex, ": ", deviceRef, "\n");
      END;
    END;
  END;
END;