DIRECTORY Atom, CD, Commander, CommandTool, Core, CoreFrame, CoreGlue, CoreName, CoreXform, DragOpsCross, IFUCoreData, IFUSrc, IO, PW, PWC, Process, Rope; IFUSrcImpl: CEDAR PROGRAM IMPORTS Commander, CommandTool, CoreFrame, CoreGlue, CoreName, CoreXform, IFUCoreData, IFUSrc, IO, PW, PWC, Process, Rope EXPORTS IFUSrc = BEGIN ROPE: TYPE = Core.ROPE; Rollback: PUBLIC SIGNAL[name: ROPE] = CODE; ifuContext: PUBLIC CoreName.Context _ CoreName.NewContext[]; dShIn: PUBLIC ROPE _ CoreName.RopeNm["DShIn"]; dShLeftOut: PUBLIC ROPE _ CoreName.RopeNm["DShLeftOut"]; dShRightOut: PUBLIC ROPE _ CoreName.RopeNm["DShRightOut"]; dShOut: PUBLIC ROPE _ CoreName.RopeNm["DShOut"]; ProcRegToList: PUBLIC PROC [reg: DragOpsCross.ProcessorRegister] RETURNS[LIST OF REF] = {val: CARDINAL _ LOOPHOLE[reg]; RETURN[CardToList[val, 8]]}; CardToList: PUBLIC PROC [val, size: CARDINAL] RETURNS[new: LIST OF REF] = { new _ NIL; THROUGH [0..size) DO new _ CONS[(IF (val MOD 2)=1 THEN "VDD" ELSE "GND"), new]; val _ val/2; ENDLOOP}; TestSwitching: PROC RETURNS[cellType: Core.CellType] = { cellType _ IFUCoreData.CellProc[ subClass: "SwitchBox", name: "TestSwitching", top: "(A.)", bot: "(NIL A.)", xform: CoreXform.GenXform[LIST[ [2, 0] ]] ]}; TranslateCellName: PROC[name: ROPE] RETURNS[cell: Core.CellType] = { cell _ SELECT CoreName.RopeNm[name] FROM CoreName.RopeNm[ "Complete" ] => IFUSrc.Complete[], CoreName.RopeNm[ "PadTop" ] => IFUSrc.PadTop[], CoreName.RopeNm[ "PadHeart" ] => IFUSrc.PadHeart[], CoreName.RopeNm[ "PadBot" ] => IFUSrc.PadBot[], CoreName.RopeNm[ "PadLt" ] => IFUSrc.PadLt[], CoreName.RopeNm[ "Heart" ] => IFUSrc.Heart[], CoreName.RopeNm[ "PadRt" ] => IFUSrc.PadRt[], CoreName.RopeNm[ "LeftColumn" ] => IFUSrc.LeftColumn[], CoreName.RopeNm[ "DataColumn" ] => IFUSrc.DataColumn[], CoreName.RopeNm[ "RightColumn" ] => IFUSrc.RightColumn[], CoreName.RopeNm[ "FetchIndexing" ] => IFUSrc.FetchIndexing[], CoreName.RopeNm[ "FetchControler" ] => IFUSrc.FetchControler ["testing", dShLeftOut].cellType, CoreName.RopeNm[ "LtDrPadIO" ] => IFUSrc.LtDrPadIO["testing"].cellType, CoreName.RopeNm[ "StackControler" ] => IFUSrc.StackControler["testing"].cellType, CoreName.RopeNm[ "Interlock" ] => IFUSrc.Interlock[dShIn].cellType, CoreName.RopeNm[ "MainPipeControl" ] => IFUSrc.MainPipeControl["testing"].cellType, CoreName.RopeNm[ "StackIndexing" ] => IFUSrc.StackIndexing[], CoreName.RopeNm[ "InstrDecode" ] => IFUSrc.InstrDecode ["testing", dShRightOut].cellType, CoreName.RopeNm[ "RtDrPadIO" ] => IFUSrc.RtDrPadIO[dShLeftOut].cellType, CoreName.RopeNm[ "Fetch" ] => IFUSrc.Fetch[], CoreName.RopeNm[ "FetchBuf" ] => IFUSrc.FetchBuf[], CoreName.RopeNm[ "XaForm" ] => IFUSrc.XaForm[], CoreName.RopeNm[ "PCFormTop" ] => IFUSrc.PCFormTop[], CoreName.RopeNm[ "PCFormBot" ] => IFUSrc.PCFormBot[], CoreName.RopeNm[ "StackBuf" ] => IFUSrc.StackBuf[], CoreName.RopeNm[ "LSForm" ] => IFUSrc.LSForm[], CoreName.RopeNm[ "ABForm" ] => IFUSrc.ABForm[], CoreName.RopeNm[ "ControlPipe" ] => IFUSrc.ControlPipe[], ENDCASE => NIL}; ifuBotPadRoute: ROPE _ CoreName.RopeNm["IFUBotPadRoute"]; IFUBuildRun: Commander.CommandProc = { AppendListItemsToLine: PROC[lst: LIST OF ROPE, line: ROPE _ NIL] RETURNS[ROPE] = { FOR lst _ lst, lst.rest WHILE lst#NIL DO line _ Rope.Cat[line, " ", lst.first] ENDLOOP; RETURN[line]}; RollBackBuild: PROC[lst: LIST OF ROPE] = { -- you will never get out of here alive line: ROPE _ AppendListItemsToLine[lst, "RollBackAnd IFUPack; IFUBuild "]; log.Close[]; [ ] _ CommandTool.DoCommand[line, cmd]}; log: IO.STREAM _ CoreFrame.GetLog[]; list: LIST OF ROPE _ CommandTool.ParseToList[cmd].list; Process.SetPriority[Process.priorityBackground]; DO ENABLE { IFUSrc.Rollback => { SELECT CoreName.RopeNm[name] FROM ENDCASE => GOTO RollBackAndRepeat}; CoreGlue.RouteCheckPointWritten => { SELECT CoreName.RopeNm[name] FROM ifuBotPadRoute => GOTO RollBackAndRepeat; ENDCASE => RESUME} }; cell: Core.CellType _ NIL; IF list=NIL THEN GOTO Done; IF Rope.Equal[list.first, "RB", FALSE] THEN RollBackBuild[list.rest]; IF Rope.Equal[list.first, "FINISH", FALSE] THEN { [ ] _ CommandTool.DoCommand[AppendListItemsToLine[list.rest], cmd]; GOTO Done}; cell _ TranslateCellName[ list.first]; IF cell=NIL THEN cmd.err.PutF["Unknown name: %g\n", IO.rope[list.first]]; list _ list.rest; REPEAT Done => {log.Close[]; RETURN[$Done, "\nIFUBuild Complete\n"]}; RollBackAndRepeat => {log.PutRope["\n *** RollbackAnd REPEAT ***\n"]; RollBackBuild[list]} ENDLOOP}; IFUPlotRun: Commander.CommandProc = { cell: Core.CellType _ NIL; line: ROPE _ "RollBackAnd IFUPlot"; list: LIST OF ROPE _ CommandTool.ParseToList[cmd].list; FOR list _ list, list.rest WHILE list#NIL DO [ ] _ CommandTool.DoCommand[IO.PutFR ["CDPlot -n /Indigo/Dragon/IFUModules/%g.dale", IO.rope[list.first]], cmd]; [ ] _ CommandTool.DoCommand[IO.PutFR ["Copy /Indigo/Dragon/IFUModules/%g.pd _ PD/Plot1.pd", IO.rope[list.first]], cmd]; [ ] _ CommandTool.DoCommand[IO.PutFR ["PeachPrint -n /Indigo/Dragon/IFUModules/%g.pd", IO.rope[list.first]], cmd]; ENDLOOP; RETURN[$Done, "\nIFUPlot Complete\n"]}; RunCTSoft: Commander.CommandProc = { log: IO.STREAM _ CoreFrame.GetLog[]; nofArgs: INT _ CommandTool.NumArgs[cmd]; top: Core.CellType _ NIL; recCell: Core.CellType _ NIL; obj: CD.Object _ NIL; cleanUp: BOOL _ FALSE; status: CoreGlue.Status; build: LIST OF ROPE; list: LIST OF ROPE; comlist: LIST OF ROPE _ CommandTool.ParseToList[cmd].list; FOR list _ comlist, list.rest WHILE list#NIL DO Next: PROC RETURNS[next: ROPE] = {IF list.rest=NIL THEN ERROR; list _ list.rest; next _ list.first}; SELECT list.first.Fetch[0] FROM '- => SELECT list.first.Fetch[1] FROM 'B, 'b => build _ CONS[Next[], build]; 'C, 'c => cleanUp _ TRUE; ENDCASE; ENDCASE => build _ CONS[list.first, build]; ENDLOOP; top _ IFUSrc.ABForm[]; CoreFrame.Expand[hard, top]; status _ CoreGlue.RouteHard[top]; IF status#complete2 THEN Signal[]; obj _ PWC.Layout[top]; [] _ PW.Draw[obj] }; Signal: SIGNAL = CODE; Commander.Register[proc: IFUBuildRun, key: "IFUBuild"]; Commander.Register[proc: IFUPlotRun, key: "IFUPlot"]; Commander.Register[proc: RunCTSoft, key: "IFUSrc"]; Process.SetPriority[Process.priorityBackground] END. –IFUSrcImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last Edited by Curry, October 10, 1986 8:30:16 am PDT Don Curry November 2, 1986 9:21:54 pm PST IF build.rest # NIL THEN RETURN [$Failure, "\nWhat did you hope to accomplish with multiple frame names?\n"]; IF build.first=NIL THEN build _ CONS["Complete", build]; top _ NARROW[Atom.GetProp[$IFUFrames, build.first]]; top _ IFUSrc.FetchControler[]; top _ TestSwitching[]; IF status#complete2 THEN RETURN[$Failure, "Routing Errors"]; IF CoreConnect.Connect[top]#TRUE THEN RETURN[$Failure, "Connection Errors"]; top _ CoreOps.Recast[top]; CoreOps.PrintCellType[top, log]; }; ΚŽ˜šœ™Jšœ<™