DIRECTORY CD, Rope USING [ROPE]; CDSequencer: CEDAR DEFINITIONS = BEGIN Command: TYPE = REF CommandRec; CommandRec: TYPE = RECORD [ key: ATOM _ NIL, design: CD.Design _ NIL, pos: CD.Position _ [0, 0], -- final position of command sPos: CD.Position _ [0, 0], -- special position, start position, (exceptional: size) l: CD.Layer _ CD.undefLayer, b: BOOL _ FALSE, n: CD.Number _ 0, ref: REF _ NIL, --typically describes issuer the command (if interactive: viewer) data: REF _ NIL --reserved for command implementor ]; CommandProc: TYPE = PROC[Command]; QueueMethod: TYPE = {doQueueAndMark, doQueue, dontQueue, useDefault}; ExecuteProc: PROC [proc: CommandProc, design: CD.Design _ NIL, queue: QueueMethod _ doQueue, comm: CDSequencer.Command _ NIL]; ExecuteCommand: PROC [key: ATOM _ NIL, design: CD.Design _ NIL, queue: QueueMethod _ useDefault, comm: CDSequencer.Command _ NIL]; ImplementCommand: PROC [key: ATOM, proc: CommandProc, technology: CD.Technology_NIL, queue: QueueMethod _ doQueueAndMark, registrationData: REF_NIL]; FetchCommand: PROC [key: ATOM, technology: CD.Technology_NIL, load: BOOL_TRUE] RETURNS [proc: CommandProc, qm: QueueMethod, registrationData: REF]; SetMutability: PROC [design: CD.Design, mutability: CD.Mutability _ editable]; MarkChanged: PROC [design: CD.Design]; MarkChangedIOOnly: PROC [design: CD.Design]; SetEdited: PRIVATE PROC [design: CD.Design, edited: BOOL_TRUE]; AbortDesignsCommand: PROC [design: CD.Design, flush: BOOL_TRUE]; Aborted: PROC [design: CD.Design] RETURNS [BOOL]; UseAbortFlag: PROC [design: CD.Design, flag: REF BOOL]; CheckAborted: PROC [design: CD.Design]; Quit: PROC [message: Rope.ROPE_NIL]; END. ΔCDSequencer.mesa (A ChipNDale module) Copyright c 1983, 1987 by Xerox Corporation. All rights reserved. Created by: Christian Jacobi, June 29, 1983 2:34 pm Last edited by: Christian Jacobi, February 26, 1987 10:57:23 am PST Implementation of interactive commands. Monitoring asynchronous commands. Since this module monitors asynchronous commands its implementation is the right place to implement also the regular background saving process. --doQueueAndMark: fork and queue, mark the design as changed --doQueue: fork and queue, don't mark the design as changed --dontQueue: don't fork, don't queue, don't mark (procedure call) --useDefault: use the commands default QueueMethod --Executes a command procedure proc. --design#NIL: design replaces comm.design --queue: useDefault -> takes queueing method from registration; otherwise -> as stated --proc must be global --To transfer client data to proc, use: "comm: NEW[CommandRec _ [data: ..]]" --Might call CD.Error[designMutability] --Fetches and executes a command. --queue: useDefault -> takes queueing method from registration; otherwise -> as stated --key#NIL: key replaces comm.a --design#NIL: design replaces comm.design --Might call CD.Error[designMutability] --Registeres a command --technology=NIL: implements command for all technologies. --Re-using the same atom (in same technology) overwrites the command --queue: [dont use useDefault] --registrationData: for the command implementor: This data can be querried by -- calling FetchCommand --Fetches a commands registration --NIL proc if not defined --After the call, the design might be changed by interactive commands --But refuses to change state once design.mutability#(editable or findOut) --edited --Mark the designs top level pushed in cell and the design as changed; --The design will be saved some time later again... --Might call CD.Error[designMutability] --Marks the design as changed; it will be saved some time later again --But does not mark any pushed in cell --Might call CD.Error[designMutability] --Sets the designs edited boolean --Used by IO implementations to reset the designs edit mark. --Not for general clients. --aborts -- Abortion does not guarantee the aborted process to stop, but most long -- commands are benevolent. -- Abortion of a command is also propagated using an event $Aborted. --Called from any process; tries to abort the designs current command --flush: flush commands not yet started --(On return success is not yet known) --Checks whether the current command on design has been aborted --(Accurate only inside CDSequencer's lock of design) --If while execution of the current command an abort is called --the boolean will be set to TRUE; --Forgets the flag when command is finished. --Shortcut --IF Aborted[design] THEN Quit[] --Shortcut --Write message and terminates execution of the command of this process --Never returns --(use only from ChipNDale processes which have the CDSequencer lock of the design) ΚH˜codešœ*™*Kšœ Οmœ7™BKšœ5™5K™C—šΟk ˜ Kšž˜Kšœžœžœ˜—K˜KšΟn œžœž œ˜!Kšž˜K˜K™'™!K™K™KK™D—K˜K˜Kšœ žœžœ ˜šœ žœžœ˜Kšœžœžœ˜Kšœžœ žœ˜KšœžœΟc˜7Kšœžœ 8˜TKšœžœ žœ ˜Kšœžœžœ˜Kšœžœ ˜Kšœžœžœ A˜QKšœžœžœ "˜2K˜—Kšœ žœžœ ˜"šœ žœ4˜EKšœ=™=Kšœ=™=KšœB™BKšœ4™4K˜—K˜š Ÿ œžœžœ žœ<žœ˜~Kšœ$™$Kšœ)™)KšœV™VKšœ™KšœM™MKšœ(™(K˜—šŸœžœžœžœ žœ žœ?žœ˜‚Kšœ!™!KšœV™VKšœ™Kšœ)™)Kšœ'™'K˜—šŸœžœžœ!žœ žœ9žœžœ˜˜Kš ™Kš :™:Kš E™EKšœ™Kš œ <™NKšœ™K˜—šŸ œžœžœžœ žœžœžœžœ8žœ˜”Kš !™!Kš ™K˜—šŸ œžœ žœžœ˜NKš E™EKš J™JK˜—K™K™K˜šŸ œžœ žœ ˜&KšœG™GKšœ3™3Kšœ'™'K˜—šŸœžœ žœ ˜,KšœE™EKšœ&™&Kšœ'™'—K˜š Ÿ œž œ žœžœžœ˜?Kšœ"™"Kšœ=™=Kšœ™—K˜K™K™K™JK™K™DK˜š Πbnœžœ žœžœžœ˜@KšœF™FKšœ(™(Kšœ'™'K˜—š Ÿœžœ žœ žœžœ˜1Kšœ?™?Kšœ5™5—K˜š Ÿ œžœ žœžœžœ˜7K™>Kšœ#™#Kšœ-™-—K˜šŸ œžœ žœ ˜(Kš  ™ Kš  ™ —K˜šŸœžœžœ˜$Kš  ™ KšœG™GKšœ™KšœS™SK˜—K˜Kšžœ˜—…—˜€