SinixCMosA.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet August 15, 1985 2:09:54 pm PDT
Bertrand Serlet June 4, 1986 5:47:14 pm PDT
Pradeep Sindhu December 2, 1985 6:42:40 pm PST
Barth, January 13, 1986 1:41:27 pm PST
Jean-Marc Frailong May 30, 1986 9:45:34 pm PDT
DIRECTORY
CD, CDAtomicObjects, CDBasics, CDCells, CDProperties, CDOrient, CDRects, CDSymbolicObjects, CDTexts,
CMos,
Core, CoreClasses, CoreOps, CoreProperties,
PW,
Sinix, SinixCMos, SinixHighlight;
SinixCMosA: CEDAR PROGRAM
IMPORTS CD, CDBasics, CDCells, CDOrient, CDProperties, CDRects, CDSymbolicObjects, CDTexts, CMos, CoreClasses, CoreOps, CoreProperties, PW, Sinix, SinixCMos, SinixHighlight
EXPORTS SinixCMos
SHARES CDCells, CDRects, CDSymbolicObjects, CDTexts =
BEGIN OPEN SinixCMos;
Properties and extraction of common objects
extractAMode: PUBLIC Sinix.Mode ← NEW [Sinix.ModeRec ← [
name: "CMosA",
extractProcProp: PW.RegisterProp[$CMosAExtractProc, TRUE, TRUE],
pinsProp: CoreProperties.RegisterProperty[$SinixCMosAPins],
wireGeometryProp: CoreProperties.RegisterProperty[$SinixCMosAWireGeometry, CoreProperties.Props[[CoreProperties.propCopy, CoreProperties.PropDoCopy]]],
instanceProp: CoreProperties.RegisterProperty[$SinixCMosAInstance, CoreProperties.Props[[CoreProperties.propCopy, CoreProperties.PropDoCopy]]],
cacheProp: PW.RegisterProp[$SinixCMosACache, FALSE, TRUE],
cachePropsProp: PW.RegisterProp[$SinixCMosACacheProps, FALSE, TRUE],
flatNameSpace: TRUE,
equalProc: Sinix.CompareProps
]];
IsWellLayer: PUBLIC PROC [layer: CD.Layer] RETURNS [BOOL] = {
RETURN [layer=CMos.pwell OR layer=CMos.nwell];
};
TouchAtomicWell: PUBLIC Sinix.TouchProc = {
FOR rList: CDAtomicObjects.DrawList ← NARROW [instance1.ob.specificRef, CDAtomicObjects.AtomicObsPtr].rList, rList.rest WHILE rList#NIL DO
IF ~IsWellLayer[rList.first.lev] AND Sinix.TouchRectObject[mode, instance2, CDOrient.MapRect[rList.first.r, instance1.ob.size, instance1.orientation, instance1.location], rList.first.lev] THEN RETURN [TRUE];
ENDLOOP;
};
ExtractPin: Sinix.ExtractProc = {
[result] ← Sinix.ExtractPin[obj, mode, properties, userData];
AddNamesToWire[NARROW [result], properties];
};
ExtractRect: Sinix.ExtractProc = {
IF IsWellLayer[obj.layer] THEN RETURN [NIL];
[result] ← Sinix.ExtractWire[obj, mode, properties, userData];
AddNamesToWire[NARROW [result], properties];
};
Contacts
Copies the rectangles of rList which are not well in the returned wire
ExtractAtomicWell: Sinix.ExtractProc = {
result ← CoreOps.CreateWire[];
FOR rList: CDAtomicObjects.DrawList ← NARROW [obj.specificRef, CDAtomicObjects.AtomicObsPtr].rList, rList.rest WHILE rList#NIL DO
IF ~IsWellLayer[rList.first.lev] THEN AddRect[mode, NARROW [result], rList.first.r, rList.first.lev];
ENDLOOP;
AddNamesToWire[NARROW [result], properties];
};
To be removed in near future
ExtractPseudoCellWell: Sinix.ExtractProc = {
cellPtr: CD.CellPtr ← NARROW [obj.specificRef];
category ← $Wire;
wire ← CoreOps.CreateWire[];
FOR contents: LIST OF CD.Instance ← NARROW [obj.specificRef, CD.CellPtr].contents, contents.rest WHILE contents#NIL DO
IF ~IsWellLayer[contents.first.ob.layer] THEN AddRect[mode, wire, CDInstances.InstRectO[contents.first], contents.first.ob.layer];
ENDLOOP;
};
Diffusion wires
ExtractWellDiff: Sinix.ExtractProc = {
result ← CoreOps.CreateWire[];
AddRect[mode, NARROW [result], CDBasics.Extend[CDBasics.RectAt[[0, 0], obj.size], -CMos.wellSurround], CMos.pdif];
AddNamesToWire[NARROW [result], properties];
};
TouchWellDiff: Sinix.TouchProc = {
RETURN [Sinix.TouchRectObject[
mode,
instance2,
CDOrient.MapRect[
CDBasics.Extend[CDBasics.RectAt[[0, 0], instance1.ob.size], -CMos.wellSurround],
instance1.ob.size, instance1.orientation, instance1.location],
CMos.pdif]];
};
Transistors
New layers for transistors
nsource: CD.Layer ← MakeAbstract[CD.NewLayer[CMos.cmos, $CNSource], CMos.ndif];
ndrain: CD.Layer ← MakeAbstract[CD.NewLayer[CMos.cmos, $CNDrain], CMos.ndif];
psource: CD.Layer ← MakeAbstract[CD.NewLayer[CMos.cmos, $CPSource], CMos.pdif];
pdrain: CD.Layer ← MakeAbstract[CD.NewLayer[CMos.cmos, $CPDrain], CMos.pdif];
ExtractTransistor: Sinix.ExtractProc = {
cellType: CellType;
lambda: CD.Number = CMos.lambda;
ext: CD.Number = 2*lambda;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
dif: CD.Layer ← IF obj.layer=CMos.wpdif OR obj.layer=CMos.pdif THEN CMos.pdif ELSE CMos.ndif;
gateWire, sourceWire, drainWire: Wire;
IF obj.layer=CMos.wpdif OR obj.layer=CMos.wndif THEN {
wellSurr ← CMos.wellSurround;
innerX ← CMos.wellSurround-ext;
};
cellType ← CoreClasses.CreateTransistor[[IF dif=CMos.pdif THEN pE ELSE nE]];
gateWire ← cellType.public[0];
sourceWire ← cellType.public[1];
drainWire ← cellType.public[2];
AddRect[mode, sourceWire,
[x1: innerX+ext, x2: obj.size.x-ext-innerX, y1: wellSurr, y2: ext+wellSurr],
IF dif=CMos.pdif THEN psource ELSE nsource];
AddRect[mode, drainWire,
[x1: innerX+ext, x2: obj.size.x-ext-innerX, y1: obj.size.y-wellSurr-ext, y2: obj.size.y-wellSurr],
IF dif=CMos.pdif THEN pdrain ELSE ndrain];
FOR rList: CDAtomicObjects.DrawList ← NARROW [obj.specificRef, CDAtomicObjects.AtomicObsPtr].rList, rList.rest WHILE rList#NIL DO
rect: CD.Rect ← rList.first.r;
layer: CD.Layer ← rList.first.lev;
SELECT layer FROM
CMos.ndif     => {};
CMos.pdif     => {};
CMos.pol      => AddRect[mode, gateWire, rect, CMos.pol];
CMos.nwell, CMos.pwell => {};
ENDCASE      => ERROR;
ENDLOOP;
result ← cellType;
};
ExtractTransistorL: Sinix.ExtractProc = {
cellType: CellType;
lambda: CD.Number = CMos.lambda;
wellSurround: CD.Number = CMos.wellSurround;
ext: CD.Number = 2*lambda;
wellSurr: CD.Number ← 0;
innerX: CD.Number ← 0;
gateWire, sourceWire, drainWire: Wire;
dif: CD.Layer ← IF obj.layer=CMos.wpdif OR obj.layer=CMos.pdif THEN CMos.pdif ELSE CMos.ndif;
cellType ← CoreClasses.CreateTransistor[[IF obj.layer=CMos.wpdif OR obj.layer=CMos.pdif THEN pE ELSE nE]];
gateWire ← cellType.public[0];
sourceWire ← cellType.public[1];
drainWire ← cellType.public[2];
IF obj.layer=CMos.wpdif OR obj.layer=CMos.wndif THEN {
wellSurr ← wellSurround;
innerX ← wellSurround-ext;
};
source is the smallest diff
AddRect[mode, sourceWire,
[x1: innerX+ext, x2: obj.size.x-wellSurr-4*lambda, y1: wellSurr+4*lambda, y2: wellSurr+6*lambda],
IF dif=CMos.pdif THEN psource ELSE nsource];
AddRect[mode, sourceWire,
[x1: obj.size.x-wellSurr-6*lambda, x2: obj.size.x-wellSurr-4*lambda, y1: wellSurr+4*lambda, y2: obj.size.y-innerX-ext],
IF dif=CMos.pdif THEN psource ELSE nsource];
AddRect[mode, drainWire,
[x1: innerX+ext, x2: obj.size.x-wellSurr, y1: wellSurr, y2: wellSurr+2*lambda],
IF dif=CMos.pdif THEN pdrain ELSE ndrain];
AddRect[mode, drainWire,
[x1: obj.size.x-wellSurr-2*lambda, x2: obj.size.x-wellSurr, y1: wellSurr, y2: obj.size.y-innerX-ext],
IF dif=CMos.pdif THEN pdrain ELSE ndrain];
FOR rList: CDAtomicObjects.DrawList ← NARROW [obj.specificRef, CDAtomicObjects.AtomicObsPtr].rList, rList.rest WHILE rList#NIL DO
rect: CD.Rect ← rList.first.r;
layer: CD.Layer ← rList.first.lev;
SELECT layer FROM
CMos.pol      => AddRect[mode, gateWire, rect, CMos.pol];
CMos.ndif     => {};
CMos.pdif     => {};
CMos.nwell, CMos.pwell => {};
ENDCASE      => ERROR;
ENDLOOP;
result ← cellType;
};
Initialization
CMosAContextCreator: SinixHighlight.ExtractContextCreator = {
context ← NEW [SinixHighlight.ExtractContextRec ← [mode: extractAMode, userData: NIL]];
};
Atomic: PROC [className: ATOM, extractProc: ATOM ← $CMosAExtractAtomicWell, touchProc: Sinix.TouchProc ← Sinix.TouchAtomic] = {
class: CD.ObjectClass = CD.FetchObjectClass[className, CMos.cmos];
CDProperties.PutProp[class, extractAMode.extractProcProp, extractProc];
CDProperties.PutProp[class, Sinix.touchProcProp, NEW [Sinix.TouchProc ← touchProc]];
};
Highlight for this technology
SinixHighlight.RegisterDefaultLayoutMode[CMos.cmos, CMosAContextCreator];
Registering extract procs
Sinix.RegisterExtractProc[$CMosAExtractPin, ExtractPin];
Sinix.RegisterExtractProc[$CMosAExtractRect, ExtractRect];
Sinix.RegisterExtractProc[$CMosAExtractAtomicWell, ExtractAtomicWell];
Sinix.RegisterExtractProc[$CMosAExtractWellDiff, ExtractWellDiff];
Sinix.RegisterExtractProc[$CMosAExtractTransistor, ExtractTransistor];
Sinix.RegisterExtractProc[$CMosAExtractTransistorL, ExtractTransistorL];
Cells, Pins
CDProperties.PutProp[CDCells.cellClass, extractAMode.extractProcProp, $ExtractCell];
CDProperties.PutProp[CDCells.cellClass, Sinix.touchProcProp, NEW [Sinix.TouchProc ← Sinix.TouchCell]];
CDProperties.PutProp[CDSymbolicObjects.pinClass, extractAMode.extractProcProp, $ExtractPin];
CDProperties.PutProp[CDSymbolicObjects.pinClass, Sinix.touchProcProp, NEW [Sinix.TouchProc ← Sinix.TouchPin]];
CDProperties.PutProp[CDSymbolicObjects.segmentClass, extractAMode.extractProcProp, $ExtractPin];
CDProperties.PutProp[CDSymbolicObjects.segmentClass, Sinix.touchProcProp, NEW [Sinix.TouchProc ← Sinix.TouchPin]];
CDProperties.PutProp[CDSymbolicObjects.markClass, extractAMode.extractProcProp, $ExtractPin];
CDProperties.PutProp[CDSymbolicObjects.markClass, Sinix.touchProcProp, NEW [Sinix.TouchProc ← Sinix.TouchPin]];
Rectangles
CDProperties.PutProp[CDRects.bareRectClass, extractAMode.extractProcProp, $CMosAExtractRect];
CDProperties.PutProp[CDRects.bareRectClass, Sinix.touchProcProp, NEW [Sinix.TouchProc ← Sinix.TouchRect]];
Contacts
Atomic[className: $CSimpleCon];
Atomic[className: $CWellSimpleCon, touchProc: TouchAtomicWell];
Atomic[className: $CButtingCont];
Atomic[className: $CWellButtingCont, touchProc: TouchAtomicWell];
Atomic[className: $CVia];
Atomic[className: $CDifShortCon];
Atomic[className: $CWellDifShortCon, touchProc: TouchAtomicWell];
Diffusion wires
Atomic[className: $CMosPDifRect, extractProc: $CMosAExtractWellDiff, touchProc: TouchWellDiff];
Transistors
CDProperties.PutProp[CD.FetchObjectClass[$CTrans, CMos.cmos], extractAMode.extractProcProp, $CMosAExtractTransistor];
CDProperties.PutProp[CD.FetchObjectClass[$CWellTrans, CMos.cmos], extractAMode.extractProcProp, $CMosAExtractTransistor];
Angle Transistors
CDProperties.PutProp[CD.FetchObjectClass[$CLTrans, CMos.cmos], extractAMode.extractProcProp, $CMosAExtractTransistorL];
CDProperties.PutProp[CD.FetchObjectClass[$CLWellTrans, CMos.cmos], extractAMode.extractProcProp, $CMosAExtractTransistorL];
Texts
CDProperties.PutProp[CDTexts.textClass, extractAMode.extractProcProp, $ExtractNull];
END.