ExtractSelectedObjAndRunThyme:
PROC [comm: CDSequencer.Command] = {
selected: CD.Instance;
multiple: BOOL;
cellType: Core.CellType;
wDir: ROPE ← CDIO.GetWorkingDirectory[comm.design];
thymeHandle: ThymeHandle ← GetThymeHandle[wDir];
thymeFileName: ROPE;
[selected, multiple] ← CDOps.SelectedInstance[comm.design];
IF ~IsSingleSelectedAndCell[selected, multiple] THEN RETURN;
cellType ← NARROW [SinixOps.ExtractCDInstance[selected, comm.design, Sisyph.mode].result];
WHILE SinixOps.IsIcon[Sisyph.mode.decoration, cellType]
DO
cellType ← CoreOps.Recast[cellType];
ENDLOOP;
IF CoreOps.GetCellTypeName[cellType]=
NIL
THEN thymeFileName ← Rope.Cat[wDir, "CoreThymeDefaultFile.thy"]
ELSE thymeFileName ← Rope.Cat[wDir, CoreOps.GetCellTypeName[cellType], ".thy"];
CoreThyme.Translate[cellType, thymeFileName];
CoreOps.PrintCellType[cellType, TerminalIO.TOS[]];
CoreThyme.Simulate[thymeFileName, thymeHandle];
};
DirectExtractSelectedObjAndRunThyme:
PROC [comm: CDSequencer.Command] = {
selected: CD.Instance;
multiple: BOOL;
cellType: Core.CellType;
wDir: ROPE ← CDIO.GetWorkingDirectory[comm.design];
thymeHandle: ThymeHandle ← GetThymeHandle[wDir];
theRoot: ThymeGlobals.namePtr ← NEW[ThymeGlobals.nameBlk ← [name: "Main Circuit", details: NEW[ThymeGlobals.CircuitRec← []]] ];
gndNodeName: ThymeGlobals.namePtr ← NEW[ThymeGlobals.nameBlk ← [name: "Gnd", details: NEW[ThymeGlobals.NodeRec] ] ];
[selected, multiple] ← CDOps.SelectedInstance[comm.design];
IF ~IsSingleSelectedAndCell[selected, multiple] THEN RETURN;
cellType ← NARROW [SinixOps.ExtractCDInstance[selected, comm.design, Sisyph.mode].result];
WHILE SinixOps.IsIcon[Sisyph.mode.decoration, cellType]
DO
cellType ← CoreOps.Recast[cellType];
ENDLOOP;
thymeHandle.vars ←
NEW[ThymeGlobals.Variables ← [
line: "dummy: just to fool ThymeGlobalsImpl",
numPlots: 1,
plots: NEW[ThymeGlobals.PlotSeq[1]]
]];
ThymeGlobals.PutTopLevelCircuit[cellType, thymeHandle, theRoot, gndNodeName];
IF thymeHandle.echoInput THEN ThymeGlobals.Output[thymeHandle, theRoot, 0];
ThymeGlobals.Bomb[thymeHandle, theRoot, gndNodeName];
ThymeGlobals.TopoAnalysis[thymeHandle];
ThymeGlobals.MakePlotList[thymeHandle];
[] ← ThymeGlobals.RunIt[thymeHandle];
TerminalIO.PutRope["Direct Thyme Finished\n"];
};