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; MatchTrans: PROC [me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] = BEGIN RETURN [layer=me.layer OR layer=CMos.pol] END; wellTransClass: CD.ObjectClass; transClass: CD.ObjectClass; FillTransistor: PROC [ob: CD.Object] RETURNS [mustFail: BOOL_FALSE] = 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; wellLTransClass: CD.ObjectClass; FillLTransistor: PROC [ob: CD.Object] RETURNS [mustFail: BOOL_FALSE] = 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; 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 ]; 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; simpleContactClass: CD.ObjectClass; wellSimpleContactClass: CD.ObjectClass; FillSimpleCon: PROC [ob: CD.Object] RETURNS [mustFail: BOOL_FALSE] = 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; wellDifShortContactClass: 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 _ 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 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 _ 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; 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: 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] = BEGIN 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; 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]; 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. (CMosObsImpl.mesa Copyright c 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 -- straight transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --poly, dif, welldif, via -- Don't care about different diffusions and such -- L transistors -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --horizontal piece of nwell --vertical piece of nwell if ~empty -- simple contacts -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- DifShort -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Don't care about different diffusions and such --via -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --poly, dif, welldif, via -- Don't care about different diffusions and such --transistors --contacts ÊÀ˜šœ™Jšœ Ïmœ1™