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 =
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.STREAM ← IO.RIS[cmd.commandLine];
name: ROPE ← IO.GetTokenRope[stream].token;
inputName: ROPE ← Rope.Cat[name, ".pinlist"];
outputName: ROPE ← Rope.Cat[name, ".singlepinnets"];
out: IO.STREAM ← FS.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"];