CDDesignRules.mesa (part of ChipNDale)
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, July 5, 1985 4:58:37 pm PDT
Last Edited by Christian Jacobi, November 14, 1985 11:33:52 am PST
DIRECTORY
CD, Rope, SymTab;
CDDesignRules: CEDAR DEFINITIONS =   
BEGIN
This module provides the design rules
Design-rules are logical sub-classes of technologies;
A technology may fulfill different Design-rules
Basics
DesignRules: TYPE = REF DesignRulesRep;
DesignRulesRep: PRIVATE TYPE;
NotKnown: ERROR;
FindRules: PROC[a: ATOM] RETURNS [dr: DesignRules];
--NIL if not found
Distance rules
MinWidth: PROC [dr: DesignRules, layer: CD.Layer] RETURNS [CD.Number];
-- Minimum width of conductors.
-- (Width of interrest rect).
MinDist: PROC [dr: DesignRules, l1, l2: CD.Layer] RETURNS [CD.Number];
-- Minimum distance between unconnected conductors.
-- 0 if no interaction.
-- Error if l1 and l2 from different technologies.
-- (Distance of interrest rects).
MinConnectedDist: PROC [dr: DesignRules, l1, l2: CD.Layer] RETURNS [CD.Number];
-- Minimum distance between connected conductors.
-- 0 if no interaction.
-- Error if l1 and l2 from different technologies.
-- (Distance of interrest rects).
Object generators
GetTechnology: PROC [DesignRules] RETURNS [CD.Technology];
GetLayer: PROC [technology, layer: REF] RETURNS [CD.Layer] = INLINE {
CDSimpleRules.GetLayer[technology, layer]
};
-- Tries to figure out a layer, given names.
-- Use only to get technology specific names.
-- A little bit more forgiving than CD.FetchLayer...
-- Error if not known.
Rect: PROC [size: CD.Position, layer: CD.Layer] RETURNS [CD.Object] = INLINE {
CDSimpleRules.Rect[size, layer]
};
-- size: interest rect
Contact: PROC [dr: DesignRules, l1, l2: CD.Layer, size: CD.Position] RETURNS [CD.Object];
-- nil if certain complication or no contact possible...
-- use CD.InterestRect to get size;
-- CHECK size: procedure may make approximations !
Transistor: PROC [dr: DesignRules, difL: CD.Layer, w, l: CD.Number] RETURNS [CD.Object];
-- nil if some complication or no contact possible...
-- w and l are gate width and length, not object size
-- procedure may make approximations if the technology considers the aequivalent
-- use CD.InterestRect to get object size;
LayerOk: PROC [dr: DesignRules, layer: CD.Layer] RETURNS [BOOL];
ObjectClassOk: PROC [dr: DesignRules, class: CD.ObjectClass] RETURNS [OKness];
OKness: TYPE = {yes, no, depends};
ObjectOk: PROC [dr: DesignRules, ob: CD.Object] RETURNS [BOOL];
Getting information on the inside
DummyConnectorCell: PROC [dr: DesignRules, ob: CD.Object] RETURNS [--READONLY--CD.Object];
--returns a dummy cell which is NOT part of the design
--dummy cell must not be modified
--dummy cell has symbolic object denoting the interconnect area
DummyGateCell: PROC [dr: DesignRules, trans: CD.Object] RETURNS [--READONLY--CD.Object];
--returns a dummy cell which is NOT part of the design
--dummy cell must not be modified
--dummy cell has symbolic object denoting the gate area
TransistorRatio: PROC [trans: CD.Object] RETURNS [w, l: CD.Number];
--not size !
Well surround rules
NeedSurround: PROC [layer: CD.Layer] RETURNS [surList: LIST OF LayerAndDistance];
-- treat surList as READONLY
LayerAndDistance: TYPE = RECORD [layer: CD.Layer, amount: CD.Number];
--positive means grow
WellConnectMaximalDistance: PROC [dr: DesignRules, layer: CD.Layer] RETURNS [n: CD.Number];
-- 0 if connection not necessary or has a square rule
-- layer must be a well layer
-- you must know to what node to connect by some other mean
WellConnectMaximalSquares: PROC [dr: DesignRules, layer: CD.Layer] RETURNS [n: INT];
-- 0 if connection not necessary or has a constant rule
-- layer must be a well layer
-- you must know to what node to connect by some other mean
Flattness rules
Flattness: PROC [dr: DesignRules, ob: CD.Object] RETURNS [LIST OF FlattnessArea];
--treat result as READONLY
--Each FlattnessArea is independent from each other FlattnessArea; all must be satisfied
FlattnessArea: TYPE = RECORD[where: LIST OF CD.Rect, condition: LIST OF PerLayer];
--each point described by where must fullfill all conditions
PerLayer: TYPE = RECORD [layer: CD.Layer, avoid, surround: CD.Numberr];
--avoid, surround >0 means grow, <0 means shrink
--the layer is either to be comletely surrounded by surround or avoided by avoid
-- ok this can not describe minimum distance or surround conditions,
-- but use minimum distance or surround rules to describe those requirements!
Escape
SpecialRule: PROC [dr: DesignRules, rule: ATOM, x: REF] RETURNS [REF];
--returns NIL if not specified
--rule: manual registration
PutProp: PROC [dr: DesignRules, prop: REF, val: REF];
GutProp: PROC [dr: DesignRules, prop: REF] RETURNS [val; REF];
--prop must fulfill regstration rules of CDProperties
Implementors procedures
ImplementSpecialRule: PROC [dr: DesignRules, rule: ATOM, proc: PROC [DesignRules, ATOM, REF] RETURNS [REF]];
ImplementDesignRules: PROC [key: ATOM,
technology: CD.Technology,
rules: SOME MAGIC
] RETURNS [designrules: DesignRules];
--error if redefined
END.