Pad144:
PUBLIC
PROC[design: CD.Design, side:
IFUPW.Side, index:
INT, pad: IFUPW.Pad144Type, data1, data2, enable: Rope.
ROPE ←
NIL]
RETURNS[frame:
IFUPW.Frame] = {
labelFound: BOOL ← FALSE;
findLabelProc: PWPins.InstanceEnumerator ~ {
IF NOT Rope.Equal[CDPinObjects.GetName[inst], "label"] THEN RETURN[FALSE];
labelFound ← TRUE;
pos ← inst.location;
size ← inst.ob.size;
RETURN[TRUE]};
renameProc: PWPins.RenameProc ~ {
IF Rope.Find[oldRope, "vdd", 0, FALSE]#-1 THEN RETURN[oldRope];
IF Rope.Find[oldRope, "gnd", 0, FALSE]#-1 THEN RETURN[oldRope];
IF Rope.Find[oldRope, "dataOut", 0, FALSE]#-1 THEN RETURN[data2];
IF Rope.Find[oldRope, "dataIn", 0, FALSE]#-1 THEN RETURN[data1];
IF Rope.Find[oldRope, "data", 0, FALSE]#-1 THEN RETURN[data1];
IF Rope.Find[oldRope, "enable", 0, FALSE]#-1 THEN RETURN[enable];
ERROR};
pos, size: CD.Position ← [0, 0];
cell, text: CD.Object;
name: Rope.ROPE ← IF data1#NIL THEN data1 ELSE data2;
CheckPads[];
IF name#
NIL
THEN {
[ ] ← PWPins.EnumerateDeepPins[pads[pad], findLabelProc];
text ←
IF labelFound
THEN CDFrame.ScaledText[design, name, [size.x, size.y-12], IFUPW.cmosMet]
ELSE NIL};
cell ← PWPins.RenamePins[design, pads[pad], renameProc];
IF text#
NIL
THEN [] ←
PW.IncludeInCell
[cell, text, [pos.x+(size.x-text.size.x)/2, pos.y+(size.y-text.size.y)/2]];
SELECT side
FROM
top => { };
left => cell ← PW.Rot90 [design, cell];
bottom => cell ← PW.Rot180 [design, cell];
right => cell ← PW.Rot270 [design, cell];
ENDCASE => ERROR;
IF pad=ext
THEN name ← CDFrame.ID["PadExt"]
ELSE IF name=
NIL
THEN name ← IO.PutFR["Pad%g", IO.int[ Pad144FromSideIndex[side, index] ] ];
PW.RenameObject[design, cell, name];
frame ← NEW[CDFrame.FrameSeq[0]];
frame.data ← cell;
frame.shell ← CDFrame.ShellFromObject[cell]};
CheckPads:
PROC = {
IF padDesign#NIL THEN RETURN;
pads ← NEW[ARRAY IFUPW.Pad144Type OF CD.Object];
padDesign ← PW.OpenDesign["CmosPadLibraryPGA144x.dale"];
pads[ext] ← PW.Get[padDesign, "Extension"]; -- 8 lambda extension
pads[empty] ← PW.Get[padDesign, "EmptyPad"]; -- PadVdd PadGnd Vdd Gnd
pads[in] ← PW.Get[padDesign, "InputPad"]; -- data
pads[out] ← PW.Get[padDesign, "OutputPad"]; -- dataOut enWt
pads[tri] ← PW.Get[padDesign, "IOTristatePad"]; -- dataIn dataOut enWt
pads[clock] ← PW.Get[padDesign, "ClockPad"]; -- data
pads[padgnd] ← PW.Get[padDesign, "PadGndPad"]; -- Gnd
pads[padvdd] ← PW.Get[padDesign, "PadVddPad"]; -- Vdd
pads[gndcnr] ← PW.Get[padDesign, "GndCornerPad"];
pads[vddcnr] ← PW.Get[padDesign, "VddCornerPad"];
pads[gnd] ← PW.Get[padDesign, "GndPad"];
pads[vdd] ← PW.Get[padDesign, "VddPad"] };