Extract.mesa
Copyright (C) 1985 by Xerox Corporation. All rights reserved.
Written by gbb September 20, 1985 11:52:24 am PDT
Louis Monier April 10, 1986 6:44:59 pm PST
Christian LeCocq December 19, 1986 12:06:35 pm PST
DIRECTORY
CD USING [ Design, Instance, InstanceList],
CDCommandOps USING [CallWithResource],
CDMenus USING [CreateEntry],
CDOps USING [InstList],
CDProperties USING [PutDesignProp],
CDSequencer USING [Command, ImplementCommand],
Core USING [CellType],
Build USING [NetFromCore],
Globals USING [GlobalVars, RunCrystal],
Rope USING [Cat, ROPE],
Sinix USING [Mode],
SinixOps USING [GetExtractMode, ExtractCDInstance],
Sisyph USING [mode],
TerminalIO USING [WriteRope],
WriteCapa USING [WriteWireCapa];
IMPORTS
CDMenus, CDOps, CDProperties, CDSequencer, Build, Globals, Rope, Sisyph, SinixOps, TerminalIO, WriteCapa
~
BEGIN
ExtractAndBuild:
PROC [mode: Sinix.Mode, comm: CDSequencer.Command] ~
{
IF mode=
NIL
THEN {
TerminalIO.WriteRope [Rope.Cat ["The technology ", comm.design.technology.name, " is not Crystalizable.\n"]];
RETURN
};
FOR all:
CD.InstanceList ← CDOps.InstList[comm.design], all.rest
WHILE all #
NIL
DO
IF all.first.selected
THEN
BEGIN
globalVars: Globals.GlobalVars;
coreCell: Core.CellType ← NARROW[SinixOps.ExtractCDInstance [all.first, comm.design, mode].result];
TerminalIO.WriteRope ["\nCoreCell created\n"];
WriteCapa.WriteWireCapa[coreCell, comm.design.technology.key];
TerminalIO.WriteRope ["\nCapacitances added\n"];
globalVars ← Build.NetFromCore[coreCell];
Globals.RunCrystal[globalVars];
END;
ENDLOOP
}; -- ExtractAndBuild
DoCrystalFromLayout:
PROC [comm: CDSequencer.Command] ~
{
Called by ChipNDale upon activation of the command.
abort: REF BOOL ← NEW [BOOL←FALSE];
mode: Sinix.Mode ← SinixOps.GetExtractMode[comm.design.technology];
TerminalIO.WriteRope ["Crystal2\n"];
CDProperties.PutDesignProp [comm.design, $Crystal2CmdDir];
ExtractAndBuild[mode, comm];
[] ← CDCommandOps.CallWithResource [ExtractAndBuild, comm, $Crystal2, abort];
TerminalIO.WriteRope ["Crystal2 input finished.\n"];
};
DoCrystalFromSch:
PROC [comm: CDSequencer.Command] ~
{
Called by ChipNDale upon activation of the command.
abort: REF BOOL ← NEW [BOOL←FALSE];
TerminalIO.WriteRope ["Crystal2\n"];
CDProperties.PutDesignProp [comm.design, $Crystal2CmdDir];
ExtractAndBuild[Sisyph.mode, comm];
[] ← CDCommandOps.CallWithResource [ExtractAndBuild, comm, $Crystal2, abort];
TerminalIO.WriteRope ["Crystal2 input finished.\n"];
};
CDSequencer.ImplementCommand [key: $Crystal2SchSel, proc: DoCrystalFromSch, queue: doQueue];
CDMenus.CreateEntry [menu: $ProgramMenu, entry: "Schema->Crystal2", key: $Crystal2SchSel];
CDSequencer.ImplementCommand [key: $Crystal2LaySel, proc: DoCrystalFromLayout, queue: doQueue];
CDMenus.CreateEntry [menu: $ProgramMenu, entry: "Layout->Crystal2", key: $Crystal2LaySel];
TerminalIO.WriteRope ["Crystal2 package loaded.\n"]