DIRECTORY CD, CStitching, CDCells, CDCommandOps, CDSequencer, CDInstances, CDDirectory, TerminalIO, OverlapRemover; OverlapRemoverImpl: CEDAR PROGRAM IMPORTS CStitching, CDCells, CDCommandOps, CDInstances, CDDirectory, CDSequencer, TerminalIO EXPORTS OverlapRemover = BEGIN OverlapLayerRec: TYPE = RECORD [ technology: CD.Technology, keepLayer: CD.Layer, throwAwayLayer: CD.Layer ]; overlapLayerList: LIST OF REF OverlapLayerRec _ NIL; --contains registered abstract Layers RegionList: TYPE = LIST OF REF CStitching.Region; OverlapRemover: PUBLIC PROC [cellOb: CD.Object, design: CD.Design] = BEGIN WITH cellOb.specific SELECT FROM cp: CD.CellSpecific => { OverlapRemoverCell[design, cellOb]; [] _ CDCells.ResizeCell[design, cellOb]; CDDirectory.PropagateChange[cellOb, design]; }; ENDCASE => NULL; END; OverlapAllLevels: PROC [design: CD.Design] = BEGIN DoIt: CDDirectory.EachEntryAction = { OverlapRemover[cellOb: ob, design: design] }; [] _ CDDirectory.Enumerate[design, DoIt]; OverlapRemover[design.actual.first.dummyCell.ob, design]; END; OverlapAllCommand: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.PutRope["Overlap removal on all levels\n"]; OverlapAllLevels[design: comm.design]; TerminalIO.PutRope["Removal Finished\n"]; END; OverlapRemoverCell: PROC [design: CD.Design, cellOb: CD.Object] = BEGIN FOR layerList: LIST OF REF OverlapLayerRec _ overlapLayerList, layerList.rest WHILE layerList #NIL DO IF layerList.first.technology = design.technology THEN { keepPlane: CStitching.Tesselation _ CStitching.NewTesselation[]; FillPlaneFromWires[cellOb, layerList.first.keepLayer, keepPlane]; CompareWiresAgainstPlane[design, cellOb, layerList.first.throwAwayLayer, keepPlane]; }; ENDLOOP; END; FillPlaneFromWires: PROC [cellOb: CD.Object, layer: CD.Layer, plane: CStitching.Tesselation] = BEGIN EachInstance: CDCells.InstEnumerator = { IF inst.ob.class.wireTyped AND inst.ob.layer = layer THEN CStitching.ChangeRect[plane: plane, rect: CDInstances.InstRectI[inst], new: $cover]; }; [] _ CDCells.EnumerateInstances[cellOb, EachInstance]; END; CompareWiresAgainstPlane: PROC [design: CD.Design, cellOb: CD.Object, layer: CD.Layer, plane: CStitching.Tesselation] = BEGIN removeList: CD.InstanceList _ NIL; EachInstance: CDCells.InstEnumerator = { IF inst.ob.class.wireTyped AND inst.ob.layer = layer AND RectCoveredCompletely[CDInstances.InstRectI[inst], plane] THEN removeList _ CONS[inst, removeList]; }; [] _ CDCells.EnumerateInstances[cellOb, EachInstance]; FOR il: CD.InstanceList _ removeList, il.rest WHILE il #NIL DO [] _ CDCells.RemoveInstance[design: design, cell: cellOb, inst: il.first]; ENDLOOP; END; RectCoveredCompletely: PROC [rect: CD.Rect, plane: CStitching.Tesselation] RETURNS [BOOL _ TRUE] = BEGIN FOR rectList: RegionList _ CStitching.ListArea[plane: plane, rect: rect, skip: $none], rectList.rest WHILE rectList #NIL DO IF rectList.first.value = NIL THEN RETURN[FALSE]; ENDLOOP; END; RegisterOverlapLayers: PUBLIC PROC [technology: CD.Technology, keepLayer: CD.Layer, throwAwayLayer: CD.Layer] = BEGIN overlapLayerList _ CONS[NEW[OverlapLayerRec _ [technology, keepLayer, throwAwayLayer]], overlapLayerList]; END; CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "Overlap Remover All", key: $OverlapAll]; CDSequencer.ImplementCommand[key: $OverlapAll, proc: OverlapAllCommand, queue: doQueue]; END. OverlapRemoverImpl.mesa Last Edited by: Gbier, July 11, 1985 12:181:45 pm PDT Last Edited by: Gbier, August 8, 1985 2:21:51 pm PDT Last edited by: Christian Jacobi, November 4, 1986 5:38:08 pm PST Jacobi, March 19, 1986 5:39:56 pm PST --Its not clear that an Overlap Remover on the Top level is a useful command, but if someone wants it just uncomment the below OverlapTopCommand: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.PutRope["Overlap removal on top level\n"]; OverlapRemover[comm.design.actual.first.dummyCell.ob, comm.design]; TerminalIO.PutRope["Removal Finished\n"]; END; CDMenus.CreateEntry[menu: $ProgramMenu, entry: "Overlap Remover Top", key: $OverlapTop]; CDSequencer.ImplementCommand[key: $OverlapTop, p: OverlapTopCommand, queue: doQueue]; Κf˜šœ™Jšœ5™5Jšœ4™4Icode™AK™%—J˜šΟk ˜ Jšœ˜Jšœ ˜ J˜J˜ J˜ J˜ J˜ J˜ J˜—J˜šΟbœœ˜!JšœV˜]Jšœ˜—Jšœ˜J˜šœœœ˜ Jšœ œ ˜Jšœ œ˜Jšœœ˜J˜J˜—Jš œœœœœΟc%˜[J˜Jš œ œœœœ˜1J˜š Οnœœœ œœ ˜DJš˜šœœ˜ šœœ˜J˜#J˜(Jšœ,˜,J˜——Jšœœ˜Jšœ˜—J˜š œœ œ ˜,Jš˜šžœ!˜%Jšœ*˜*Jšœ˜—Jšœ)˜)Jšœ:˜:Jšœ˜—J˜š œœ˜5Jš˜Jšœ6˜6Jšœ&˜&J˜)Jšœ˜—J˜šΠbnœœ œœ ˜AJš˜š œ œœœ4œ œ˜ešœ0œ˜8Jšœ@˜@J˜AJ˜TJ˜—Jšœ˜—Jšœ˜—J˜š‘œœ œœ(˜^Jš˜š  œ˜(šœœœ˜:JšœT˜T—J˜—Jšœ6˜6Jšœ˜—J˜š ‘œœ œœœ(˜wJš˜Jšœ œœ˜"š  œ˜(šœœœ;˜wJšœ œ˜$—J˜—Jšœ6˜6š œœ$œœ˜>J˜JJšœ˜ —Jšœ˜—J˜š‘œœœ œœœœ˜bJš˜šœbœ œ˜{šœœœ˜#Jšœœ˜—Jšœ˜—Jšœ˜J˜—š  ‘žœœœœœœ ˜pJš˜JšœœœO˜jJšœ˜—J˜Jšœ~™~J˜š‘œœ™5Jš™Jšœ5™5JšœC™CJ™)Jšœ™—JšœX™XJšœU™UJ™J˜Jšœb˜bJšœX˜XJ˜Jšœ˜—…— *–