-- File: DJExtDebug.mesa -- Test program for generating disjoint cells -- Written by Martin Newell/Dan Fitzpatrick February 1981 -- Last edited: August 6, 1981 2:26 PM DIRECTORY DJExtDefs: FROM "DJExtDefs", DJExtCombineDefs: FROM "DJExtCombineDefs" USING [Combine, AttachNode, GetNode], DJExtDebugDefs: FROM "DJExtDebugDefs", DJExtMergeDefs: FROM "DJExtMergeDefs" USING [InitMerge, Merge, Lookup], DJExtTransDefs: FROM "DJExtTransDefs", DJExtTypes: FROM "DJExtTypes", DJExtUtilsDefs: FROM "DJExtUtilsDefs" USING [WriteLongDecimal], IODefs: FROM "IODefs", JaMFnsDefs: FROM "JaMFnsDefs" USING [Register, PopInteger]; DJExtDebug: PROGRAM IMPORTS DJExtCombineDefs, DJExtMergeDefs, DJExtTransDefs, DJExtUtilsDefs, IODefs, JaMFnsDefs EXPORTS DJExtDefs, DJExtDebugDefs = BEGIN OPEN DJExtCombineDefs, DJExtMergeDefs, DJExtTransDefs, DJExtTypes, DJExtUtilsDefs, IODefs, JaMFnsDefs; PrintTransistors: PROCEDURE = BEGIN trans,next:Node; FOR trans _ GetTransistorList[],next UNTIL trans = NIL DO next _ trans.next; IF trans.type # Transistor THEN WriteLine["bad transistor"]; WriteString["t ("]; WriteLongDecimal[Lookup[trans.node]]; WriteString[") "]; WriteLongDecimal[Lookup[trans.poly]]; FOR p: Diffusion _ trans.diff,p.next UNTIL p = NIL DO WriteString[" "]; WriteLongDecimal[Lookup[p.node]]; ENDLOOP; ReleaseTransistor[trans]; WriteLine[""]; ENDLOOP; WriteLine["---------------------------"]; END; CallCombine: PROCEDURE = BEGIN n,n1,n2:NodeNumber; i,j: INTEGER; j _ PopInteger[]; i _ PopInteger[]; n1 _ LOOPHOLE[LONG[i]]; n2 _ LOOPHOLE[LONG[j]]; n _ Combine[n1,n2]; WriteLongDecimal[n]; WriteLine[""]; END; CallAttachNode: PROCEDURE = BEGIN n,n1,n2:NodeNumber; i,j: INTEGER; j _ PopInteger[]; i _ PopInteger[]; n1 _ LOOPHOLE[LONG[i]]; n2 _ LOOPHOLE[LONG[j]]; AttachNode[n1,n2]; n _ GetNode[n1]; WriteLongDecimal[n]; WriteLine[""]; END; CallGetNode: PROCEDURE = BEGIN n,n1:NodeNumber; i: INTEGER; i _ PopInteger[]; n1 _ LOOPHOLE[LONG[i]]; n _ GetNode[n1]; WriteLongDecimal[n]; WriteLine[""]; END; CallLookup: PROCEDURE = BEGIN n,n1:NodeNumber; i: INTEGER; i _ PopInteger[]; n1 _ LOOPHOLE[LONG[i]]; n _ Lookup[n1]; WriteLongDecimal[n]; WriteLine[""]; END; CallMerge: PROCEDURE = BEGIN n,n1,n2:NodeNumber; i,j: INTEGER; j _ PopInteger[]; i _ PopInteger[]; n1 _ LOOPHOLE[LONG[i]]; n2 _ LOOPHOLE[LONG[j]]; n _ Merge[n1,n2]; WriteLongDecimal[n]; WriteLine[""]; END; TestMerge: PROCEDURE = BEGIN i,j:NodeNumber; FOR i _ 230,i-10 UNTIL i <= 0 DO FOR j _ 1,j+2 UNTIL j > 9 DO [] _ Merge[i+j,i+j+10]; [] _ Merge[256 - (i+j+1),256 - (i+j+11)]; ENDLOOP; ENDLOOP; FOR j IN [201..220] DO WriteLongDecimal[j]; WriteString[" becomes "]; WriteLongDecimal[Lookup[j]]; WriteLine[""]; ENDLOOP; END; ToggleDebug: PUBLIC PROCEDURE = BEGIN WriteString["debugging mode is "]; IF debug THEN { debug _ FALSE; WriteLine["off"]; } ELSE { debug _ TRUE; WriteLine["on"]; }; END; Debug: PUBLIC PROCEDURE RETURNS[BOOLEAN] = BEGIN RETURN[debug]; END; debug:BOOLEAN _ TRUE; ExtInit: PUBLIC PROCEDURE = BEGIN -- dummy procedure END; ExtDebug: PUBLIC PROCEDURE = BEGIN WriteLine["loaded: combine, attach, get, lookup, merge, & testmerge"]; InitMerge[]; END; Register["combine",CallCombine]; Register["attach",CallAttachNode]; Register["get",CallGetNode]; Register["lookup",CallLookup]; Register["merge",CallMerge]; Register["testmerge",TestMerge]; Register["debug",ToggleDebug]; END. e6(635)\169b10B441b10B250b16B529b11B209b14B226b11B157b10B156b9B207b9B334b11B172b5B90b7B31i15I8b8B