CMosBPolyObjectsImpl.mesa
Copyright © 1983, 1987 by Xerox Corporation. All rights reserved.
Stolen from Christian Jacobi, May 3, 1983 11:22 am
Last edited by: Louis Monier, November 7, 1988 11:27:15 am PST
DIRECTORY
CMosB,
CMosBPolyObjects,
CD,
CDAtomicObjects,
CDBasics,
CDLayers,
CDOps,
CDProperties,
CDStretchyBackdoor,
Rope,
SinixOps;
CMosBPolyObjectsImpl: CEDAR PROGRAM
IMPORTS CD, CDAtomicObjects, CDBasics, CDLayers, CDOps, CDProperties, CDStretchyBackdoor, CMosB, Rope, SinixOps
EXPORTS CMosBPolyObjects =
BEGIN
lambda: CD.Number = CMosB.lambda;
wellSurround: CD.Number = CMosB.wellSurround;
--Client stuff
SDiff: PROC [l: CD.Layer] RETURNS [CD.Layer] = {
SELECT l FROM
CMosB.wpdif, CMosB.wndif, CMosB.pdif, CMosB.ndif => RETURN [l];
ENDCASE => RETURN [CMosB.wpdif]
};
XDiff: PROC [l: CD.Layer] RETURNS [CD.Layer] = {
SELECT l FROM
CMosB.wpdif, CMosB.wndif, CMosB.pdif, CMosB.ndif, CMosB.nwellCont, CMosB.pwellCont => RETURN [l];
ENDCASE => RETURN [CMosB.wpdif]
};
CreateAtomic: PROC [classKey: ATOM, size: CD.Position, layer: CD.Layer ← CD.undefLayer] RETURNS [CD.Object] = {
RETURN [CDAtomicObjects.CreateAtomicOb[classKey, size, CMosB.cmosB, layer]];
};
CreateTransistor: PUBLIC PROC [size: CD.Position, difLayer: CD.Layer] RETURNS [CD.Object] = {
RETURN [CreateAtomic[$C2PolyTrans, size, XDiff[difLayer]]];
};
CreateAngleTransistor: PUBLIC PROC [size: CD.Position, difLayer: CD.Layer] RETURNS [CD.Object] = {
RETURN [CreateAtomic[$C2PolyLTrans, size, XDiff[difLayer]]];
};
CreateLargePolyCon: PUBLIC PROC [sz: CD.Position] RETURNS [CD.Object] = {
RETURN [CreateAtomic[$C2PolyLargeSimpleCon, sz, CMosB.pol]];
};
CreateLargeDifCon: PUBLIC PROC [sz: CD.Position, difLayer: CD.Layer] RETURNS [CD.Object] = {
RETURN [CreateAtomic[$C2PolyLargeSimpleCon, sz, XDiff[difLayer]]];
};
CreateLargeVia: PUBLIC PROC [sz: CD.Position] RETURNS [CD.Object] = {
RETURN [CreateAtomic[$C2PolyLargeVia, sz]];
};
--Real implementations
-- 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: BOOLFALSE] = {
dExt: CD.Number = 10*lambda;
pExt: CD.Number = 10*lambda;
dif: CD.Layer;
inr: CD.Rect ← ob.bbox;
inr.x2 ← MAX[inr.x2, 10*lambda+2*pExt];
inr.y2 ← MAX[inr.y2, 10*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: CD.DescribeProc = {
dExt: CD.Number = 10*lambda;
pExt: CD.Number = 10*lambda;
sz: CD.Position = CD.InterestSize[ob];
RETURN [
Rope.Cat[
"transistor ",
CDOps.LayerRope[ob.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;
FillLTransistor: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] = {
pExt: CD.Number = 10*lambda; --poly extends gate
dExt: CD.Number = 10*lambda; --diffusion extends gate
dW: CD.Number = 10*lambda; --witdth of diffusion in gate (not width of gate)
pW: CD.Number = 10*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 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
largeContactClass: CD.ObjectClass;
wellLargeContactClass: CD.ObjectClass;
FillLargeSimpleCon: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] = {
rimW: CD.Number = 10*lambda; -- therefore large
inr: CD.Rect ← ob.bbox;
inr.x2 ← MAX[inr.x2, 10*lambda+2*rimW];
inr.y2 ← MAX[inr.y2, 10*lambda+2*rimW];
IF ob.layer=CMosB.wpdif OR ob.layer=CMosB.wndif OR ob.layer=CMosB.wpwellCont OR ob.layer=CMosB.wnwellCont THEN {
ob.class ← wellLargeContactClass;
CDAtomicObjects.Incorporate[ob: ob,
r: CDBasics.Extend[inr, CDLayers.layerData[ob.layer].wSurr],
layer: CDLayers.layerData[ob.layer].well,
inside: FALSE
];
};
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: CDLayers.layerData[ob.layer].paint];
CDAtomicObjects.Incorporate[ob: ob, r: inr, layer: CMosB.met];
CDAtomicObjects.Incorporate[ob: ob, r: CDBasics.Extend[inr, -rimW], layer: CMosB.cut];
};
DescribeLargeC: CD.DescribeProc = {
RETURN [Rope.Cat["contact ", CDOps.LayerRope[ob.layer]]]
};
--via -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
FillLargeVia: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] = {
viaRimWidth: CD.Number = 10*lambda;
cut2min: CD.Number = 10*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]
};
Set: PROC [className: ATOM, extractAtom: ATOM] = INLINE {
CDProperties.PutProp[CD.FetchObjectClass[className, CMosB.cmosB], SinixOps.GetExtractMode[$cmosB].extractProcProp, extractAtom];
};
Init: PROC [] = {
Register: PROC [key: ATOM, creator: CDAtomicObjects.FillObjectProc, desc: Rope.ROPE, match: CDStretchyBackdoor.MatchProc←NIL, describe: CD.DescribeProc←NIL] RETURNS [p: CD.ObjectClass] = {
p ← CDAtomicObjects.RegisterAtomicObClass[key, creator, desc, CMosB.cmosB];
IF p=NIL THEN ERROR;
IF describe#NIL THEN p.describe ← describe;
IF match=NIL THEN match ← MatchSimpleCon;
CDStretchyBackdoor.InstallMatchProc[p, match];
};
--transistors
transClass ← Register[$C2PolyTrans, FillTransistor, "transistor", MatchTrans, DescribeT];
wellTransClass ← Register[$C2PolyWellTrans, FillTransistor, "transistor", MatchTrans, DescribeT];
lTransClass ← Register[$C2PolyLTrans, FillLTransistor, "L-transistor", MatchTrans];
wellLTransClass ← Register[$C2PolyLWellTrans, FillLTransistor, "L-transistor", MatchTrans];
--contacts
largeContactClass ← Register[$C2PolyLargeSimpleCon, FillLargeSimpleCon, "large contact", NIL, DescribeLargeC];
wellLargeContactClass ← Register[$C2PolyLargeWellSimpleCon, FillLargeSimpleCon, "large contact", NIL, DescribeLargeC];
[] ← Register[$C2PolyLargeVia, FillLargeVia, "large via"];
-- for the extractor
Set[ $C2PolyLargeSimpleCon,  $CMosBExtractWellRect];
Set[ $C2PolyLargeVia,  $ExtractAtomic];
Set[ $C2PolyTrans,   $ExtractTransistor];
Set[ $C2PolyLTrans,   $ExtractTransistor];
};
Init[];
END.