CMosBObsImpl.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created Christian Jacobi, March 22, 1985 11:09:09 am PST
gbb May 30, 1986 12:37:21 pm PDT
Last edited by: Christian Jacobi, December 15, 1986 7:13:37 pm PST
DIRECTORY
CD,
CDAtomicObjects,
CDBasics,
CDOps,
CDStretchyBackdoor,
CMosB,
Rope;
CMosBObsImpl:
CEDAR
PROGRAM
IMPORTS CD, CDAtomicObjects, CDBasics, CDOps, CDStretchyBackdoor, CMosB, Rope =
BEGIN
lambda: CD.Number = CMosB.lambda;
wellSurround: CD.Number = CMosB.wellSurround;
-- straight transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MatchTrans:
PROC [me:
CD.Object, r:
CD.Rect, layer:
CD.Layer, prim:
BOOL, horz:
BOOL]
RETURNS [
BOOL] = {
--poly, dif, welldif, via
-- Don't care about different diffusions and such
RETURN [layer=me.layer OR layer=CMosB.pol]
};
wellTransClass: CD.ObjectClass;
transClass: CD.ObjectClass;
FillTransistor:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
dExt: CD.Number = 3*lambda;
pExt: CD.Number = 2*lambda;
dif: CD.Layer;
inr: CD.Rect ← ob.bbox;
inr.x2 ← MAX[inr.x2, 2*lambda+2*pExt];
inr.y2 ← MAX[inr.y2, 2*lambda+2*dExt];
IF ob.layer=CMosB.wpdif
OR ob.layer=CMosB.wndif
THEN {
ob.class ← wellTransClass;
IF ob.layer=CMosB.wpdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1-wellSurround+pExt,
x2: inr.x2+wellSurround-pExt,
y1: inr.y1-wellSurround,
y2: inr.y2+wellSurround],
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
}
ELSE {
IF ob.layer=CMosB.pdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
};
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1+pExt,
x2: inr.x2-pExt,
y1: inr.y1,
y2: inr.y2],
layer: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1+dExt,
y2: inr.y2-dExt],
layer: CMosB.pol
];
};
DescribeT:
PROC[me:
CD.Object]
RETURNS [Rope.
ROPE] = {
dExt: CD.Number = 3*lambda;
pExt: CD.Number = 2*lambda;
sz: CD.Position = CD.InterestSize[me];
RETURN [
Rope.Cat[
"transistor ",
CDOps.LayerRope[me.layer],
Rope.Cat[" [",
CDOps.LambdaRope[sz.x-2*pExt, lambda],
CDOps.LambdaRope[sz.y-2*dExt, lambda],
"]"]
]
]
};
-- L transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
lTransClass: CD.ObjectClass;
wellLTransClass: CD.ObjectClass;
oldBadWellLTransClass: CD.ObjectClass;
OldBadFillLTransistor:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
ob.class ← lTransClass;
RETURN [FillLTransistor[ob]]
};
FillLTransistor:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
pExt: CD.Number = 2*lambda; --poly extends gate
dExt: CD.Number = 3*lambda; --diffusion extends gate
dW: CD.Number = 2*lambda; --witdth of diffusion in gate (not width of gate)
pW: CD.Number = 2*lambda; --witdth of poly in gate (not width of gate)
minSz: CD.Number = pExt+2*dExt+dW;
dif: CD.Layer;
inr: CD.Rect ← ob.bbox;
inr.x2 ← MAX[inr.x2, minSz];
inr.y2 ← MAX[inr.y2, minSz];
ob.bbox ← inr;
IF ob.layer=CMosB.wpdif
OR ob.layer=CMosB.wndif
THEN {
wR: CD.Rect;
ob.class ← wellLTransClass;
IF ob.layer=CMosB.wpdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
--horizontal piece of nwell
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1-wellSurround+pExt,
x2: inr.x2+wellSurround,
y1: inr.y1-wellSurround ,
y2: inr.y1+wellSurround+dW+2*dExt],
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
--vertical piece of nwell if ~empty
wR ← [x1: inr.x2-(dW+2*dExt)-wellSurround,
x2: inr.x2+wellSurround,
y1: inr.y1+wellSurround+dW+2*dExt,
y2: inr.y2+wellSurround-pExt];
IF CDBasics.NonEmpty[wR]
THEN
CDAtomicObjects.Incorporate[ob: ob,
r: wR,
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
}
ELSE {
IF ob.layer=CMosB.pdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
};
--horizontal piece of diff
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1+pExt,
x2: inr.x2,
y1: inr.y1,
y2: 2*dExt+dW],
layer: dif
];
--vertical piece of diff
IF 2*dExt+dW < inr.y2-pExt
THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x2-2*dExt-dW,
x2: inr.x2,
y1: 2*dExt+dW,
y2: inr.y2-pExt ],
layer: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2-dExt,
y1: dExt,
y2: dExt+pW],
layer: CMosB.pol
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x2-pW-dExt,
x2: inr.x2-dExt,
y1: inr.y1+pW+dExt,
y2: inr.y2],
layer: CMosB.pol
];
};
-- simple contacts -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
simpleContactClass: CD.ObjectClass;
wellSimpleContactClass: CD.ObjectClass;
largeContactClass: CD.ObjectClass;
wellLargeContactClass: CD.ObjectClass;
FillSimpleCon:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
rimW: CD.Number ~ lambda; -- therefore NOT large
dif: CD.Layer;
inr: CD.Rect ← [0, 0, 2*lambda+2*rimW, 2*lambda+2*rimW];
IF ob.layer=CMosB.wpdif
OR ob.layer=CMosB.wndif
THEN {
ob.class ← wellSimpleContactClass;
dif ← (IF ob.layer=CMosB.wpdif THEN CMosB.pdif ELSE CMosB.ndif);
CDAtomicObjects.Incorporate[ob: ob,
r: CDBasics.Extend[inr, wellSurround],
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
}
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: dif];
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob, r: CDBasics.Extend[inr, -rimW], layer: CMosB.cut];
};
FillLargeSimpleCon:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
rimW: CD.Number = 2*lambda; -- therefore large
dif: CD.Layer;
inr: CD.Rect ← ob.bbox;
inr.x2 ← MAX[inr.x2, 2*lambda+2*rimW];
inr.y2 ← MAX[inr.y2, 2*lambda+2*rimW];
IF ob.layer=CMosB.wpdif
OR ob.layer=CMosB.wndif
THEN {
ob.class ← wellLargeContactClass;
dif ← (IF ob.layer=CMosB.wpdif THEN CMosB.pdif ELSE CMosB.ndif);
CDAtomicObjects.Incorporate[ob: ob,
r: CDBasics.Extend[inr, wellSurround],
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
}
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: dif];
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob, r: CDBasics.Extend[inr, -rimW], layer: CMosB.cut];
};
DescribeC:
PROC[me:
CD.Object]
RETURNS [Rope.
ROPE] = {
RETURN [Rope.Cat["contact ", CDOps.LayerRope[me.layer]]]
};
DescribeLargeC:
PROC[me:
CD.Object]
RETURNS [Rope.
ROPE] = {
RETURN [Rope.Cat["large contact ", CDOps.LayerRope[me.layer]]]
};
-- DifShort -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
wellDifShortContactClass: CD.ObjectClass;
FillDifShortCon:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
dif: CD.Layer;
inr: CD.Rect;
innerW: CD.Number = 4*lambda;
innerH: CD.Number = 8*lambda;
h: CD.Number = innerH/2;
inr ← [x1: 0, y1: 0, x2: innerW, y2: innerH];
IF ob.layer=CMosB.wpdif
OR ob.layer=CMosB.wndif
THEN {
ob.class ← wellDifShortContactClass;
IF ob.layer=CMosB.wpdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
CDAtomicObjects.Incorporate[ob: ob,
r: [-wellSurround, -wellSurround, innerW+wellSurround, innerH+wellSurround-h],
layer: (IF dif=CMosB.pdif THEN CMosB.nwell ELSE CMosB.pwell),
inside: FALSE
];
}
ELSE {
IF ob.layer=CMosB.pdif THEN dif ← CMosB.pdif ELSE dif ← CMosB.ndif;
};
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1,
y2: inr.y1+h],
layer: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1+h,
y2: inr.y2],
layer: (IF dif=CMosB.pdif THEN CMosB.nwellCont ELSE CMosB.pwellCont)
];
CDAtomicObjects.Incorporate[ob: ob, r: CDBasics.Extend[inr, -lambda], layer: CMosB.cut];
};
--via -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
FillVia:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
viaRimWidth: CD.Number = lambda;
cut2min: CD.Number = 2*lambda;
ob.bbox ← [0, 0, cut2min+2*viaRimWidth, cut2min+2*viaRimWidth];
ob.layer ← CMosB.met2;
CDAtomicObjects.Incorporate[ob: ob, r: ob.bbox, layer: CMosB.met2];
CDAtomicObjects.Incorporate[ob: ob, r: ob.bbox, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: viaRimWidth,
x2: cut2min+viaRimWidth,
y1: viaRimWidth,
y2: cut2min+viaRimWidth],
layer: CMosB.cut2
];
};
FillLargeVia:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] = {
viaRimWidth: CD.Number = 2*lambda;
cut2min: CD.Number = 2*lambda;
ob.bbox.x2 ← MAX[ob.bbox.x2, cut2min+2*viaRimWidth];
ob.bbox.y2 ← MAX[ob.bbox.y2, cut2min+2*viaRimWidth];
ob.layer ← CMosB.met2;
CDAtomicObjects.Incorporate[ob: ob, r: ob.bbox, layer: CMosB.met2];
CDAtomicObjects.Incorporate[ob: ob, r: ob.bbox, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: viaRimWidth,
x2: ob.bbox.x2-viaRimWidth,
y1: viaRimWidth,
y2: ob.bbox.y2-viaRimWidth],
layer: CMosB.cut2
];
};
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MatchSimpleCon:
PROC [me:
CD.Object, r:
CD.Rect, layer:
CD.Layer, prim:
BOOL, horz:
BOOL]
RETURNS [
BOOL] = {
--poly, dif, welldif, via
-- Don't care about different diffusions and such
RETURN [layer=me.layer OR layer=CMosB.met]
};
Init:
PROC [] = {
Register:
PROC [key:
ATOM, creator: CDAtomicObjects.FillObjectProc, desc: Rope.
ROPE, match: CDStretchyBackdoor.MatchProc←
NIL]
RETURNS [p:
CD.ObjectClass] = {
p ← CDAtomicObjects.RegisterAtomicObClass[key, creator, desc, CMosB.cmosB];
IF p=NIL THEN ERROR;
IF match=NIL THEN match ← MatchSimpleCon;
CDStretchyBackdoor.InstallMatchProc[p, match];
};
--transistors
transClass ← Register[$C2Trans, FillTransistor, "transistor", MatchTrans];
transClass.describe ← DescribeT;
wellTransClass ← Register[$C2WellTrans, FillTransistor, "transistor", MatchTrans];
wellTransClass.describe ← DescribeT;
lTransClass ← Register[$C2LTrans, FillLTransistor, "L-transistor", MatchTrans];
oldBadWellLTransClass ← Register[$CLWellTrans, OldBadFillLTransistor, "L-transistor", MatchTrans];
wellLTransClass ← Register[$C2LWellTrans, FillLTransistor, "L-transistor", MatchTrans];
--contacts
simpleContactClass ← Register[$C2SimpleCon, FillSimpleCon, "contact"];
simpleContactClass.describe ← DescribeC;
wellSimpleContactClass ← Register[$C2WellSimpleCon, FillSimpleCon, "contact"];
wellSimpleContactClass.describe ← DescribeC;
largeContactClass ← Register[$C2LargeSimpleCon, FillLargeSimpleCon, "large contact"];
largeContactClass.describe ← DescribeLargeC;
wellLargeContactClass ← Register[$C2LargeWellSimpleCon, FillLargeSimpleCon, "large contact"];
wellLargeContactClass.describe ← DescribeLargeC;
[] ← Register[$C2DifShortCon, FillDifShortCon, "dif short contact"];
wellDifShortContactClass ← Register[$C2WellDifShortCon, FillDifShortCon, "dif short contact"];
[] ← Register[$C2Via, FillVia, "via"];
[] ← Register[$C2LargeVia, FillLargeVia, "large via"];
};
Init[];
END.