CMosObsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Christian Jacobi, March 22, 1985 11:09:09 am PST
last edited Christian Jacobi, March 25, 1986 2:21:36 pm PST
DIRECTORY
CD,
CDAtomicObjects,
CDBasics,
CDCommandOps,
CDOps,
CDStretchyExtras,
CMos,
Rope;
CMosObsImpl: CEDAR PROGRAM
IMPORTS CDAtomicObjects, CDBasics, CDCommandOps, CDOps, CDStretchyExtras, CMos, Rope =
BEGIN
lambda: CD.Number = CMos.lambda;
wellSurround: CD.Number = CMos.wellSurround;
-- straight transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MatchTrans: PROC [me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] =
--poly, dif, welldif, via
BEGIN
-- Don't care about different diffusions and such
RETURN [layer=me.layer OR layer=CMos.pol]
END;
wellTransClass: CD.ObjectClass;
transClass: CD.ObjectClass;
FillTransistor: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
dExt: CD.Number = 2*lambda;
pExt: CD.Number = 2*lambda;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
dif: CD.Layer;
ob.size ← CDBasics.MaxPoint[ob.size, [2*lambda+2*pExt, 2*lambda+2*dExt]];
IF ob.layer=CMos.wpdif OR ob.layer=CMos.wndif THEN {
ob.class ← wellTransClass;
wellSurr ← wellSurround;
innerX ← wellSurround-pExt;
IF ob.layer=CMos.wpdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
ob.size.x ← ob.size.x + 2*wellSurround-2*pExt;
ob.size.y ← ob.size.y + 2*wellSurround;
}
ELSE {
IF ob.layer=CMos.pdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
};
IF wellSurr#0 THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX+pExt,
x2: ob.size.x-pExt-innerX,
y1: wellSurr,
y2: ob.size.y-wellSurr],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX,
x2: ob.size.x-innerX,
y1: wellSurr+dExt,
y2: ob.size.y-wellSurr-dExt],
lev: CMos.pol
];
END;
DescribeT: PROC[me: CD.Object] RETURNS [Rope.ROPE] =
BEGIN
RETURN [
Rope.Cat[
"transistor ",
CDOps.LayerName[me.layer],
Rope.Cat[
" [",
CDCommandOps.LambdaRope[me.size.x-4*lambda],
CDCommandOps.LambdaRope[me.size.y-4*lambda],
"]"
]
]
]
END;
DescribeWT: PROC[me: CD.Object] RETURNS [Rope.ROPE] =
BEGIN
RETURN [
Rope.Cat[
"transistor ",
CDOps.LayerName[me.layer],
Rope.Cat[
" [",
CDCommandOps.LambdaRope[me.size.x-2*wellSurround],
CDCommandOps.LambdaRope[me.size.y-2*wellSurround-4*lambda],
"]"
]
]
]
END;
-- L transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
wellLTransClass: CD.ObjectClass;
FillLTransistor: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
pExt: CD.Number = 2*lambda; --poly extends gate
dExt: CD.Number = 2*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;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
dif: CD.Layer;
ob.size ← CDBasics.MaxPoint[ob.size, [minSz, minSz]];
IF ob.layer=CMos.wpdif OR ob.layer=CMos.wndif THEN {
ob.class ← wellLTransClass;
wellSurr ← wellSurround;
innerX ← wellSurround-pExt;
ob.size.x ← ob.size.x + 2*wellSurround-pExt;
ob.size.y ← ob.size.y + 2*wellSurround-pExt;
IF ob.layer=CMos.wpdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
}
ELSE {
IF ob.layer=CMos.pdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
};
IF wellSurr#0 THEN {
wR: CD.Rect;
--horizontal piece of nwell
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: 2*wellSurr+dW+2*dExt],
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
--vertical piece of nwell if ~empty
wR ← [x1: ob.size.x-(2*wellSurr+dW+2*dExt), x2: ob.size.x, y1: 2*wellSurr+dW+2*dExt, y2: ob.size.y];
IF CDBasics.NonEmpty[wR] THEN
CDAtomicObjects.Incorporate[ob: ob,
r: wR,
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
};
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX+pExt,
x2: ob.size.x-wellSurr,
y1: wellSurr,
y2: wellSurr+2*dExt+dW],
lev: dif
];
IF wellSurr+2*dExt+dW < ob.size.y-innerX-pExt THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: ob.size.x-wellSurr-2*dExt-dW,
x2: ob.size.x-wellSurr,
y1: wellSurr+2*dExt+dW,
y2: ob.size.y-innerX-pExt ],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX,
x2: ob.size.x-wellSurr-dExt,
y1: wellSurr+dExt,
y2: wellSurr+dExt+pW],
lev: CMos.pol
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: ob.size.x-wellSurr-pW-dExt,
x2: ob.size.x-wellSurr-dExt,
y1: wellSurr+pW+dExt,
y2: ob.size.y-innerX],
lev: CMos.pol
];
END;
-- simple contacts -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
simpleContactClass: CD.ObjectClass;
wellSimpleContactClass: CD.ObjectClass;
FillSimpleCon: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
rimW: CD.Number = lambda; -- therefore NOT large
wellSurr: CD.Number ← 0;
dif: CD.Layer;
IF ob.layer=CMos.wpdif OR ob.layer=CMos.wndif THEN {
ob.class ← wellSimpleContactClass;
wellSurr ← wellSurround;
dif ← (IF ob.layer=CMos.wpdif THEN CMos.pdif ELSE CMos.ndif);
}
ELSE {
dif ← ob.layer
};
ob.size ← [2*lambda+2*rimW+2*wellSurr, 2*lambda+2*rimW+2*wellSurr];
IF wellSurr#0 THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: wellSurr,
x2: ob.size.x-wellSurr,
y1: wellSurr,
y2: ob.size.y-wellSurr],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: wellSurr,
x2: ob.size.x-wellSurr,
y1: wellSurr,
y2: ob.size.y-wellSurr],
lev: CMos.met
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: wellSurr+rimW,
x2: ob.size.x-rimW-wellSurr,
y1: wellSurr+rimW,
y2: ob.size.y-rimW-wellSurr],
lev: CMos.cut
];
END;
DescribeC: PROC[me: CD.Object] RETURNS [Rope.ROPE] =
BEGIN
RETURN [Rope.Cat["contact ",CDOps.LayerName[me.layer]]]
END;
-- DifShort -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
wellDifShortContactClass: CD.ObjectClass;
FillDifShortCon: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
dif: CD.Layer;
wellSurr: CD.Number ← 0;
inr: CD.Rect;
innerW: CD.Number = 4*lambda;
innerH: CD.Number = 8*lambda;
h: CD.Number = innerH/2;
IF ob.layer=CMos.wpdif OR ob.layer=CMos.wndif THEN {
ob.class ← wellDifShortContactClass;
wellSurr ← wellSurround;
IF ob.layer=CMos.wpdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
inr ← [x1: wellSurr, y1: wellSurr, x2: wellSurr+innerW, y2: wellSurr+innerH];
ob.size ← [innerW+2*wellSurr, innerH+2*wellSurr-h];
}
ELSE {
IF ob.layer=CMos.pdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
inr ← [x1: 0, y1: 0, x2: innerW, y2: innerH];
ob.size ← [innerW, innerH];
};
IF wellSurr#0 THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
CDAtomicObjects.Incorporate[ob: ob, r: inr, lev: CMos.met];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1,
y2: inr.y1+h],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1+h,
y2: inr.y2],
lev: (IF dif=CMos.pdif THEN CMos.nwellCont ELSE CMos.pwellCont)
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1+lambda,
x2: inr.x2-lambda,
y1: inr.y1+lambda,
y2: inr.y2-lambda],
lev: CMos.cut
];
END;
-- But -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
wellButContactClass: CD.ObjectClass;
MatchButCon: PROC [me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] =
BEGIN
-- Don't care about different diffusions and such
RETURN [layer=me.layer OR layer=CMos.met OR layer=CMos.pol]
END;
FillButCon: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
polyH: CD.Number = 3*lambda;
diffOffsetY: CD.Number = polyH-lambda;
innerH: CD.Number = diffOffsetY+4*lambda;
innerW: CD.Number = 4*lambda;
wellSurr: CD.Number;
innerY: CD.Number;
inr: CD.Rect;
dif: CD.Layer;
IF ob.layer=CMos.wpdif OR ob.layer=CMos.wndif THEN {
ob.class ← wellButContactClass;
wellSurr ← wellSurround;
innerY ← wellSurround-diffOffsetY;
IF ob.layer=CMos.wpdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
}
ELSE {
IF ob.layer=CMos.pdif THEN dif ← CMos.pdif ELSE dif ← CMos.ndif;
wellSurr ← 0;
innerY ← 0;
};
inr ← [x1: wellSurr, y1: innerY, x2: wellSurr+innerW, y2: innerY+innerH];
ob.size ← [innerW+2*wellSurr, innerY+innerH+wellSurr];
IF wellSurr#0 THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: (IF dif=CMos.pdif THEN CMos.nwell ELSE CMos.pwell),
inside: FALSE
];
CDAtomicObjects.Incorporate[ob: ob, r: inr, lev: CMos.met];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1+diffOffsetY,
y2: inr.y2],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1,
x2: inr.x2,
y1: inr.y1,
y2: inr.y1+polyH],
lev: CMos.pol
];
CDAtomicObjects.Incorporate[ob: ob,
r: CDBasics.Extend[inr, -lambda],
lev: CMos.cut
];
END;
--via -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
FillVia: PROC [ob: CD.Object] RETURNS [mustFail: BOOLFALSE] =
BEGIN
viaRimWidth: CD.Number = lambda;
cut2min: CD.Number = 3*lambda;
ob.size ← [cut2min+2*viaRimWidth, cut2min+2*viaRimWidth];
ob.layer ← CMos.met2;
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: CMos.met2
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: 0, x2: ob.size.x, y1: 0, y2: ob.size.y],
lev: CMos.met
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: viaRimWidth,
x2: ob.size.x-viaRimWidth,
y1: viaRimWidth,
y2: ob.size.y-viaRimWidth],
lev: CMos.cut2
];
END;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MatchSimpleCon: PROC [me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] =
--poly, dif, welldif, via
BEGIN
-- Don't care about different diffusions and such
RETURN [layer=me.layer OR layer=CMos.met]
END;
Init: PROC [] =
BEGIN
Register: PROC [key: ATOM, creator: CDAtomicObjects.FillObjectProc, desc: Rope.ROPE, match: CDStretchyExtras.MatchProc←NIL] RETURNS [p: CD.ObjectClass] =
BEGIN
p ← CDAtomicObjects.RegisterAtomicObClass[key, creator, desc, CMos.cmos];
IF p=NIL THEN ERROR;
IF match=NIL THEN match ← MatchSimpleCon;
CDStretchyExtras.InstallMatch[p, match];
END;
--transistors
transClass ← Register[$CTrans, FillTransistor, "transistor", MatchTrans];
transClass.describe ← DescribeT;
wellTransClass ← Register[$CWellTrans, FillTransistor, "transistor", MatchTrans];
wellTransClass.describe ← DescribeWT;
[] ← Register[$CLTrans, FillLTransistor, "L-transistor", MatchTrans];
wellLTransClass ← Register[$CLWellTrans, FillLTransistor, "L-transistor", MatchTrans];
--contacts
simpleContactClass ← Register[$CSimpleCon, FillSimpleCon, "contact"];
simpleContactClass.describe ← DescribeC;
wellSimpleContactClass ← Register[$CWellSimpleCon, FillSimpleCon, "contact"];
wellSimpleContactClass.describe ← DescribeC;
[] ← Register[$CDifShortCon, FillDifShortCon, "dif short contact"];
wellDifShortContactClass ← Register[$CWellDifShortCon, FillDifShortCon, "dif short contact"];
[] ← Register[$CButtingCont, FillButCon, "butting contact", MatchButCon];
wellButContactClass ← Register[$CWellButtingCont, FillButCon, "butting contact", MatchButCon];
[] ← Register[$CVia, FillVia, "via"];
END;
Init[];
END.