ExpertLibRead.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Christophe Cuenod, April 2, 1989 0:54:55 am PST
This interface gives a primitive to read an Expert .lib file and retrieve from this file for part entry the relative position of each pin.
DIRECTORY
Rope USING [ROPE],
IntHashTable USING [Table];
ExpertLibRead: CEDAR DEFINITIONS
LibTable: TYPE = IntHashTable.Table;
PinPos:
TYPE =
RECORD[
x: INT,
y: INT
];
PartPinInfo:
TYPE =
RECORD[
pinPos: PinPos,
diameter: NAT,
site: NAT,
padStack: NAT,
swap: NAT,
type: NAT,
name: Rope.ROPE
];
LibEntry: TYPE = REF LibEntryRep;
LibEntryRep:
TYPE =
RECORD[
partName: Rope.ROPE,
partNumber: Rope.ROPE,
partPinInfo: SEQUENCE size: NAT OF PartPinInfo
];
Reading the .lib file
ReadLibFile:
PROC [file: Rope.
ROPE]
RETURNS [libTable: LibTable];
Creates libTable from the input file
Retrieving various informations
Retrieving the name of an entry
PartName: PROC [libTable: LibTable, entryNumber: CARD] RETURNS [partName: Rope.ROPE];
Retrieving the "part number" of an entry
PartNumber: PROC [libTable: LibTable, entryNumber: CARD] RETURNS [partNumber: Rope.ROPE];
Retrieving the number of pins of an entry
PinNumber:
PROC [libTable: LibTable, entryNumber:
CARD]
RETURNS [pinNumber:
NAT];
gives the number of pins of an entry
Retrieving a pin position
RelativePinPosition:
PROC [libTable: LibTable, entryNumber:
CARD, pin:
NAT]
RETURNS [pinPos: PinPos];
gives the relative position of any pin for an unrotated entry
Retrieving the first pin with a given type and swap code.
FirstPinOfThisType:
PROC [libTable: LibTable, entryNumber:
CARD, type:
NAT, swap
: NAT]
RETURNS [pinNumber:
NAT];
returns 0 if not found
Testing the type and swap code of a given pin.
IsPinOfThisType:
PROC [libTable: LibTable, entryNumber:
CARD, pinNumber:
CARD, type:
NAT, swap:
NAT]
RETURNS [yes:
BOOLEAN];
TRUE if the pin has the correct type and swap code
END.