ExpertDescribePart.mesa
Christophe Cuenod March 28, 1988 1:11:26 pm PST
Reads a .lib file and shows the parameters of each pin for a given part
DIRECTORY
Commander USING [CommandProc, Register],
ExpertLibRead USING [LibEntry, LibTable, ReadLibFile],
IO USING [GetCard, GetTokenRope, int, PutF, RIS, rope, STREAM],
Rope USING [ROPE],
IntHashTable USING [Fetch];
ExpertDescribePart: CEDAR PROGRAM
IMPORTS Commander, ExpertLibRead, IO, IntHashTable =
BEGIN
ROPE: TYPE = Rope.ROPE;
ExpertDescribePartProc: Commander.CommandProc = BEGIN
entry: CARD;
libEntry: ExpertLibRead.LibEntry;
libTable: ExpertLibRead.LibTable;
stream: IO.STREAMIO.RIS[cmd.commandLine];
inputName: ROPEIO.GetTokenRope[stream].token;
entry ← IO.GetCard[stream];
IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]];
libTable ← ExpertLibRead.ReadLibFile[inputName];
libEntry ← NARROW[IntHashTable.Fetch[libTable, entry].value];
FOR i : NAT IN [0..libEntry.size) DO
IO.PutF[cmd.out, "\nPin %g \tPadStack %g", IO.int[i+1], IO.int[libEntry[i].padStack]];
ENDLOOP;
IO.PutF[cmd.out, "\n\n%g %g\n", IO.rope[libEntry.partName], IO.rope[libEntry.partNumber]];
END;
Commander.Register[
key: "ExpertDescribePart", proc: ExpertDescribePartProc, doc: "Read an Expert .lib file"];
END.