DIRECTORY Graphics USING [Context], IPCTG USING[Ref, Channel, ChType], Misc USING [Rect], Rope USING [ROPE], IPConstants USING [White], IPParams USING [ChDefaultWidth, ChDefaultPositionX, ChDefaultPositionY], RefStack USING [Ref], IPCoTab USING[Ref], IPTypeTab, IPNetTab, IPPortTab, IPChipRose; IPTop: CEDAR DEFINITIONS IMPORTS IPParams = BEGIN Ref: TYPE = REF Rep; Rep: TYPE = RECORD[ coTab: IPCoTab.Ref, --Tables of components/instances ports: IPPortTab.Ref, --Tables of ports ctg: IPCTG.Ref, -- of Channels types: IPTypeTab.Ref, --Tables of types nets: IPNetTab.Ref, --Tables of nets undoStack, redoStack, horOldChs, verOldChs: RefStack.Ref, -- supports undo/redo initialized: BOOL _ FALSE, -- false implies need to call InitTop. Handled internally southMost, eastMost, northMost, westMost: IPCTG.Channel _ NIL -- bounding chanels ]; CyclicConstraint: ERROR[negCh, posCh: IPCTG.Channel]; ComponentsOverlapped: ERROR[overlaps: LIST OF Misc.Rect]; Create: PROC[chipRose: IPChipRose.Ref] RETURNS[Ref]; Create1: PROC[defaultDir, descFile: Rope.ROPE] RETURNS [Ref]; DestroySelf: PROC [top: Ref]; ReDefineChs: PROC[top: Ref, chWidth: NAT _ IPParams.ChDefaultWidth, yPrimary, maxChWidth: BOOL _ FALSE] RETURNS [Ref]; --! Raise ComponentsOverlap. This construct the ChannelIPTopologyGraph based on -- the shape and positions of the components in the coTab. chWidth is the -- default channel width. If maxChWidth is true then the width of the each -- constructed channel will be set to the maximum possible without moving -- the components else all channels will be set to chWidth (In any case all channels -- will be at least chWidth wide.) If yPrimary is true then the resultant channels -- will tend to give long vertical channels else it will tend to give long horizontal -- channels. IPTop is the same instance, only top.ctg is changed-- ClearChannels: PROC[top: Ref]; DescribeSelf: PROC[top: Ref, file: Rope.ROPE]; --Create a recoverable textual description of self. Used for creating checkpoint-- PaintSelf: PROC[top: Ref, context: Graphics.Context, xOffset, yOffset: REAL _ 0.0, scaleFactor: REAL _ 1.0, compStipple: CARDINAL _ IPConstants.White, showChNames, showCompNames, showPinNames: BOOL _ TRUE]; ReconstructSelf: PROC[file: Rope.ROPE] RETURNS [top: Ref]; -- Create the top based on the textual description in file. The reconstruction is `perfect' -- except for some statistical info. and ref's are are longer the same. CheckSelf: PROC[top: Ref]; ConstraintChannels: PROC[top: Ref, negCh, posCh: IPCTG.Channel, wt: INT]; --Set a (directed) external constraint between negCh and posCh, will -- ERROR CyclicConstraint if resultant constraint is cyclic. ClearConstraints: PROC[top: Ref, negCh: IPCTG.Channel, posCh: IPCTG.Channel _ NIL]; --Clear the constraint from negCh to posCh, if posCh = NIL then clear ALL -- constraints from negCh ClearAllConstraints: PROC[top: Ref]; -- Removes all external constraints NoTopology: PROC[top: Ref] RETURNS [BOOL]; Geometrize: PROC [top: Ref, xPosition: INT _ IPParams.ChDefaultPositionX, yPosition: INT _ IPParams.ChDefaultPositionY, horPosSense, verPosSense: BOOL _ TRUE]; -- Compute/update the Geomterical information (eg. coordinates and slacks of channels.) -- If horPosSense is true then the horizontal channels will be computed from bottom -- upward else they will be computed from top to down. Similarly for verPosSense. -- xPosition and yPosition specifies the starting coordinates for the leftmost and -- bottommost channels respectively XDim: PROC[top: Ref] RETURNS [INT]; YDim: PROC[top: Ref] RETURNS [INT]; Area: PROC[top: Ref] RETURNS [INT]; CreateChannel: PROC[top: Ref, type: IPCTG.ChType, width: NAT _ IPParams.ChDefaultWidth, coord: INT _ 0] RETURNS[ch: IPCTG.Channel]; DestroyChannel: PROC[top:Ref, ch: IPCTG.Channel]; ReActivateChannel: PROC[top: Ref, ch: IPCTG.Channel]; --put the ch back-- DeActivateChannel: PROC[top: Ref, ch: IPCTG.Channel]; --remove ch. END. 0-- File: IPTop.mesa -- Last Edited by: CSChow, February 1, 1985 8:40:33 am PST -- This is the top leve interface. -- Create top from chipRose --Create from desc file. See Impl --Clean up circular garbage --Destroy (and only) top.ctg (the channels) in the system. -- So after ClearChannels[top], NoTopology[top] is always TRUE --compStipple is stipple used to paint components --showChNames => channel names will be shown -- showCompNames => component names will be shown -- Used for debugging. No longer maintained --Check if top has channels or not Κ+˜Jšœ™Jšœ:™:J˜J™JšΟc#™#šΟk ˜ Icode– "Cedar" stylešœ žœ ˜Jšžœžœ˜"Jšœžœ˜Jšœžœžœ˜Jšœ žœ ˜Jšœ žœ:˜HJšœ žœ˜Jšœžœ˜Jšœ ˜ Jšœ ˜ J˜ Jšœ ˜ —J˜J˜šœžœž œ˜Jšžœ ž˜J˜Jšœžœžœ˜šœžœžœ˜Jšœ ˜4Jšœ˜'Jšœžœ˜Jšœ˜'Jšœ˜$JšœO˜OJšœ žœžœ9˜UJšœ*žœ žœ˜QJšœ˜—J˜Jšœžœžœ ˜5Jšœžœ žœžœ ˜9J˜šΟnœžœžœ˜4Jšœ™—J˜šŸœžœ"žœ˜=K™!—K˜šŸ œžœ ˜K™—K˜š Ÿ œžœžœ2žœžœžœ˜wKšP˜PKšœG˜KKšœH˜LKšœG˜KKšœR˜VKšœP˜SKšœS˜VKšœ?˜C—K˜šŸ œžœ ˜Kšœ;™;Kšœ Ÿ œŸ œŸœ™?—K˜– "Cedar" stylešŸ œžœžœ˜/K– "Cedar" stylešR˜R—J˜šŸ œžœ8žœžœžœ@žœžœ˜ΟJšœ $™1Jšœ,™,Jšœ1™1—J˜– "Cedar" stylešŸœžœ žœžœ ˜;K– "Cedar" styleš\˜\K– "Cedar" stylešœD˜H—J˜šŸ œžœ ˜J™+—J˜šŸœžœžœžœ˜JJšE˜EJšœ:˜>—K˜š Ÿœžœžœžœ žœ˜TKšJ˜JKšœ˜—K˜šŸœžœ ˜%Kš#˜#—K˜•StartOfExpansion[]šŸ œžœ žœžœ˜*K™"—J˜š Ÿ œžœžœ+žœ<žœžœ˜’JšX˜XJšœQ˜TJšœO˜RJšœP˜SJšœ!˜$—J˜KšŸœžœ žœžœ˜#KšŸœžœ žœžœ˜#KšŸœžœ žœžœ˜#J˜K– "Cedar" stylešŸ œžœžœžœ#žœžœžœ ˜ƒK– "Cedar" stylešŸœžœžœ ˜1K– "Cedar" stylešŸœžœžœ ˜IK– "Cedar" stylešŸœžœžœ  ˜CJ˜Jšžœ˜——…—–ρ