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: NAT _ 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 --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šœ:™: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˜MIcode– "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šΟnœœœ˜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šœ˜——…— ϊZ