PINNUM
The PINNUM function returns a string containing the pin number or pin designator of a member of a bus in the current device file.
Syntax
PINNUM( BUS bus )
PINNUM( BUS bus [ 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 pin number of the specified bus member. If the bus member is a pin from another device, then the returned string will contain the device reference too; use GET_PIN_INFO to deconstruct the string.
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 (compile-time or run-time).
- No index was supplied for bus and the bus contains more than one pin (compile-time).
Example
// Busses defined in this device file: // // ADDRESS := 19, 22, 23, 1, 2, 3, 4, 5, 6, 7, 8; // DATA := 17, 16, 15, 14, 13, 11, 10, 9; // nOE := 20; // nWE := 21; // nCS := 18; PrintPins()() INT i; PRINT("nCS pin is ", PINNUM(nCS), "\n"); FOR i := 0 FOR WIDTHOF(DATA) PRINT(FORMAT(i, "DATA[%i] is "), PINNUM(DATA[i]), "\n"); END; END;
Output
nCS pin is 18 ADDR[0] is 9 ADDR[1] is 10 ADDR[2] is 11 ADDR[3] is 13 ADDR[4] is 14 ADDR[5] is 15 ADDR[6] is 16 ADDR[7] is 17
XJTAG v4.1.100