NMosSimpleRulesImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Ch. Jacobi, July 5, 1985 4:58:37 pm PDT
last edited Christian Jacobi, July 25, 1985 1:32:30 pm PDT
DIRECTORY
CD, CDSimpleRules, NMos, NMosContacts, SymTab;
NMosSimpleRulesImpl:
CEDAR
PROGRAM
IMPORTS CDSimpleRules, NMos, NMosContacts, SymTab =
BEGIN
MinWidth:
PROC [layer:
CD.Layer]
RETURNS [
CD.Number] =
BEGIN
RETURN [
SELECT layer
FROM
NMos.met => 3*CD.lambda,
NMos.met2 => 4*CD.lambda,
NMos.pol => 2*CD.lambda,
NMos.dif => 2*CD.lambda,
ENDCASE => 0
]
END;
MinDist:
PROC [l1, l2:
CD.Layer]
RETURNS [
CD.Number] =
BEGIN
IF l1=l2
THEN
RETURN [
SELECT l1
FROM
NMos.met => 3*CD.lambda,
NMos.met2 => 4*CD.lambda,
NMos.pol => 2*CD.lambda,
NMos.dif => 3*CD.lambda,
ENDCASE => 0
];
IF l2=NMos.met THEN {l2 ← l1; l1 ← NMos.met};
IF l1=NMos.met
THEN
RETURN [
SELECT l1
FROM
NMos.cut => 2*CD.lambda,
ENDCASE => 0
];
IF l2=NMos.met2 THEN {l2 ← l1; l1 ← NMos.met2};
IF l1=NMos.met2
THEN
RETURN [
SELECT l1
FROM
NMos.cut2 => 2*CD.lambda,
ENDCASE => 0
];
IF l2=NMos.pol THEN {l2 ← l1; l1 ← NMos.pol};
IF l1=NMos.pol
THEN {
IF l2=NMos.dif THEN RETURN[CD.lambda];
IF l2=NMos.imp OR l2=NMos.imp0 OR l2=NMos.impWeak THEN RETURN[2*CD.lambda];
IF l2=NMos.cut OR l2=NMos.bur THEN RETURN[2*CD.lambda];
RETURN[0];
};
IF l2=NMos.dif THEN {l2 ← l1; l1 ← NMos.dif};
IF l1=NMos.dif
THEN {
RETURN [
SELECT l1
FROM
NMos.imp, NMos.imp0, NMos.impWeak => 2*CD.lambda,
NMos.cut, NMos.bur => 2*CD.lambda,
ENDCASE => 0
];
};
RETURN [0]
END;
Contact:
PROC [l1, l2:
CD.Layer]
RETURNS [ob:
CD.Object ←
NIL] =
BEGIN
IF l1#NMos.met AND l2=NMos.met THEN RETURN [Contact[l2, l1]];
IF l1=NMos.met
THEN {
IF l2=NMos.pol THEN RETURN [NMosContacts.CreatePolyCon[0]];
IF l2=NMos.met2 THEN RETURN [NMosContacts.CreateMmCon[0]];
IF l2=NMos.dif THEN RETURN [NMosContacts.CreateDifCon[0]];
};
END;
Init:
PROC [] =
BEGIN
layerTable: SymTab.Ref ← SymTab.Create[case: FALSE];
[] ← layerTable.Insert["n-diff", $dif];
[] ← layerTable.Insert["diff", $dif];
[] ← layerTable.Insert["poly", $pol];
[] ← layerTable.Insert["metal", $met];
[] ← layerTable.Insert["metal2", $met2];
CDSimpleRules.ImplementTechnology[
technology: NMos.nmos,
minWidth: MinWidth,
minDist: MinDist,
contact: Contact,
layerTable: layerTable
];
END;
Init[];
END.