CDSimpleRules.mesa (part of ChipNDale)
Copyright © 1985, 1986, 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, July 5, 1985 4:58:37 pm PDT
Last edited by: Christian Jacobi, April 20, 1987 6:40:39 pm PDT
CDSimpleRules: CEDAR DEFINITIONS =
BEGIN
This module is used to hide the actual technology used from otherwise quite technology independent routing or simple drc software. Not all technologies do support this module.
All procedures might raise NotKnown if they do not support this module; if simply a particular procedure is not implemented, a default value might be specified.
Doesn't deal with transistors because they are very technology dependent; but once we might know how to.
Rules:
TYPE =
REF;
--UNION of ATOM and REF ImplementationRulesRep
-- Basic design rules
MinWidth:
PROC [rules: Rules, layer:
CD.Layer]
RETURNS [
CD.Number];
-- Minimum width of conductors. (Width of interrest rect)
-- Returns zero if no minimum width specified for the layer.
MinSpace:
PROC [rules: Rules, l1, l2:
CD.Layer]
RETURNS [
CD.Number];
-- Minimum distance between unrelated conductors.
-- Returns zero if no minimum space specified for the layers.
-- Error if l1 and l2 from different technologies.
MaxWidth:
PROC [rules: Rules, layer:
CD.Layer]
RETURNS [
CD.Number];
-- Maximum width of features. (interrest rects).
-- Returns zero if no maximum width specified for the layer.
GetValue:
PROC [rules: Rules, id:
ATOM]
RETURNS [v:
CD.Number];
-- If id is not found then ERROR NotKnown.
GetRuleDescription:
PROC [rules: Rules, id:
ATOM]
RETURNS [r: Rope.
ROPE];
-- If id is not found then returns NIL.
GetRulesProp:
PROC [rules: Rules, key:
REF]
RETURNS [
REF];
-- Properties to get more behaviour...
-- If key is not found then returns NIL.
GetRulesKey:
PROC [rules: Rules]
RETURNS [
ATOM];
-- Gets name of a Rules set.
-- Object generators
Rect:
PROC [size:
CD.Position, layer:
CD.Layer]
RETURNS [
CD.Object];
-- size: interest rect
-- For conveniance only, duplicate of CDRects...
Contact:
PROC [rules: Rules, l1, l2:
CD.Layer]
RETURNS [
CD.Object];
-- Returns minimum size contact
-- nil if any complication or no contact possible
-- use CD.InterestRect to get size
-- Error if l1 and l2 from different technologies.
-- Returned object must be treated readonly.
LargeContact:
PROC [rules: Rules, design:
CD.Design, size:
CD.Position, l1, l2:
CD.Layer]
RETURNS [
CD.Object];
-- nil if any complication [other than size] or no contact possible
-- Check size with CD.InterestRect, unless you are sure required size works
-- Error if l1 or l2 from different technologies.
-- Returned object must be treated readonly.
-- Bridge to get ChipNDale features from names
GetLayer:
PROC [technology, layer:
REF]
RETURNS [
CD.Layer];
-- Tries to figure out a layer, given names for layer, technology or rules.
-- A little bit more forgiving than CD.FetchLayer...
-- Raises NotKnown if not known.
GetTechnology:
PROC [hint:
REF]
RETURNS [
CD.Technology];
-- Returns technology given its name, key or rules; NIL if not found.
-- [more friendly version of CD.GetTechnology, which requires a key]
FetchRules:
PROC [design:
CD.Design]
RETURNS [rules:
ATOM];
-- Conveniance procedure to get rules from $DesignRules property of design
-- May raise NotKnown if not known.
END.