<> <> <> <> <> <> DIRECTORY CD USING [ Design, Instance, InstanceList], <> 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]; Extract: CEDAR PROGRAM 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] ~ { <> 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] ~ { <> 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"] END.