DIRECTORY Arbiter, Atom, CD, CedarProcess, Commander, CommandTool, Core, CoreCreate, CoreIO, IO, FS, PW, Rope, Sisyph, TerminalIO; ArbiterSchematicImpl: CEDAR MONITOR IMPORTS Atom, CedarProcess, Commander, CommandTool, CoreIO, IO, FS, PW, Rope, Sisyph, TerminalIO EXPORTS Arbiter = BEGIN OPEN Arbiter; sctProp: ATOM = $SchematicCT; SchematicCT: PUBLIC PROC [ cellName, designName: CoreCreate.ROPE ] RETURNS [ ct: CoreCreate.CellType ] = { atom: ATOM = Atom.MakeAtom[cellName]; ref: REF ANY _ Atom.GetProp[atom, sctProp]; ct _ NIL; IF ref = NIL THEN { MakeCellType: ENTRY PROC = { ENABLE UNWIND => NULL; act: CoreCreate.CellType _ NIL; act _ CoreIO.RestoreCellType[cellName ! FS.Error => { act _ NIL; CONTINUE } ]; IF act = NIL THEN { design: CD.Design _ PW.OpenDesign[designName]; cx: Sisyph.Context _ Sisyph.Create[design]; badProps: LIST OF ATOM _ NIL; badClasses: LIST OF Core.CellClass _ NIL; act _ Sisyph.ExtractSchematicByName[name: Rope.Cat[cellName, ".sch"], cx: cx]; [props: badProps, classes: badClasses] _ CoreIO.ReportSaveCellType[act, Rope.Cat[cellName, ".core"]]; IF badProps # NIL THEN TerminalIO.PutF["\nWarning: Couldn't write the following Core properties in the saved core file: \n%g\n", IO.refAny[badProps]]; IF badClasses # NIL THEN TerminalIO.PutF["\nWarning: Couldn't write the following Core classes in the saved core file: \n%g\n", IO.refAny[badClasses]]; }; ref _ act; Atom.PutProp[atom, sctProp, ref]; }; CedarProcess.DoWithPriority[background, MakeCellType]; }; ct _ NARROW[ref]; }; ResetSchematicCT: PUBLIC PROC [ cellName: CoreCreate.ROPE ] = { Atom.PutProp[Atom.MakeAtom[cellName], sctProp, NIL]; DO FS.Delete[Rope.Cat[cellName, ".core!L"] ! FS.Error => GOTO NoMoreVersions ]; REPEAT NoMoreVersions => NULL; ENDLOOP; }; ResetSchematic: PROC [cmd: Commander.Handle] RETURNS [result: REF _ NIL, msg: Rope.ROPE _ NIL] -- Commander.CommandProc -- = { argv: CommandTool.ArgumentVector = CommandTool.Parse[cmd]; IF argv.argc >= 1 THEN ResetSchematicCT[argv[1]]; }; ExtractSchematic: PROC [cmd: Commander.Handle] RETURNS [result: REF _ NIL, msg: Rope.ROPE _ NIL] -- Commander.CommandProc -- = { argv: CommandTool.ArgumentVector = CommandTool.Parse[cmd]; IF argv.argc >= 2 THEN [] _ SchematicCT[argv[1], argv[2]]; }; Commander.Register["ResetSchematic", ResetSchematic, "Destroys the current Core cell type for the named cell."]; Commander.Register["ExtractSchematic", ExtractSchematic, "Finds or builds a Core cell type for the named cell in the named design file."]; END. „ArbiterSchematicImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. McCreight May 13, 1987 3:37:08 pm PDT Κύ˜šœ™Jšœ<™