DIRECTORY Imager USING [Context], IPCTG USING[Ref, Channel, ChType], Misc USING [Rect], IPConstants USING [White], IPParams USING [ChDefaultWidth, ChDefaultPositionX, ChDefaultPositionY], RefStack USING [Ref], IPCoTab USING[Ref], IPTypeTab, IPNetTab, IPPortTab, IPChipRose, Rope, RTStructure; 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]; CreateFromStructure: PROC[structure: RTStructure.Structure] RETURNS[Ref]; DestroySelf: PROC [top: Ref]; ReDefineChs: PROC[top: Ref, chWidth: NAT _ IPParams.ChDefaultWidth, yPrimary, maxChWidth: BOOL _ FALSE] RETURNS [Ref]; ClearChannels: PROC[top: Ref]; DescribeSelf: PROC[top: Ref, file: Rope.ROPE]; PaintSelf: PROC[top: Ref, context: Imager.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]; CheckSelf: PROC[top: Ref]; ConstraintChannels: PROC[top: Ref, negCh, posCh: IPCTG.Channel, wt: INT]; ClearConstraints: PROC[top: Ref, negCh: IPCTG.Channel, posCh: IPCTG.Channel _ NIL]; ClearAllConstraints: PROC[top: Ref]; NoTopology: PROC[top: Ref] RETURNS [BOOL]; Geometrize: PROC [top: Ref, xPosition: INT _ IPParams.ChDefaultPositionX, yPosition: INT _ IPParams.ChDefaultPositionY, horPosSense, verPosSense: BOOL _ TRUE]; 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 Preas, August 27, 1986 11:51:03 am PDT -- This is the top leve interface. -- Create top from chipRose --Create from desc file. See Impl -- Create top from chipRose --Clean up circular garbage ! 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-- --Destroy (and only) top.ctg (the channels) in the system. -- So after ClearChannels[top], NoTopology[top] is always TRUE Create a recoverable textual description of self. Used for creating checkpoint-- --compStipple is stipple used to paint components --showChNames => channel names will be shown -- showCompNames => component names will be shown 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. -- Used for debugging. No longer maintained Set a (directed) external constraint between negCh and posCh, will ERROR CyclicConstraint if resultant constraint is cyclic. Clear the constraint from negCh to posCh, if posCh = NIL then clear ALL constraints from negCh Removes all external constraints --Check if top has channels or not 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 Κ:˜Jšœ™šœ:™:Icode™&—J˜J™JšΟc#™#šΟk ˜ K– "Cedar" stylešœžœ ˜Jšžœžœ˜"Jšœžœ˜Jšœ žœ ˜Jšœ žœ:˜HJšœ žœ˜Jšœžœ˜Jšœ ˜ Jšœ ˜ J˜ Jšœ ˜ Jšœ˜Jšœ ˜ —J˜J˜šΟnœžœž œ˜Jšžœ ž˜J˜Jšœžœžœ˜šœžœžœ˜Jšœ ˜4Jšœ˜'Jšœžœ˜Jšœ˜'Jšœ˜$Jšœ:˜OJšœ žœžœ9˜UJšœ*žœ žœ˜QJšœ˜—J˜JšŸœžœžœ ˜5JšŸœžœ žœžœ ˜9J˜šŸœžœžœ˜4Jšœ™—J˜šŸœžœžœžœ˜=K™!—K˜šŸœžœ#žœ˜IJšœ™J™—šŸ œžœ ˜K™—K˜š Ÿ œžœžœ2žœžœžœ˜wKšœN™NKšœG™GKšœH™HKšœG™GKšœR™RKšœP™PKšœS™SKšœ?™?—K˜šŸ œžœ ˜Kšœ;™;Kšœ Ÿ œŸ œŸœ™?—K˜– "Cedar" stylešŸ œžœžœ˜/K– "Cedar" stylešœP™P—J˜šŸ œžœ6žœžœžœ@žœžœ˜ΝJšœ $™1Jšœ,™,Jšœ1™1—J˜– "Cedar" stylešŸœžœ žœžœ ˜;K– "Cedar" stylešœY™YK– "Cedar" stylešœD™D—J˜šŸ œžœ ˜J™+—J˜šŸœžœžœžœ˜JJšœC™CJšœ:™:—K˜š Ÿœžœžœžœ žœ˜TKšœH™HKšœ™—K˜šŸœžœ ˜%Kšœ ™ —K˜•StartOfExpansion[]šŸ œžœ žœžœ˜*K™"—J˜š Ÿ œžœžœ+žœ<žœžœ˜’JšœU™UJšœQ™QJšœO™OJšœP™PJšœ!™!—J˜KšŸœžœ žœžœ˜#KšŸœžœ žœžœ˜#KšŸœžœ žœžœ˜#J˜K– "Cedar" stylešŸ œžœžœžœ#žœžœžœ ˜ƒK– "Cedar" stylešŸœžœžœ ˜1K– "Cedar" stylešŸœžœžœ ˜IK– "Cedar" stylešŸœžœžœ  ˜CJ˜Jšžœ˜——…— ήH