-- File: DJExtCombine.mesa -- combine routines used by the disjoint circuit extractor -- Written by Martin Newell/Dan Fitzpatrick July 1981 -- Last edited: August 3, 1981 1:46 PM DIRECTORY DJExtCapDefs: FROM "DJExtCapDefs" USING [FindCap, CombineCap], DJExtCombineDefs: FROM "DJExtCombineDefs", DJExtMergeDefs: FROM "DJExtMergeDefs" USING [Lookup, Merge, GetProp, PutProp], DJExtTransDefs: FROM "DJExtTransDefs" USING [FindTransistor, CombineTransistors], DJExtTypes: FROM "DJExtTypes" USING [Node, NodeNumber, diff, poly, metal, gate], Runtime: FROM "Runtime" USING [CallDebugger]; DJExtCombine: PROGRAM IMPORTS DJExtCapDefs, DJExtMergeDefs, DJExtTransDefs, Runtime EXPORTS DJExtCombineDefs = BEGIN OPEN DJExtCapDefs, DJExtMergeDefs, DJExtTransDefs, DJExtTypes, Runtime; Combine: PUBLIC PROCEDURE [n1,n2:NodeNumber] RETURNS[n:NodeNumber] = BEGIN p,p1,p2: Node; n1 _ Lookup[n1]; n2 _ Lookup[n2]; IF n1 = n2 THEN RETURN[n1]; p1 _ GetProp[n1]; p2 _ GetProp[n2]; n _ Merge[n1,n2]; p _ CombineNodes[p1,p2]; IF p # NIL THEN p.node _ n; PutProp[n1,nil]; PutProp[n2,nil]; PutProp[n,p]; END; CombineNodes: PUBLIC PROCEDURE [n1,n2:Node] RETURNS[n:Node] = BEGIN IF n1 = NIL THEN RETURN[n2]; IF n2 = NIL THEN RETURN[n1]; IF n1.type # n2.type THEN CallDebugger["type conflict in CombineNodes"]; SELECT n1.type FROM Transistor => n _ CombineTransistors[n1,n2]; Capacitor => n _ CombineCap[n1,n2]; ENDCASE => CallDebugger["Unknown case in CombineNodes"]; END; AttachNode: PUBLIC PROCEDURE [num:NodeNumber, node:Node] = BEGIN tmp: Node; num _ Lookup[num]; tmp _ GetProp[num]; IF tmp # NIL THEN node _ CombineNodes[node,tmp]; PutProp[num,node]; END; GetNode: PUBLIC PROCEDURE [num:NodeNumber] RETURNS[node:Node] = BEGIN num _ Lookup[num]; node _ GetProp[num]; END; FindNode: PUBLIC PROCEDURE [num:NodeNumber, layer:INTEGER, x,y:REAL] RETURNS[node:Node] = BEGIN node _ GetNode[num]; IF node # NIL THEN RETURN; SELECT layer FROM gate => { node _ FindTransistor[num,0,0]; RETURN; }; poly,diff,metal => { node _ FindCap[num]; RETURN; }; ENDCASE => CallDebugger["Bad layer in FindNode"]; END; nil: LONG POINTER _ NIL; END. (672)\180b10B400b12B179b8B318b13B362b10B185b7B112b8B