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] };
TranslateGenericName:
PROC[cwire: CoreWire.CWire, ii:
INT, pinName:
ROPE]
RETURNS[name: ROPE←NIL] = {
sig: CoreName.SigRec ← CoreName.NameSig[pinName];
digit: INT ← IF 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]};