IFUPWGPCell.mesa,
Copyright c 1985 by Xerox Corporation. All rights reserved.
Last Edited by Curry, November 26, 1985 5:43:28 pm PST
DIRECTORY
Basics,
CD,
CDDirectory,
IFUPW,
IO,
PW;
IFUPWGPCell: CEDAR PROGRAM
IMPORTS CD, CDDirectory, IFUPW, IO, PW
EXPORTS IFUPW =
BEGIN OPEN IFUPW;
IFUGPCellRow: PUBLIC PROC [
design: CD.Design,
name:  PW.ROPE,
leftCtl: List,
rightCtl: List,
type:  LIST OF REF,
top:  LIST OF REF,
in:   LIST OF REF,
out:  LIST OF REF,
bot:  LIST OF REF,
rp:   RowParams ← IFUDataColNSeq ]
RETURNS [cell: CD.Object] = {
cells: PW.ListOb;
FOR ii: INT DECREASING IN [0..rp.rngByte*rp.rngBit) DO
byte, index: INT;
[byte, index] ← IFUPW.ByteBitFromIndex[ii, rp];
cells ← CONS[ GPCell[
design: design,
type:  ExpandList[byte, index, type],
top:  ExpandList[byte, index, top],
in:   ExpandList[byte, index, in],
out:  ExpandList[byte, index, out],
bot:  ExpandList[byte, index, bot]], cells];
ENDLOOP;
cell ← PW.AbutListX[design, cells];
cell ← IFUPW.RenameObjAndAssignRowPins
[design, cell, name, FALSE, top, bot, leftCtl, rightCtl, rp];
RETURN[cell]};
GPCell: PUBLIC PROC [
design: CD.Design,
type:   List,
top:  List,
in:   List,
out:  List,
bot:  List ]
RETURNS [cell: CD.Object] = {
cellName: PW.ROPE;
found: BOOL;
topY: INT ← 0;
typeObj: CD.Object ← CDDirectory.Fetch[design, type.first].object;
delBody: BOOL ← ListLength[out]=0 OR out.first=NIL;
IF delBody THEN in ← out ← NIL;
top ← FixGVInList[top];
bot ← FixGVInList[bot];
cellName ← UniqueCellName[type.first, top, bot, in, out];
[found, cell] ← CDDirectory.Fetch[design, cellName];
IF found THEN RETURN[cell];
log.PutRope["."];
cell ← PW.Inst[
design:   design,
ob:    typeObj,
conds:    (IF delBody THEN LIST["Body"] ELSE NIL),
removeNamed: TRUE];
topY ← CD.InterestSize[cell].y;
IOConnect[design, cell, top, in, out, bot, cell, 0, 0, topY, 0 ];
IFUPW.AddMetalPins[cell, top, bot, 0, topY, 0, FALSE];
PW.RenameObject[design, cell, cellName];
RETURN[cell] };
NandTest: PROC[design: CD.Design] RETURNS[cell: CD.Object] = {
cell ← GPCell[
enable: NIL,
disable: NIL,
type:  LIST["GPNand"],
top:  LIST["A", "B", NIL, "D"],
in1:  LIST["A"],
in2:  LIST["B"],
out:  LIST["C"],
bot:  LIST[NIL, "C", NIL, "D"],
design: design ] };
LatchTest: PROC[design: CD.Design] RETURNS[cell: CD.Object] = {
cell ← GPCell[
enable: "En",
disable: "VBB",
type:  LIST["GPLatch"],
top:  LIST[NIL, "C", NIL, "D"],
in1:  LIST["A"],
in2:  NIL,
out:  LIST["D"],
bot:  LIST["A", "C", NIL, "D"],
design: design ] };
END.