DIRECTORY CD, CDBasics, CDInstances, CDMenus, CDOps, CDOrient, CDProperties, CDSequencer, Core, CoreClasses, CoreFlat, CoreOps, CoreProperties, IO, Ports, Rosemary, Sinix, SinixCMos, TerminalIO; LayoutSimulation: CEDAR PROGRAM IMPORTS CDBasics, CDInstances, CDMenus, CDOps, CDOrient, CDProperties, CoreClasses, CoreFlat, CoreOps, CoreProperties, IO, 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: CoreFlat.InstantiationPath _ NIL] = { rc: CellType _ CoreOps.ToBasic[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: CoreFlat.InstantiationPath; wireSize: NAT; wireCell: CellType; [selected, multiple] _ CDOps.SelectedInstance[command.design]; IF ~IsSingleSelected[selected, multiple] THEN RETURN; ct _ NARROW [Sinix.Extract[selected.ob, SinixCMos.extractBMode].result]; [wire, path] _ FindWireAtPos[ct, CDBasics.SubPoints[command.pos, selected.location]]; path _ CoreClasses.ReverseCellInstances[path]; IF path=NIL THEN wireCell _ ct ELSE wireCell _ path.first.type; wireSize _ CoreOps.WireBits[wire]; TerminalIO.WriteF[ "Value[%g] = %g\n", IO.rope[CoreOps.GetFullWireName[NARROW [wireCell.data, CoreClasses.RecordCellType].internal, wire]], IO.rope[Ports.LevelSequenceToRope[ Rosemary.WireValue[ simulation, NEW [CoreFlat.FlatWireRec _ [CoreFlat.ComputePackedPath[simulation.coreCellType, path], wire]] ], wireSize]] ]; }; CDMenus.ImplementEntryCommand[$OtherProgramMenu, "SeeRoseValue", SeeRoseValue]; END. LayoutSimulation.mesa Copyright c 1984 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet August 30, 1985 11:41:04 am PDT Bertrand Serlet June 8, 1986 11:14:51 pm PDT Pradeep Sindhu December 2, 1985 6:42:39 pm PST Barth, March 21, 1986 12:47:57 pm PST Κ}˜– "Cedar" stylešœ™Jšœ Οmœ1™˜>Kšžœ'žœžœ˜5Kšœžœ=˜HKšœU˜UKšœ.˜.Kšžœžœžœ˜Kšžœ˜ Kšœ"˜"šœ˜Kšœ˜Kšžœžœ>˜ešžœ ˜"šœ˜Kšœ ˜ Kšžœ[˜^Kšœ˜—Kšœ ˜ —Kšœ˜—Jšœ˜—J™JšœP˜PJ˜Jšžœ˜—J™—…— p