IFUAsmFetchControl.mesa
Copyright c 1985 by Xerox Corporation. All rights reserved.
Last Edited by Curry, October 22, 1985 9:48:39 am PDT
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.ROPEIO.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.