<> <> <<>> <> 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.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"]; END.