DIRECTORY Arbiter, Atom, CD, CDViewer, CedarProcess, Commander, CommandTool, Core, CoreCreate, CoreIO, IO, FS, PW, Rope, Sisyph, TerminalIO; ArbiterSchematicImpl: CEDAR MONITOR IMPORTS Atom, CDViewer, CedarProcess, Commander, CommandTool, CoreIO, IO, FS, PW, Rope, Sisyph, TerminalIO EXPORTS Arbiter = BEGIN OPEN Arbiter; useSavedCoreFile: BOOL _ FALSE; writeSavedCoreFile: BOOL _ FALSE; 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; IF useSavedCoreFile THEN act _ CoreIO.RestoreCellType[cellName ! FS.Error => { act _ NIL; CONTINUE } ]; IF act = NIL THEN { design: CD.Design; cx: Sisyph.Context; badProps: LIST OF ATOM _ NIL; badClasses: LIST OF Core.CellClass _ NIL; design _ CDViewer.FindDesign[designName]; IF design = NIL THEN design _ PW.OpenDesign[designName]; cx _ Sisyph.Create[design]; act _ Sisyph.ES[name: Rope.Cat[cellName, ".sch"], cx: cx]; IF writeSavedCoreFile THEN { [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 >= 2 THEN ResetSchematicCT[argv[1]] ELSE { cmd.err.PutF["That didn't work. Maybe the following will help:\n\n%g\n", IO.rope[cmd.procData.doc]] }; }; ExtractSchematic: PROC [cmd: Commander.Handle] RETURNS [result: REF _ NIL, msg: Rope.ROPE _ NIL] -- Commander.CommandProc -- = { argv: CommandTool.ArgumentVector = CommandTool.Parse[cmd]; IF argv.argc >= 3 THEN [] _ SchematicCT[argv[1], argv[2]] ELSE { cmd.err.PutF["That didn't work. Maybe the following will help:\n\n%g\n", IO.rope[cmd.procData.doc]] }; }; Commander.Register["ResetSchematic", ResetSchematic, "ResetSchematic destroys the current Core cell type for the named cell. Usage is:\n ResetSchematic \n\nSee also ExtractSchematic."]; Commander.Register["ExtractSchematic", ExtractSchematic, "ExtractSchematic finds or builds a Core cell type. Usage is\n ExtractSchematic <.dale file name>\n\nSee also ResetSchematic."]; END. ΎArbiterSchematicImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. McCreight May 13, 1987 3:37:08 pm PDT Last Edited by: McCreight October 24, 1987 5:42:58 pm PDT Κ›˜šœ™Jšœ<™