ExpertSinglePinNets.mesa
Christophe Cuenod February 7, 1988 0:51:42 am PST
Reads a .pinlist file and output the results on the screen
DIRECTORY
Commander USING [CommandProc, Register],
ExpertPinRead USING [PinTable, PinInfoList, ReadPinFile],
IO USING [card, Close, GetTokenRope, int, PutF, RIS, rope, STREAM],
FS USING [StreamOpen],
Rope USING [Cat, ROPE],
SymTab USING [EachPairAction, Pairs];
ExpertSinglePinNets: CEDAR PROGRAM
IMPORTS Commander, ExpertPinRead, FS, IO, Rope, SymTab =
BEGIN
ROPE: TYPE = Rope.ROPE;
ExpertSinglePinNetsProc: Commander.CommandProc = BEGIN
PrintSinglePinNets: SymTab.EachPairAction ~ {
pinInfoList: ExpertPinRead.PinInfoList ← NARROW[val];
IF pinInfoList.rest = NIL THEN {
singlePinNetNumber ← singlePinNetNumber + 1;
IO.PutF[out, "%g \t%g \tpin %g \tpage %g\n", IO.rope[key], IO.rope[pinInfoList.first.refDes], IO.int[pinInfoList.first.pinNumber], IO.int[pinInfoList.first.pageNumber]];
};
};
pinTable: ExpertPinRead.PinTable;
singlePinNetNumber: CARD ← 0;
stream: IO.STREAMIO.RIS[cmd.commandLine];
name: ROPEIO.GetTokenRope[stream].token;
inputName: ROPE ← Rope.Cat[name, ".pinlist"];
outputName: ROPE ← Rope.Cat[name, ".singlepinnets"];
out: IO.STREAMFS.StreamOpen[outputName, $create];
IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]];
pinTable ← ExpertPinRead.ReadPinFile[inputName];
IO.PutF[cmd.out, "Writing %g\n", IO.rope[outputName]];
[] ← SymTab.Pairs[pinTable, PrintSinglePinNets];
IO.Close[out];
IO.PutF[cmd.out, "\nNumber of single pin nets: %g\n\n", IO.card[singlePinNetNumber]];
END;
Commander.Register[
key: "ExpertSinglePinNets", proc: ExpertSinglePinNetsProc, doc: "Read an Expert .pinlist file and generates a .singlepinnets file\n"];
END.