DIRECTORY Pipal, PipalCore, PipalInt, PipalMos, PipalSinix, RefTab; PipalSinixCMosB: CEDAR PROGRAM IMPORTS Pipal, PipalCore, PipalInt, PipalMos, PipalSinix, RefTab = BEGIN mode: PipalSinix.Mode _ NEW [PipalSinix.ModeRec _ [ extractMethod: Pipal.RegisterMethod["CMosBExtraction"], extractProcProp: $CMosBExtractProc, decoration: PipalCore.CreateDecoration["CMosB"], objectEqualProc: PipalSinix.AlwaysTrue, nbOfLayers: nbOfInterestingLayers, objectLayer: ObjectLayer, touchProc: Touch, nameProc: PipalSinix.DefaultName ]]; Touch: PipalCore.TouchProc = { IsRect: PROC [object: Pipal.Object, layer: PipalMos.Layer] RETURNS [BOOL] = INLINE { IF NOT ISTYPE [object, PipalMos.Box] THEN RETURN [FALSE]; RETURN [NARROW [object, PipalMos.Box].layer=layer]; }; ChangeRect: PROC [object: Pipal.Object, layer: PipalMos.Layer] RETURNS [Pipal.Object] = { box: PipalMos.Box = NARROW [object]; RETURN [PipalMos.CreateBox[box.size, layer]]; }; IF IsRect[object1, $PwellCont] THEN RETURN [ touch[touch, trans1, ChangeRect[object1, $Pwell], trans2, object2] OR touch[touch, trans1, ChangeRect[object1, $Pdif], trans2, object2] ]; IF IsRect[object1, $NwellCont] THEN RETURN [ touch[touch, trans1, ChangeRect[object1, $Nwell], trans2, object2] OR touch[touch, trans1, ChangeRect[object1, $Ndif], trans2, object2] ]; IF IsRect[object2, $PwellCont] THEN RETURN [ touch[touch, trans2, ChangeRect[object2, $Pwell], trans1, object1] OR touch[touch, trans2, ChangeRect[object2, $Pdif], trans1, object1] ]; IF IsRect[object2, $NwellCont] THEN RETURN [ touch[touch, trans2, ChangeRect[object2, $Nwell], trans1, object1] OR touch[touch, trans2, ChangeRect[object2, $Ndif], trans1, object1] ]; IF IsRect[object1, $Met2] AND IsRect[object2, $Ovg] THEN RETURN [ PipalInt.IsInsideRectangle[PipalInt.BBox[object1, trans1], PipalInt.BBox[object2, trans2]] ]; IF IsRect[object1, $Ovg] AND IsRect[object2, $Met2] THEN RETURN [ PipalInt.IsInsideRectangle[PipalInt.BBox[object2, trans2], PipalInt.BBox[object1, trans1]] ]; RETURN PipalCore.Touch[touch, trans1, object1, trans2, object2]; }; nbOfInterestingLayers: NAT = 10; defaultLayerRange: PipalSinix.LayerRange = [min: 0, max: nbOfInterestingLayers-1]; interestingLayers: RefTab.Ref _ RefTab.Create[]; Interestinglayers: PROC [layer: PipalMos.Layer] RETURNS [PipalSinix.LayerRange] = { refLayerRange: REF PipalSinix.LayerRange _ NARROW [RefTab.Fetch[interestingLayers, layer].val]; RETURN [IF refLayerRange=NIL THEN defaultLayerRange ELSE refLayerRange^]; }; SetInterestinglayers: PROC [layer: PipalMos.Layer, range: PipalSinix.LayerRange] = { [] _ RefTab.Store[interestingLayers, layer, NEW [PipalSinix.LayerRange _ range]]; }; ObjectLayer: PROC [object: Pipal.Object] RETURNS [layerRange: PipalSinix.LayerRange] = { EachChild: PipalInt.EachChildProc = { thisLayerRange: PipalSinix.LayerRange _ WITH child SELECT FROM box: PipalMos.Box => Interestinglayers[box.layer], marker: PipalMos.Marker => Interestinglayers[marker.layer], text: PipalMos.Text => [nbOfInterestingLayers-1, 0], picture: PipalMos.Picture => [nbOfInterestingLayers-1, 0], ENDCASE => ERROR; layerRange _ [min: MIN [thisLayerRange.min, layerRange.min], max: MAX [thisLayerRange.max, layerRange.max]]; IF layerRange=defaultLayerRange THEN quit _ TRUE; }; layerRange _ [nbOfInterestingLayers-1, 0]; [] _ PipalMos.EnumerateAtomic[object, EachChild]; IF layerRange.min>layerRange.max THEN layerRange _ defaultLayerRange; }; Set: PROC [class: Pipal.Class, proc: PipalSinix.ExtractProc] = INLINE { Pipal.PutClassMethod[class, mode.extractMethod, NEW [PipalSinix.ExtractProc _ proc]]; }; SetInterestinglayers[$Met2, [0, 0]]; SetInterestinglayers[$Met, [1, 1]]; SetInterestinglayers[$Pol, [2, 2]]; SetInterestinglayers[$Pdif, [3, 3]]; SetInterestinglayers[$Ndif, [4, 4]]; SetInterestinglayers[$Pwell, [5, 5]]; SetInterestinglayers[$Nwell, [6, 6]]; SetInterestinglayers[$Ovg, [0, 7]]; SetInterestinglayers[$PwellCont, [8, 8]]; SetInterestinglayers[$NwellCont, [9, 9]]; SetInterestinglayers[$Cut2, [0, 1]]; SetInterestinglayers[$Cut, [1, 4]]; PipalCore.RegisterRoutingLayer[$Ndif]; PipalCore.RegisterRoutingLayer[$Pdif]; PipalCore.RegisterRoutingLayer[$Pol]; PipalCore.RegisterRoutingLayer[$Met]; PipalCore.RegisterRoutingLayer[$Met2]; PipalCore.RegisterRoutingLayer[$Ovg]; Set[Pipal.overlayClass, PipalSinix.ExtractEnumerate]; Set[Pipal.annotationClass, PipalSinix.ExtractAnnotation]; Set[PipalInt.abutClass, PipalSinix.ExtractAbut]; Set[PipalInt.transformClass, PipalSinix.ExtractTransform]; Set[PipalInt.translationClass, PipalSinix.ExtractTransform]; Set[PipalInt.orientClass, PipalSinix.ExtractTransform]; Set[PipalMos.boxClass, PipalSinix.ExtractBox]; Set[PipalMos.starClass, PipalSinix.ExtractStar]; Set[PipalMos.routingClass, PipalSinix.ExtractRouting]; Set[PipalMos.tilingClass, PipalSinix.ExtractTiling]; Set[PipalMos.markerClass, PipalSinix.ExtractAtomic]; Set[PipalMos.textClass, PipalSinix.ExtractNull]; Set[PipalMos.pictureClass, PipalSinix.ExtractNull]; PipalSinix.layoutMode _ mode; PipalCore.RegisterDecorationIO[mode.decoration]; END. ΎPipalSinixCMosB.mesa Copyright Σ 1985, 1987, 1988 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet January 20, 1986 6:24:09 pm PST Bertrand Serlet March 17, 1988 2:48:01 pm PST Jean-Marc Frailong January 17, 1988 5:47:02 pm PST Properties and extraction of common objects The standard Touch is hacked both for well and ovg rectangles. Maps [layer -> REF PipalSinix.LayerRange] Initialization MakeCMosBShell: PROC [comm: CDSequencer.Command] = { inst: CD.Instance = CDOps.TheInstance[comm.design]; IF inst=NIL THEN RETURN; [] _ CDOps.IncludeObjectI[comm.design, PipalCore.CreateShell[ decoration: mode.decoration, cellType: PipalExtractOps.ExtractCDInstanceCellTypeAndReport[inst, comm.design, mode], withCuteFonts: TRUE], comm.pos]; }; Layers Command to see the shell CDCommandOps.RegisterWithMenu[$Debug, "Make CMosB shell", "Make a shell from the extracted object", $MakeCMosBShell, MakeCMosBShell, doQueue]; Layer properties ΚM˜codešœ™KšœH™HKšœ7Οk™:Kšœ-™-Kšœ/™2K™—š œ˜ Kšœ1˜1Kšœ˜—K˜•StartOfExpansion[]šΟnœœ˜Kšœ<˜CKš˜—head™+šœœ˜3J–[name: ROPE]šœ7˜7Jšœ$˜$Jšœ0˜0Jšœ'˜'Jšœ"˜"Jšœ˜Jšœ˜Jšœ ˜ J˜—J˜Jšœ>™>šžœ˜š žœœ/œœœ˜TJš œœœœœœ˜9Jšœœ%˜3J˜—šž œœ/œ˜YJšœœ ˜$Jšœ'˜-J˜—šœœœ˜,JšœCœ˜FJšœA˜AJšœ˜—šœœœ˜,JšœCœ˜FJšœA˜AJšœ˜—šœœœ˜,JšœCœ˜FJšœA˜AJšœ˜—šœœœ˜,JšœCœ˜FJšœA˜AJšœ˜—šœœœœ˜AJšœZ˜ZJšœ˜—šœœœœ˜AJšœZ˜ZJšœ˜—Jšœ:˜@J˜J˜—Jšœœ˜ šœR˜RJ˜—šœ0˜0Jšœœ™)—J˜šžœœœ˜SJšœœœ.˜_Jš œœœœœ˜IJ˜—šžœœ:˜TKšœ,œ"˜QK˜—šž œœœ(˜Xšž œ˜%šœ(œœ˜>Jšœ4˜4Jšœ;˜;Jšœ6˜6Jšœ:˜:Jšœœ˜—Jšœœ,œ'˜lJšœœœ˜1J˜—Jšœ*˜*Jšœ1˜1Jšœœ ˜EJ˜——šœ™šžœœ6œ˜GKšœ0œ"˜UK˜K˜—šžœœ ™4Jšœœ+™3Jšœœœœ™šœ&™&šœ™Jšœ™JšœV™VJšœœ™—Jšœ ™ —J™J™—J˜™Kšœ$˜$Kšœ#˜#Kšœ#˜#Kšœ$˜$Kšœ$˜$Kšœ%˜%Kšœ%˜%Kšœ#˜#Kšœ)˜)Kšœ)˜)Kšœ$˜$Kšœ#˜#K˜—™KšœŽ™ŽK˜—™Kšœ&˜&Kšœ&˜&Kšœ%˜%Kšœ%˜%Kšœ&˜&Kšœ%˜%K˜Kšœ7˜7Kšœ:˜:K˜Kšœ2˜2Kšœ;˜;Kšœ=˜=Kšœ9˜9K˜Kšœ0˜0Kšœ2˜2Kšœ7˜7Kšœ6˜6Kšœ5˜5Kšœ2˜2Kšœ4˜4—J˜J˜šœ0˜0K˜——šœ˜K˜——…—ΠΫ