DIRECTORY Commander USING [CommandProc, Register], Rope USING [Cat, Equal, ROPE], FS USING [StreamOpen], IO USING [card, Close, EndOfStream, Error, GetInt, GetLineRope, GetTokenRope, int, PutF, RIS, rope, STREAM]; Plcc84: CEDAR PROGRAM IMPORTS IO, Commander, Rope, FS = BEGIN ROPE: TYPE = Rope.ROPE; Pin: TYPE = RECORD [ pinName: ROPE, pinSite: NAT, pinType: ROPE, pinSwap: NAT ]; PLCCPinsRep: TYPE = ARRAY[1..pLCCSize] OF Pin; PLCCPins: TYPE = REF PLCCPinsRep; pLCCSize: INT ~ 84; pin1Pad: INT ~ 28; standardPad: INT ~ 29; diameter: INT ~ 1; -- Max diameter of the lead in mills BadFile: SIGNAL []; InsertPin: PROC [i: INT, pLCCPins: PLCCPins, out: IO.STREAM] ~ { x, y, type, pad: INT; SELECT TRUE FROM Rope.Equal [pLCCPins[i].pinType, "U", FALSE] => type _ 0; Rope.Equal [pLCCPins[i].pinType, "I", FALSE] => type _ 1; Rope.Equal [pLCCPins[i].pinType, "O", FALSE] => type _ 2; Rope.Equal [pLCCPins[i].pinType, "D", FALSE] => type _ 3; Rope.Equal [pLCCPins[i].pinType, "P", FALSE] => type _ 4; Rope.Equal [pLCCPins[i].pinType, "G", FALSE] => type _ 5; ENDCASE => ERROR; IF i = 1 THEN pad _ pin1Pad ELSE pad _ standardPad; SELECT i FROM IN [1..11] => {x _ (1-i)*50; y _ 0;}; IN [12..32] => {x _ -575; y _ 75 + (i-12)*50;}; IN [33..53] => {x _ -500 + (i-33)*50; y _ 1150;}; IN [54..74] => {x _ 575; y _ 1075 - (i-54)*50;}; IN [75..84] => {x _ 500 - (i-75)*50; y _ 0;}; ENDCASE => ERROR; IO.PutF[out, "%g %g ", IO.int[x], IO.int[y]]; IO.PutF[out, "%g %g ", IO.rope[pLCCPins[i].pinName], IO.int[pLCCPins[i].pinSwap]]; IO.PutF[out, "%g %g ", IO.int[diameter], IO.int[pLCCPins[i].pinSite]]; IO.PutF[out, "%g %g\n", IO.int[type], IO.int[pad]]; }; GetLine: PROC [i: CARD, pLCCPins: PLCCPins, in, display: IO.STREAM, fileName: ROPE] ~ { type, firstToken: ROPE; firstToken _ IO.GetTokenRope[in ! IO.EndOfStream => CONTINUE].token; IF firstToken = NIL THEN { IO.PutF[display, "File %g is too short: line %g is missing or incomplete.\n", IO.rope[fileName], IO.card[i]]; SIGNAL BadFile[]; }; pLCCPins[i].pinName _ firstToken; IF Rope.Equal[firstToken, "VCC", FALSE] OR Rope.Equal[firstToken, "VDD", FALSE]THEN { pLCCPins[i].pinSite _ 0; -- Site 0 = site 256 type _ "P"; -- Power pLCCPins[i].pinSwap _ 1; } ELSE IF Rope.Equal[firstToken, "GND", FALSE] OR Rope.Equal[firstToken, "VSS", FALSE] THEN { pLCCPins[i].pinSite _ 0; -- Site 0 = site 256 type _ "G"; -- Ground pLCCPins[i].pinSwap _ 1; } ELSE IF Rope.Equal[firstToken, "NC", FALSE] THEN { pLCCPins[i].pinSite _ 0; -- Site 0 = site 256 type _ "U"; -- Undefined pLCCPins[i].pinSwap _ 1; } ELSE { pLCCPins[i].pinSite _ 1; type _ IO.GetTokenRope[in ! IO.EndOfStream => CONTINUE].token; pLCCPins[i].pinSwap _ IO.GetInt[in ! IO.Error => { IO.PutF[display, "File %g has not the right format: line %g the swap code number should be an integer.\n", IO.rope[fileName], IO.card[i]]; SIGNAL BadFile[]; CONTINUE;}]; }; pLCCPins[i].pinType _ type; IF NOT Rope.Equal[type, "U", FALSE] AND NOT Rope.Equal[type, "I", FALSE] AND NOT Rope.Equal[type, "O", FALSE] AND NOT Rope.Equal[type, "D",FALSE] AND NOT Rope.Equal[type, "P", FALSE] AND NOT Rope.Equal[type, "G", FALSE] THEN { IO.PutF[display, "File %g has not the right format: line %g the pin type should be I, O, or D instead of %g.\n", IO.rope[fileName], IO.card[i], IO.rope[type]]; SIGNAL BadFile[]; }; [] _ IO.GetLineRope[in ! IO.EndOfStream => CONTINUE]; -- flush the end of the line }; Plcc84Proc: Commander.CommandProc = BEGIN i: INT; in: IO.STREAM; out: IO.STREAM; tiogaFileName: ROPE; fault: NAT _ 0; fileName: ROPE _ IO.GetTokenRope[IO.RIS[cmd.commandLine]].token; pLCCPins: PLCCPins _ NEW[PLCCPinsRep]; tiogaFileName _ Rope.Cat[fileName,".tioga"]; in _ FS.StreamOpen[tiogaFileName]; FOR i IN [1..pLCCSize] DO GetLine[i, pLCCPins, in, cmd.out, tiogaFileName! BadFile => { fault _ fault + 1; CONTINUE; }]; IF fault > 5 THEN {IO.PutF[cmd.out, "I give up ...\n"];EXIT;}; ENDLOOP; IF fault = 0 THEN { out _ FS.StreamOpen[Rope.Cat[fileName,".part"],$create]; IO.PutF[out, "4096 2048 -100 -100 1500 1500 700 -100 %g84 PARC-%g84 U\n", IO.rope[fileName], IO.rope[fileName]]; FOR i IN [1..pLCCSize] DO InsertPin[i, pLCCPins, out]; ENDLOOP; IO.Close[out]; IO.PutF[cmd.out, "File %g.part Written\n", IO.rope[fileName]]; }; END; Commander.Register[ key: "Plcc84", proc: Plcc84Proc, doc: "Transform the input file: \tFilename.tioga into: \n\t\tFilename.part (to be used by the NewPart program)."]; END. File: Plcc84.mesa Christophe Cuenod March 23, 1989 10:28:24 am PST Enables to generate 84 pins PLCC parts (NCR53C94...) for EXPERT. Requires 1 input file: Filename.tioga and generates file Filename.part (to be transformed by the NewPart program). The file Filename.tioga has one line per pin. It must be exactly 84 non empty lines long. The correct line formats are: - PinName PinType (I, O, D, ...) and SwapNumber. (i.e. A0 O 0) - PinName (if VCC or GND) Reading Input file: Writing output file Κδprogram–i(firstHeadersAfterPage) {1} .cvx .def (firstPageNumber) {1} .cvx .def (oneSidedFormat) {.false} .cvx .def– "Cedar" style˜– "Cedar" stylešΟnœ ™Kšœ0™0KšœΟkœžœ žœ™AK™šœF™FKšœ+™+—K™Kšœ-™-Kšœ+™+šœ™Kšœ8žœ™AKšœžœžœ™—K™—šž ˜ Kšœ žœ˜(Kšœžœžœ˜Kšžœžœ˜KšžœžœQžœžœ˜l—K˜šœžœž˜Kšžœžœžœ˜"—Kšž˜Kšžœžœžœ˜šœžœžœ˜Kšœ žœ˜Kšœ žœ˜ Kšœ žœ˜Kšœ ž˜ K˜—Kšœ žœžœžœ˜.Kšœ žœžœ ˜!Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœ žœΟc$˜7K˜Icodešœžœ˜L˜š  œžœžœžœžœ˜AKšœžœ˜šžœžœž˜Kšœ&žœ˜9Kšœ&žœ˜9Kšœ&žœ˜9Kšœ&žœ˜9Kšœ&žœ˜9Kšœ&žœ˜9Kšžœžœ˜—Kšžœžœ˜Kšžœ˜K˜šžœž˜ Kšžœ#˜%Kšžœ-˜/Kšžœ/˜1Kšžœ.˜0Kšžœ+˜-Kšžœžœ˜—K˜K˜Kšžœžœ žœ ˜-Kšžœžœžœ˜RKšžœžœžœ˜FKšžœžœ žœ ˜3K˜—K˜š œžœžœ#žœžœ žœ˜WLšœžœ˜Lšœ žœžœžœ˜Dšžœžœžœ˜LšžœLžœžœ ˜mLšžœ ˜L˜—Lšœ!˜!š žœžœžœžœžœ˜UKšœŸ˜.Kšœ Ÿ˜Kšœ˜K˜—š žœžœžœžœžœžœ˜[KšœŸ˜.Kšœ Ÿ ˜Kšœ˜K˜—šžœžœžœžœ˜2KšœŸ˜.Kšœ Ÿ ˜Kšœ˜K˜—šžœ˜Kšœ˜Kšœžœžœžœ˜>šœžœ žœ ˜2Lšžœjžœžœ ˜‹Lšžœ ˜Lšžœ˜ —L˜—Kšœ˜š&žœžœžœžœžœžœžœžœžœžœžœžœžœžœžœžœžœžœžœ˜βLšžœožœžœ žœ ˜ŸLšžœ ˜L˜—L˜LšœžœžœžœŸ˜RL˜—š œž˜)Kšœžœ˜Kšœžœžœ˜Kšœžœžœ˜Jšœžœ˜Jšœžœ˜Kš œ žœžœžœžœ˜@Kšœžœ˜&K™K™K˜Kšœ,˜,Kšœžœ˜"šžœžœž˜šœ=˜=Jšœ˜Jšžœ˜ Jšœ˜—Kšžœ žœžœ"žœ˜>Kšžœ˜—K˜šžœ žœ˜K™K™K™Kšœžœ0˜8K˜KšžœHžœžœ˜pšžœžœž˜Kšœ˜Kšžœ˜—Kšžœ ˜Kšžœ+žœ˜@K˜—Kšžœ˜—šœ˜Kšœ”˜”—Kšžœ˜—…—4