CMosSimpleRulesImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Created by: Christian Jacobi, July 5, 1985 4:58:37 pm PDT
Last edited by: Christian Jacobi, October 17, 1986 1:51:26 pm PDT
DIRECTORY
CD, CDSimpleRulesBackdoor, CMos, CMosObjects;
CMosSimpleRulesImpl: CEDAR PROGRAM
IMPORTS CDSimpleRulesBackdoor, CMos, CMosObjects =
BEGIN
lambda: CD.Number = CMos.lambda;
IRules: TYPE = CDSimpleRulesBackdoor.IRules;
MinWidth: PROC [layer: CD.Layer, rules: IRules] RETURNS [CD.Number] =
BEGIN
RETURN [SELECT layer FROM
CMos.met => 3*lambda,
CMos.met2 => 4*lambda,
CMos.pol => 2*lambda,
CMos.ndif, CMos.pdif, CMos.wndif, CMos.wpdif => 2*lambda,
CMos.pwellCont, CMos.nwellCont => 2*lambda,
CMos.nwell, CMos.pwell => 12*lambda,
ENDCASE => 0
]
END;
BaseLayer: PROC [layer: CD.Layer] RETURNS [CD.Layer] =
INLINE BEGIN
IF layer=CMos.wndif OR layer=CMos.pwellCont THEN RETURN [CMos.ndif];
IF layer=CMos.wpdif OR layer=CMos.nwellCont THEN RETURN [CMos.pdif];
RETURN [layer]
END;
IsDiff: PROC [layer: CD.Layer] RETURNS [BOOL] =
BEGIN
RETURN[layer=CMos.ndif
OR layer=CMos.pdif
OR layer=CMos.wndif
OR layer=CMos.wpdif
OR layer=CMos.pwellCont
OR layer=CMos.nwellCont];
END;
MinDist: PROC [l1, l2: CD.Layer, rules: IRules] RETURNS [CD.Number] =
BEGIN
l1 ← BaseLayer[l1];
l2 ← BaseLayer[l2];
IF l1=l2 THEN
RETURN [SELECT l1 FROM
CMos.met => 3*lambda,
CMos.met2 => 4*lambda,
CMos.pol => 2*lambda,
CMos.ndif, CMos.pdif => 3*lambda,
CMos.pwell, CMos.nwell => 10*lambda,
CMos.cut => 3*lambda,
CMos.cut2, CMos.imp, CMos.ovg, CMos.bur => 0,
ENDCASE => 0
];
IF l2=CMos.met THEN {l2 ← l1; l1 ← CMos.met};
IF l1=CMos.met THEN
RETURN [SELECT l2 FROM
CMos.cut => 2*lambda,
ENDCASE => 0
];
IF l2=CMos.met2 THEN {l2 ← l1; l1 ← CMos.met2};
IF l1=CMos.met2 THEN
RETURN [SELECT l2 FROM
CMos.cut2 => 2*lambda,
ENDCASE => 0
];
IF l2=CMos.pol THEN {l2 ← l1; l1 ← CMos.pol};
IF l1=CMos.pol THEN {
IF IsDiff[l2] THEN RETURN[lambda];
IF l2=CMos.cut OR l2=CMos.bur THEN RETURN[2*lambda];
RETURN[0];
};
IF l2=CMos.ndif THEN {l2 ← l1; l1 ← CMos.ndif};
IF l1=CMos.ndif THEN {
RETURN [SELECT l2 FROM
CMos.pdif => 10*lambda,
CMos.nwell => 5*lambda,
CMos.cut, CMos.bur => 2*lambda,
ENDCASE => 0
];
};
IF l2=CMos.pdif THEN {l2 ← l1; l1 ← CMos.pdif};
IF l1=CMos.pdif THEN {
RETURN [SELECT l2 FROM
CMos.pwell => 5*lambda,
CMos.cut, CMos.bur => 2*lambda,
ENDCASE => 0
];
};
RETURN [0]
END;
Contact: PROC [l1, l2: CD.Layer, rules: IRules] RETURNS [ob: CD.Object ← NIL] =
BEGIN
IF l1#CMos.met AND l2=CMos.met THEN RETURN [Contact[l2, l1, rules]];
IF l1=CMos.met THEN {
IF l2=CMos.pol THEN RETURN [CMosObjects.CreatePolyCon[]];
IF l2=CMos.met2 THEN RETURN [CMosObjects.CreateMmCon[]];
IF l2=CMos.ndif OR l2=CMos.pdif OR l2=CMos.wpdif OR l2=CMos.wndif THEN
RETURN [CMosObjects.CreateDifCon[difLayer: l2]];
};
END;
Init: PROC [] =
BEGIN
CDSimpleRulesBackdoor.RegisterLayerName["n-diff", CMos.ndif];
CDSimpleRulesBackdoor.RegisterLayerName["p-diff", CMos.wpdif];
CDSimpleRulesBackdoor.RegisterLayerName["n-well", CMos.nwell];
CDSimpleRulesBackdoor.RegisterLayerName["nwell", CMos.nwell];
CDSimpleRulesBackdoor.RegisterLayerName["p-well", CMos.pwell];
CDSimpleRulesBackdoor.RegisterLayerName["pwell", CMos.pwell];
CDSimpleRulesBackdoor.RegisterLayerName["poly", CMos.pol];
CDSimpleRulesBackdoor.RegisterLayerName["metal", CMos.met];
CDSimpleRulesBackdoor.RegisterLayerName["metal2", CMos.met2];
CDSimpleRulesBackdoor.RegisterLayerName["pwellCont", CMos.pwellCont];
CDSimpleRulesBackdoor.RegisterLayerName["nwellCont", CMos.nwellCont];
CDSimpleRulesBackdoor.RegisterRules[[
key: NIL,
technology: CMos.cmos,
minWidth: MinWidth,
minDist: MinDist,
contact: Contact
]];
END;
Init[];
END.