TestPipalSinix.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet April 2, 1988 5:57:13 pm PST
Bertrand Serlet May 12, 1988 10:56:59 pm PDT
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
Debug
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]];
};
Temporary Sch Extraction
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]];
};
Temporary Sch Extraction
ConvertToP: PROC [command: CDSequencer.Command] ~ {
EachSelected: PipalUI.EachSelectedProc = {Draw[child]};
[] ← PipalUI.EnumerateSelectedObjects[command.design, EachSelected];
};
Initialization
CDCommandOps.RegisterWithMenu
[$OtherProgramMenu, "Schematic: extract", "calls extractor", $ExtractSchematic, ExtractCommand, doQueue];
CDCommandOps.RegisterWithMenu
[$OtherProgramMenu, "Convert to Pipal", "hack", $ConvertToP, ConvertToP, dontQueue];
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];
};
Command to see the shell
CDCommandOps.RegisterWithMenu[$Debug, "Make CMosB shell", "Make a shell from the extracted object", $MakeCMosBShell, MakeCMosBShell, doQueue];
END.