GET_PIN

The GET_PIN function returns a string containing the full name of a pin in a bus.

Syntax

GET_PIN( BUS bus )
GET_PIN( BUS bus [ INT index ] )

Parameters

bus
The name of a bus defined in the current test device file. If the bus contains more than one pin, then an index needs to be specified to identify which pin in the bus is to be returned.

Return value

A STRING value containing the name of the pin, in the form 'board.component.pin'. This is guaranteed to work as an argument to PRINT_PIN_LINK, PRINT_PINS_LINK and their TEST_DETAILS variations.

Errors

An error can occur in the following circumstances:

  • An index is supplied for bus, which is greater than or equal to the number of pins in the bus.
  • No index was supplied for bus and the bus contains more than one pin.

In both these cases, if the expressions are constant, the error will occur at compile-time. Otherwise, the error will occur at run-time, when the function is run.

Example

LOCAL PrintPins()()
  INT i;

  PRINT("nCE pin is ", GET_PIN(nCE[0]), "\n");

  FOR i := 0 FOR WIDTHOF(DATA)
    PRINT(FORMAT(i, "DATA[%i] is "), GET_PIN(DATA[i]), "\n");
  END;
END;

Output

nCE pin is XJDemo.IC5.27
DATA[0] is XJDemo.IC5.18
DATA[1] is XJDemo.IC5.19
DATA[2] is XJDemo.IC5.20
DATA[3] is XJDemo.IC5.22
DATA[4] is XJDemo.IC5.23
DATA[5] is XJDemo.IC5.24
DATA[6] is XJDemo.IC5.25
DATA[7] is XJDemo.IC5.26