BooleDebug.mesa
Copyright © 1984 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet August 30, 1985 11:41:04 am PDT
Bertrand Serlet March 26, 1986 1:50:31 am PST
Pradeep Sindhu December 2, 1985 6:42:39 pm PST
Barth, March 21, 1986 12:47:57 pm PST
DIRECTORY
CD, CDBasics, CDCells, CDDirectory, CDInstances, CDMenus, CDOps, CDOrient, CDProperties, CDRects, CDSequencer, CDViewer, CDViewHighlight,
CMos, CMosB,
Core, CoreClasses, CoreOps, CoreProperties,
Ports, PW, PWPins,
Rope, Rosemary, Sinix, SinixCMos,
TerminalIO, ViewerClasses;
BooleDebug: CEDAR PROGRAM
IMPORTS CDBasics, CDInstances, CDMenus, CDOps, CDOrient, CDProperties, CoreOps, CoreProperties, Ports, Rosemary, Sinix, SinixCMos, TerminalIO =
BEGIN
ROPE: TYPE = Core.ROPE;
CellType: TYPE = Core.CellType;
Wire: TYPE = Core.Wire;
IsSingleSelected: PROC [selected: CD.Instance, multiple: BOOL] RETURNS [BOOL] = {
IF selected=NIL THEN {
TerminalIO.WriteRope["\n** No current selection--can't do it.\n"];
RETURN[FALSE];
};
IF multiple THEN {
TerminalIO.WriteRope["\n** Multiple instances selected--can't do it.\n"];
RETURN[FALSE];
};
RETURN[TRUE];
};
FindWireAtPos: PROC [ct: CellType, posInCell: CD.Position] RETURNS [wr: Wire ← NIL, path: Rosemary.InstantiationPath ← NIL] = {
rc: CellType ← Rosemary.Recordify[ct];
rcData: CoreClasses.RecordCellType ← NARROW [rc.data];
FindInInternal: CoreOps.EachWireProc = {
FOR geom: LIST OF CD.Instance ← Sinix.GetWireGeometryProp[SinixCMos.extractBMode, wire], geom.rest WHILE geom#NIL DO
IF CDInstances.PointToI[posInCell, geom.first] THEN {wr ← wire; quit ← TRUE}
ENDLOOP;
};
IF CoreOps.VisitWire[rcData.internal, FindInInternal] THEN RETURN;
FOR i: NAT IN [0 .. rcData.size) DO
inst: CD.Instance ← NARROW [CoreProperties.GetCellInstanceProp[rcData[i], SinixCMos.extractBMode.instanceProp]];
IF inst=NIL THEN ERROR;
IF CDInstances.PointToI[posInCell, inst] THEN {
subPos: CD.Position ← CDOrient.DeMapPoint[posInCell, inst.ob.size, inst.orientation, inst.location];
[wr, path] ← FindWireAtPos[rcData[i].type, subPos];
path ← CONS [rcData[i], path];
};
ENDLOOP;
};
SeeRoseValue: PROC [command: CDSequencer.Command] = {
simulation: Rosemary.Simulation ← NARROW [CDProperties.GetDesignProp[command.design, $Simulation]];
selected: CD.Instance;
multiple: BOOL;
pos: CD.Position ← command.pos;
ct: CellType;
wire: Wire;
path: Rosemary.InstantiationPath;
wireSize: NAT;
bits: Ports.LevelSequence;
wireCell: CellType;
[selected, multiple] ← CDOps.SelectedInstance[command.design];
IF ~IsSingleSelected[selected, multiple] THEN RETURN;
ct ← Sinix.Extract[selected.ob, SinixCMos.extractBMode].cellType;
[wire, path] ← FindWireAtPos[ct, CDBasics.SubPoints[command.pos, selected.location]];
IF path=NIL THEN wireCell ← ct
ELSE FOR end: Rosemary.InstantiationPath ← path, end.rest UNTIL end=NIL DO wireCell ← end.first.type ENDLOOP;
wireSize ← CoreOps.WireBits[wire];
bits ← NEW[Ports.LevelSequenceRec[wireSize]];
Rosemary.GetWireValue[simulation, path, wire, bits];
TerminalIO.WriteRopes[CoreOps.GetFullWireName[NARROW[wireCell.data, CoreClasses.RecordCellType].internal, wire], " = ", Ports.LevelSequenceToRope[bits, wireSize]];
TerminalIO.WriteLn[];
};
CDMenus.ImplementEntryCommand[$OtherProgramMenu, "SeeRoseValue", SeeRoseValue, $SeeRoseValue];
END.