GET_PIN_INFO
The GET_PIN_INFO function returns the component parts of a pin reference, returning the board name, device reference and pin number as separate strings.
The version of this function that takes a pin reference as an input was introduced in XJTAG version 3.2.3.
Syntax
GET_PIN_INFO( BUS bus ) ( STRING board, STRING device, STRING pin )
GET_PIN_INFO( BUS bus [ INT index ] ) ( STRING board, STRING device, STRING pin )
GET_PIN_INFO( STRING pinReference ) ( STRING board, STRING device, STRING pin )
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.
- pinReference
-
A string that identifies a pin in the netlist in the form 'board.component.pin'. This may be a string returned from the GET_PIN function. The board name is optional, but the pin reference must uniquely identify the pin, so if there is any ambiguity with the device reference, then the board name must be supplied.
- board
- Returns the name of the board that the device is on. This will be returned even if the board was not specified as part of pinReference.
- device
- Returns the device reference of the device.
- pin
- Returns the designator (or pin number) of the pin.
Errors
An error can occur in the following circumstances:
- The bus specified does not exist in the current test device file.
- 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.
- The device referenced by pinReference does not match any device in the project.
- The pin referenced by pinReference does not exist on the device.
- The pinReference supplied does not contain a board name and matches more than one device.
In all 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 board, device, pin; INT index := 0; GET_PIN_INFO(DATA[index])(board, device, pin); PRINT(board, ", ", device, ", ", pin); GET_PIN_INFO("XJDemo.IC2.1")(board, device, pin); PRINT(board, ", ", device, ", ", pin);
Output
XJDemo, IC5, 9 XJDemo, IC2, 1
XJTAG v4.1.100