DIRECTORY OrderedSymbolTableRef USING[Table], Misc USING [Interval], IPParams USING[ChDefaultWidth], IPCTG USING [Ref, ChType], IPCoTab USING [Component], IPCoVerifier USING [Ref]; IPCTGMaker: CEDAR DEFINITIONS IMPORTS IPParams = BEGIN Ref: TYPE = REF Rep; Rep: TYPE = RECORD[comps: CompItems, horPreChs, verPreChs: OrderedSymbolTableRef.Table, xMin, yMin, xMax, yMax: INT]; CompItems: TYPE = REF CompItemsRep; CompItemsRep: TYPE = RECORD[count: NAT _ 0, compItems: ARRAY CompItemIndices OF CompItem _ ALL [NIL]]; CompItemIndices: TYPE = [1..MaxCompItemCnt]; MaxCompItemCnt: NAT = 100; --%Restriction on maximum number of Components%-- MaxClusterCnt: NAT = 200; --%Restriction on maximum number of Channels%-- CompItem: TYPE = REF CompItemRep; CompItemRep: TYPE = RECORD[co: IPCoTab.Component, prinPreChs: RECORD [south, east, north, west: PreCh _ NIL], cornerPreChs: RECORD[sw, se, ne, nw: CornerPreChs _ NIL]]; CornerPreChs:TYPE = REF CornerPreChsRep; CornerPreChsRep: TYPE = RECORD[hor, ver: PreCh]; PreCh: TYPE = REF PreChRep; PreChRep: TYPE = RECORD[type: IPCTG.ChType, posComp: BOOL, coord: INT, span, range: Misc.Interval, comp: IPCoTab.Component, negBnd, posBnd: PreCh, cluster: NAT _ 0]; Create: PROC[] RETURNS[Ref]; Destroy: PROC [r: Ref]; --This frees up any cyclic pointers and invalidates the instance. -- Needed because an instance of IPCTGMaker can be reused as often as desired. ConstructCTG: PROC[r: Ref, cV: IPCoVerifier.Ref, chWidth: INT _ IPParams.ChDefaultWidth, yPrimary, maxChWidth: BOOL _ TRUE] RETURNS[needGeom: BOOL _ FALSE, ctg: IPCTG.Ref]; --Assumed that the instance of IPCoVerifier has verified that there are no overlaps among -- the components. If yPrimary is true then the output will tend to have more long vertical -- running channels else it will give more long horizontal running channels. 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.) The output is an instance of Channel Topology -- Graph with the coordinates of all the channels assigned. If needGeom is true this -- means that ctg has to be geometrized (ie. the channel position has to be reassigned) -- otherwise some channels may intersect with the components. This arises mostly -- because the input configuration of components does not permit the construction -- of a valid channels structure without moving some components END. ž-- File: IPCTGMaker.mesa -- Last Edited by: CSChow, February 2, 1985 1:53:21 am PST changed definition ConstructCTG November 30, 1987 2:42:26 pm PST --Intro: This purpose of this interface is to construct the Channel Topology Graph -- (ie. Channel Definition) given as input a collection of components of known positions. -- It takes as input an instance of IPCoVerifier, which is assumed to have verified that -- there are no overlappings in the components and output an instance of -- ChannelsTopologyGraph with the coordinates of the channels assigned. -- Intro: The sole reasons for not making most of the fields below opaque is to -- simply debugging. Κ˜Jšœ™Jšœ:™:IcodešœΟn œ!™@J˜JšœS™SJšœZ™ZJšœY™YJšœH™HJšœG™GJ˜šΟk ˜ Jšœžœ˜#Jšœžœ ˜Jšœ žœ˜Jšžœžœ˜Jšœžœ ˜Jšœ žœ˜—J˜J˜šœ žœž œ˜Jšžœ ž˜J™J™PJ™J™Jšœžœžœ˜Jšœžœžœ^žœ˜uJ˜Jšœ žœžœ˜#Jšœžœžœžœžœžœ žœžœ˜fJ˜Jšœžœ˜,Jšœžœ Οc1˜MK– "Cedar" stylešœžœŸ/˜IJ˜J˜Jšœ žœžœ ˜!Jš œ žœžœ$žœ$žœžœ žœ˜¨J˜Jšœ žœžœ˜(K– "Cedar" stylešœžœžœ˜0K– "Cedar" style˜K– "Cedar" stylešœžœžœ ˜K– "Cedar" styleš œ žœžœžœžœ žœWžœ˜¦K– "Cedar" style˜J˜Jšœžœžœ˜J˜Jšœžœ ˜JšŸB˜BJšœŸK˜NJ˜Jš œžœ(žœ2žœžœžœ žœžœžœŸZ˜‡JšœŸY˜\JšœŸX˜[JšœŸ[˜^JšœŸX˜[JšœŸW˜ZJšœŸR˜UJšœŸU˜XJšœŸN˜QJšœŸO˜RJšœŸ<˜?J˜Jšžœ˜——…— ϊ§