IFUCoreDataGPRowImpl.mesa,
Copyright c 1986 by Xerox Corporation. All rights reserved.
Last Edited by Curry, August 13, 1986 6:45:55 am PDT
DIRECTORY CD, Core, CoreFrame, CoreLibrary, CoreName, CoreWire, CoreXform, IFUCoreCells, IFUCoreData, CoreInstCell, Rope;
IFUCoreDataGPRowImpl: CEDAR PROGRAM
IMPORTS CoreFrame, CoreLibrary, CoreName, CoreWire, CoreXform, IFUCoreCells, IFUCoreData, CoreInstCell, Rope =
BEGIN
ROPE: TYPE = Core.ROPE;
Signal: SIGNAL = CODE;
ExpandDataGPRowFrame: CoreFrame.ExpandProc = { -- frameCT
specificBit: Core.CellType;
nil:    ROPE       ← CoreName.RopeNm["nil"];
data:    IFUCoreData.DpCellData ← NARROW[frameCT.data];
out0:    CoreWire.CWire    ← CoreWire.CWire[frameCT.public].f["out"].i[0];
frame:    REF CoreFrame.FrameRec ← NEW[CoreFrame.FrameRec ← [first: left]];
domain:   INT ← CoreXform.XformSize[CoreXform.GetXform[out0]];
frame.seq           ← NEW[CoreFrame.FrameSeq[domain*2]];
FOR ii: INT DECREASING IN [0..domain) DO
cwire:  CoreWire.CWire ← [frameCT.public];
renameProc: CoreInstCell.RenameProc = {new ← TranslateGenericName[cwire, ii, old]};
in0: ROPE  ← cwire.f["in"].i[0].x[ii].n;
in1: ROPE  ← cwire.f["in"].i[1].x[ii].n;
gName: ROPE ← data.type.x[ii].n;
genCell:  Core.CellType ← IF out0.x[ii].n[]#nil
THEN  IFUCoreData.ConstantInputVariant[ gName, in0, in1 ]
ELSE  CoreLibrary.Get[IFUCoreCells.library,  gName.Cat["Blank"]];
IF genCell=NIL THEN Signal[];
specificBit ← CoreInstCell.SpecificGeneric[genCell, renameProc];
frame.seq[ii*2+0] ← IFUCoreData.DpBitRoute[specificBit, genCell, cwire, ii, data.channels];
frame.seq[ii*2+1] ← CoreFrame.NewFrameCell[0, NIL, [first: left, cell: specificBit]];
ENDLOOP;
frameCT.class ← CoreFrame.frameCellClass;
frameCT.data  ← frame;
frame.cell   ← CoreFrame.RecastFrameHard[frameCT];
IFUCoreData.BlockSides[frame.cell, [frameCT.public]];
frame.seq   ← NEW[CoreFrame.FrameSeq[0]]; -- free the children
obj ← PWC.Layout[frame.cell]; -- Make sure PWC is happy with construction
CoreFrame.SetFrameExpandProc[soft, frameCT, NIL];
CoreFrame.SetFrameExpandProc[hard, frameCT, NIL] };
VDD:  ROPE ← CoreName.RopeNm["VDD"];
GND:  ROPE ← CoreName.RopeNm["GND"];
inRp:  ROPE ← CoreName.RopeNm["in"];
outRp: ROPE ← CoreName.RopeNm["out"];
ctl:  ROPE ← CoreName.RopeNm[""];
TranslateGenericName: PROC[cwire: CoreWire.CWire, ii: INT, pinName: ROPE]
RETURNS[name: ROPENIL] = {
sig: CoreName.SigRec ← CoreName.NameSig[pinName];
digit: INTIF sig.cy#-1 THEN sig.cy ELSE 0;
SELECT sig.root FROM
NIL  => RETURN[cwire.f[ "in" ].i[ digit ].x[ii].n];
inRp  => RETURN[cwire.f[ "in" ].i[ digit ].x[ii].n];
outRp  => RETURN[cwire.f[ "out" ].i[ digit ].x[ii].n];
GND  => RETURN[cwire.f[ "pwr" ].i[ 0 ].x[ii].n];
VDD  => RETURN[cwire.f[ "pwr" ].i[ 1 ].x[ii].n];
ctl   => {
IF name = NIL THEN name ← cwire.f[ "left"  ].i[ digit ].x[ii].n;
IF name = NIL THEN name ← cwire.f[ "right" ].i[ digit ].x[ii].n;
IF name=NIL THEN Signal[]; RETURN[name]};
ENDCASE => Signal[]; RETURN[name]};
IFUCoreData.RegisterSubClassExpand [hard, "GPRow", ExpandDataGPRowFrame];
IFUCoreData.RegisterSubClassExpand [soft, "GPRow", ExpandDataGPRowFrame];
END.