CMosObsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Christian Jacobi, March 22, 1985 11:09:09 am PST
last edited Christian Jacobi, July 22, 1985 1:55:00 pm PDT
DIRECTORY
CD,
CDAtomicObjects,
CDBasics,
CDExtras,
CDOps,
CDStretchyExtras,
CMos,
Rope;
CMosObsImpl:
CEDAR
PROGRAM
IMPORTS CDAtomicObjects, CDBasics, CDExtras, CDOps, CDStretchyExtras, CMos, Rope =
BEGIN
lambda: CD.Number = CD.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;
pForWellTransistor: REF CD.ObjectClass;
pForTransistor: REF CD.ObjectClass;
FillTransistor:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] =
BEGIN
ext: CD.Number = 2*lambda;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
dif: CD.Layer;
IF ob.layer=CMos.wpdif
OR ob.layer=CMos.wndif
THEN {
ob.class ← pForWellTransistor;
wellSurr ← wellSurround;
innerX ← wellSurround-ext;
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;
};
ob.size.x ← MAX[ob.size.x, MAX[6*lambda, 2*lambda+2*wellSurr]];
ob.size.y ← MAX[ob.size.y, 6*lambda+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: innerX+ext,
x2: ob.size.x-ext-innerX,
y1: wellSurr,
y2: ob.size.y-wellSurr],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX,
x2: ob.size.x-innerX,
y1: wellSurr+ext,
y2: ob.size.y-wellSurr-ext],
lev: CMos.pol
];
END;
DescribeT:
PROC[me:
CD.Object]
RETURNS [Rope.
ROPE] =
BEGIN
RETURN [
Rope.Cat[
"transistor ",
CDOps.LayerName[me.layer],
Rope.Cat[
" [",
CDExtras.ToLambda[me.size.x-4*lambda],
CDExtras.ToLambda[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[
" [",
CDExtras.ToLambda[me.size.x-2*wellSurround],
CDExtras.ToLambda[me.size.y-2*wellSurround-4*lambda],
"]"
]
]
]
END;
-- L transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
pForWellLTransistor: REF CD.ObjectClass;
FillLTransistor:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] =
BEGIN
ext: CD.Number = 2*lambda;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
dif: CD.Layer;
IF ob.layer=CMos.wpdif
OR ob.layer=CMos.wndif
THEN {
ob.class ← pForWellLTransistor;
wellSurr ← wellSurround;
innerX ← wellSurround-ext;
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;
};
ob.size.x ← MAX[ob.size.x, MAX[8*lambda, 6*lambda+2*wellSurr]];
ob.size.y ← MAX[ob.size.y, MAX[8*lambda, 6*lambda+2*wellSurr]];
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+6*lambda],
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+6*lambda), x2: ob.size.x, y1: 2*wellSurr+6*lambda, 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+ext,
x2: ob.size.x-wellSurr,
y1: wellSurr,
y2: wellSurr+6*lambda],
lev: dif
];
IF wellSurr+6*lambda < ob.size.y-innerX-ext
THEN
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: ob.size.x-wellSurr-6*lambda,
x2: ob.size.x-wellSurr,
y1: wellSurr+6*lambda,
y2: ob.size.y-innerX-ext ],
lev: dif
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: innerX,
x2: ob.size.x-wellSurr-ext,
y1: wellSurr+2*lambda,
y2: wellSurr+4*lambda],
lev: CMos.pol
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: ob.size.x-wellSurr-4*lambda,
x2: ob.size.x-wellSurr-2*lambda,
y1: wellSurr+4*lambda,
y2: ob.size.y-innerX],
lev: CMos.pol
];
END;
-- simple contacts -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
pForSimpleCon: REF CD.ObjectClass;
pForWellSimpleCon: REF CD.ObjectClass;
FillSimpleCon:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] =
BEGIN
wellSurr: CD.Number ← 0;
dif: CD.Layer;
IF ob.layer=CMos.wpdif
OR ob.layer=CMos.wndif
THEN {
ob.class ← pForWellSimpleCon;
wellSurr ← wellSurround;
dif ← (IF ob.layer=CMos.wpdif THEN CMos.pdif ELSE CMos.ndif);
}
ob.size ← [4*lambda+2*wellSurr, 4*lambda+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+lambda,
x2: ob.size.x-lambda-wellSurr,
y1: wellSurr+lambda,
y2: ob.size.y-lambda-wellSurr],
lev: CMos.cut
];
END;
DescribeC:
PROC[me:
CD.Object]
RETURNS [Rope.
ROPE] =
BEGIN
RETURN [Rope.Cat["contact ",CDOps.LayerName[me.layer]]]
END;
-- DifShort -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
pForWellDifShortCon: REF CD.ObjectClass;
FillDifShortCon:
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL←
FALSE] =
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 ← pForWellDifShortCon;
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.y1+3*lambda],
lev: CMos.cut
];
CDAtomicObjects.Incorporate[ob: ob,
r: [x1: inr.x1+lambda,
x2: inr.x2-lambda,
y1: inr.y2-3*lambda,
y2: inr.y2-lambda],
lev: CMos.cut
];
END;
-- But -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
pForWellButCon: REF 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:
BOOL←
FALSE] =
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 ← pForWellButCon;
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:
BOOL←
FALSE] =
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: lambda,
x2: ob.size.x-lambda,
y1: lambda,
y2: ob.size.y-lambda],
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:
REF
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
pForTransistor ← Register[$CTrans, FillTransistor, "transistor", MatchTrans];
pForTransistor.describe ← DescribeT;
pForWellTransistor ← Register[$CWellTrans, FillTransistor, "transistor", MatchTrans];
pForWellTransistor.describe ← DescribeWT;
[] ← Register[$CLTrans, FillLTransistor, "L-transistor", MatchTrans];
pForWellLTransistor ← Register[$CLWellTrans, FillLTransistor, "L-transistor", MatchTrans];
--contacts
pForSimpleCon ← Register[$CSimpleCon, FillSimpleCon, "contact"];
pForSimpleCon.describe ← DescribeC;
pForWellSimpleCon ← Register[$CWellSimpleCon, FillSimpleCon, "contact"];
pForWellSimpleCon.describe ← DescribeC;
[] ← Register[$CDifShortCon, FillDifShortCon, "dif short contact"];
pForWellDifShortCon ← Register[$CWellDifShortCon, FillDifShortCon, "dif short contact"];
[] ← Register[$CButtingCont, FillButCon, "butting contact", MatchButCon];
pForWellButCon ← Register[$CWellButtingCont, FillButCon, "butting contact", MatchButCon];
[] ← Register[$CVia, FillVia, "via"];
END;
Init[];
END.