<> <> <> DIRECTORY CD, CDExtras, CDOps, CDPinList, CDSimpleOps, CDViewer, CMos, Commander, Dragon, IO, IFUAsm, IFUPLA, IFUPW, PLAOps, PW, IFUPWControl, REFBit, Rope, ViewerClasses, ViewerIO; IFUAsmFetchControl: CEDAR PROGRAM IMPORTS CDExtras, CDOps, CDPinList, CDSimpleOps, CDViewer, CMos, Commander, IFUAsm, IFUPW, IFUPWControl, IO, PLAOps, PW, REFBit, Rope, ViewerIO = BEGIN module: Rope.ROPE _ "IFUAsmFetchControl"; plaRoot: Rope.ROPE _ "IFUPLAFetchControl"; pinfile: Rope.ROPE _ "IFUAsmDataColumn.pins"; GenFetchControlDriverSequence: PROC[log: IO.STREAM] RETURNS[drives: REF IFUPWControl.DriveSeq] = { drivesIn: REF IFUPWControl.DriveSeq; drivesPassLtB: REF IFUPWControl.DriveSeq; drivesPassRtBA: REF IFUPWControl.DriveSeq; drivesPassRtAB: REF IFUPWControl.DriveSeq; drivesOut: REF IFUPWControl.DriveSeq _ NEW[IFUPWControl.DriveSeq[IFUPLA.FetchControlOutCount]]; passLtBRef: REF _ REFBit.NEWFromName["IFUAsm.PassLtB"]; passRtBARef: REF _ REFBit.NEWFromName["IFUAsm.PassRtBA"]; passRtABRef: REF _ REFBit.NEWFromName["IFUAsm.PassRtAB"]; pla: PLAOps.PLA; bias: INT; FOR index: INT IN [0..drivesOut.size) DO fileName: Rope.ROPE _ IO.PutFR["%g%g.ttt", IO.rope[plaRoot], IO.int[index] ]; pla _ PLAOps.ReadPLAFile[fileName, log]; drivesOut[index] _ IFUPWControl.RefToDriveSeq[ [refRec: pla.out, drDir: out, in: [neg, B], ref: [pos, B], cellType: pla, cellData: pla] ]; ENDLOOP; drivesIn _ IFUPWControl.RefToDriveSeq[ [refRec:pla.data, drDir: in, dualOut: TRUE, out: [pos, B], ref: [pos, A], cellType: conn] ]; drivesPassLtB _ IFUPWControl.RefToDriveSeq[ [refRec: passLtBRef, drDir: out, in: [pos, B], ref: [pos, B], cellType: conn] ]; drivesPassRtBA _ IFUPWControl.RefToDriveSeq[ [refRec: passRtBARef, drDir: in, out: [pos, BA], ref: [pos, B], cellType: conn] ]; drivesPassRtAB _ IFUPWControl.RefToDriveSeq[ [refRec: passRtBARef, drDir: in, out: [pos, AB], ref: [pos, A], cellType: conn] ]; drives _ NEW[IFUPWControl.DriveSeq[ drivesOut.size + drivesIn.size + drivesPassLtB.size + drivesPassRtBA.size + drivesPassRtAB.size]]; bias _ 0; FOR drive: INT IN [0..drivesOut.size) DO drives[drive + bias] _ drivesOut[drive] ENDLOOP; bias _ bias + drivesOut.size; FOR drive: INT IN [0..drivesIn.size) DO drives[drive + bias] _ drivesIn[drive] ENDLOOP; bias _ bias + drivesIn.size; FOR drive: INT IN [0..drivesPassLtB.size) DO drives[drive + bias] _ drivesPassLtB[drive] ENDLOOP; bias _ bias + drivesPassLtB.size; FOR drive: INT IN [0..drivesPassRtBA.size) DO drives[drive + bias] _ drivesPassRtBA[drive] ENDLOOP; bias _ bias + drivesPassRtBA.size; FOR drive: INT IN [0..drivesPassRtAB.size) DO drives[drive + bias] _ drivesPassRtAB[drive] ENDLOOP; log.PutF["Reading Pin File: %g\n", IO.rope[pinfile]]; IFUPWControl.AddDataPinList[CDPinList.ReadPinListsFromFile[pinfile][right], drives, log] }; FetchControlProc: IFUPW.UserProc = { -- RETURNS[ob: CD.Object] drives: REF IFUPWControl.DriveSeq; logName: Rope.ROPE _ module.Cat[".log"]; log: IO.STREAM _ ViewerIO.CreateViewerStreams[logName, NIL, logName].out; log.PutF["%g %g\n\n", IO.rope[logName], IO.time[]]; drives _ GenFetchControlDriverSequence[log]; ob _ IFUPWControl.ColFromDrives[design, drives, log]; PW.RenameObject[design, ob, module] }; FetchControl: PUBLIC IFUPW.Frame _ IFUPW.NFSFUP[module, y, LIST[ FetchControlProc ] ]; FetchControlCT: Commander.CommandProc = {IFUPW.AssembleFrame[IFUAsm.refDesign, FetchControl, cmd ] }; FetchControlCD: IFUPW.PWUserProc = {RETURN[IFUPW.FrameToObject[design, FetchControl]]}; Commander.Register [proc: FetchControlCT, key: module]; IFUPW.Register [userProc: FetchControlCD, name: module]; END.