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] };