XRulesImpl.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, April 23, 1987 4:07:01 pm PDT
Last edited Christian Jacobi, April 23, 1987 4:46:16 pm PDT
gbb April 30, 1987 6:12:51 pm PDT
This code could be included into DesignRulesImpl
The procedure DefineRules is currently called using the interpreter using the load mechanisms of CDSimpleRulsImpl
DIRECTORY
CD, CDLayers, CDSimpleRules, CDSimpleRulesBackdoor, DesignRules, Rope;
XRulesImpl: CEDAR PROGRAM
IMPORTS CDLayers, CDSimpleRules, CDSimpleRulesBackdoor, DesignRules =
BEGIN
IRules: TYPE = CDSimpleRulesBackdoor.IRules;
SRules: TYPE = CDSimpleRules.Rules;
SMinWidth: PROC [rules: SRules, layer: CD.Layer] RETURNS [w: CD.Number] = {
ir: IRules ~ CDSimpleRulesBackdoor.GetRulesRep[rules];
w ← DesignRules.MinWidth[NARROW[ir.data], CDLayers.AbstractToPaint[layer]
! DesignRules.DesignRuleError => {w𡤀 CONTINUE}
].w;
};
SMaxWidth: PROC [rules: SRules, layer: CD.Layer] RETURNS [w: CD.Number] = {
ir: IRules ~ CDSimpleRulesBackdoor.GetRulesRep[rules];
w ← DesignRules.MaxWidth[NARROW[ir.data], CDLayers.AbstractToPaint[layer]
! DesignRules.DesignRuleError => {w𡤀 CONTINUE}
].w;
};
SMinSpace: PROC [rules: SRules, l1, l2: CD.Layer] RETURNS [w: CD.Number] = {
ir: IRules ~ CDSimpleRulesBackdoor.GetRulesRep[rules];
w ← DesignRules.MinSpace[NARROW[ir.data], CDLayers.AbstractToPaint[l1], CDLayers.AbstractToPaint[l2]
! DesignRules.DesignRuleError => {w𡤀 CONTINUE}
].s;
};
SGetValue: PROC [rules: SRules, id: ATOM] RETURNS [v: CD.Number] = {
ir: IRules ~ CDSimpleRulesBackdoor.GetRulesRep[rules];
v ← DesignRules.GetScaledValue[NARROW[ir.data], id
! DesignRules.DesignRuleError => ERROR CDSimpleRules.NotKnown
].v;
};
SGetRuleDescription: PROC [rules: SRules, id: ATOM] RETURNS [r: Rope.ROPENIL] = {
ir: IRules ~ CDSimpleRulesBackdoor.GetRulesRep[rules];
r ← DesignRules.GetScaledValue[NARROW[ir.data], id
! DesignRules.DesignRuleError => {r ← NIL; CONTINUE}
].d;
};
DefineRules: PUBLIC PROC [key: ATOM, rules: DesignRules.Rules] = {
CDSimpleRulesBackdoor.RegisterRules[[
key: key,
data: rules,
technology: rules.technology,
minWidth: SMinWidth,
minSpace: SMinSpace,
maxWidth: SMaxWidth,
getValue: SGetValue,
getRuleDescription: SGetRuleDescription
]];
};
END.