<> <> <> <> <<>> DIRECTORY CDCommandOps, CDSequencer, Core, CoreOps, IO, Pipal, PipalCore, PipalEdit, PipalExtractOps, PipalInt, PipalOverlayMutant, PipalSinix, PipalUI, TerminalIO; TestPipalSinix: CEDAR PROGRAM IMPORTS CDCommandOps, CoreOps, IO, Pipal, PipalCore, PipalEdit, PipalExtractOps, PipalOverlayMutant, PipalSinix, PipalUI, TerminalIO = BEGIN <> Draw: PROC [object: Pipal.Object] = { om: PipalOverlayMutant.OverlayMutant; WHILE ISTYPE [object, Pipal.Annotation] DO object _ NARROW [object, Pipal.Annotation].child; ENDLOOP; om _ PipalOverlayMutant.Create[ IF ISTYPE [object, Pipal.Overlay] THEN NARROW [object] ELSE Pipal.CreateOverlay[LIST [object]] ]; [] _ PipalEdit.Edit[om]; }; DrawShell: PROC [cellType: Core.CellType] = { Draw[PipalCore.CreateShell[PipalSinix.layoutMode.decoration, cellType, TRUE]]; }; <> ExtractCommand: PROC [command: CDSequencer.Command] ~ { EachSelected: PipalUI.EachSelectedProc = { result: REF; nb _ nb + 1; result _ PipalExtractOps.ExtractTopObjectAndReport[child, PipalSinix.schematicsMode].result; IF result=NIL THEN TerminalIO.PutF["*** Extraction returned NIL"] ELSE CoreOps.Print[ref: result, out: TerminalIO.TOS[], level: LAST [NAT]]; TerminalIO.PutF["\n"]; }; nb: INT _ 0; PipalUI.HighlightDesign[command.design]; [] _ PipalUI.EnumerateSelectedObjects[command.design, EachSelected]; IF nb=0 THEN TerminalIO.PutF["*** No instance selected.\n"]; IF nb>1 THEN TerminalIO.PutF["%g instances extracted.\n", IO.int[nb]]; }; <> ConvertToP: PROC [command: CDSequencer.Command] ~ { EachSelected: PipalUI.EachSelectedProc = {Draw[child]}; [] _ PipalUI.EnumerateSelectedObjects[command.design, EachSelected]; }; <> CDCommandOps.RegisterWithMenu [$OtherProgramMenu, "Schematic: extract", "calls extractor", $ExtractSchematic, ExtractCommand, doQueue]; CDCommandOps.RegisterWithMenu [$OtherProgramMenu, "Convert to Pipal", "hack", $ConvertToP, ConvertToP, dontQueue]; <> <> <> <<[] _ CDOps.IncludeObjectI[comm.design,>> <> <> <> <> <> <<};>> <<>> <> <> END.