GET_PIN_COUNT_ON_DEVICE

The GET_PIN_COUNT_ON_DEVICE function returns the number of pins on a device, allowing the pins on device to be enumerated with GET_PIN_ON_DEVICE.

The value returned is the number of pins defined in the netlist, except for JTAG devices where it will include additional unconnected pins that are defined in the BSDL file.

Syntax

GET_PIN_COUNT_ON_DEVICE( STRING deviceReference )

Parameters

deviceReference

A device reference in the form 'board.device' or 'board.device.core' for a multicore device. The read-only built-in UNIQUE_DEVICE_REF contains this string for the current test device file. The board name is optional, but the device reference must uniquely identify the device; if there is any ambiguity, then the board name must be supplied.

Return value

An INT value specifying the number of pins on the supplied device.

Errors

An error can occur in the following circumstances:

  • The deviceReference supplied does not match any device in the project.
  • The deviceReference supplied does not contain a board name and matches more than one device.

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

STRING deviceIC1 := "XJDemo.IC1";
INT pinsIC1 := GET_PIN_COUNT_ON_DEVICE(deviceIC1);
INT pinsThis := GET_PIN_COUNT_ON_DEVICE(UNIQUE_DEVICE_REF);
PRINT(pinsIC1, "\n", pinsThis);

Output

13
24