DIRECTORY Core, CoreCreate, CoreOps, FSAExtras, Rope, Sisyph; FSAExtrasImpl: CEDAR PROGRAM IMPORTS CoreCreate, CoreOps, Rope, Sisyph EXPORTS FSAExtras = BEGIN OPEN FSAExtras; fsaExtension: ROPE _ ".fsa"; machineClass: Core.CellClass _ NEW [Core.CellClassRec _ [name: "MealyMachine", recast: RecastMealyMachine, layersProps: FALSE]]; stateClass: Core.CellClass _ NEW [Core.CellClassRec _ [name: "MealyState", layersProps: FALSE]]; transitionClass: Core.CellClass _ NEW [Core.CellClassRec _ [name: "MealyTransition", layersProps: FALSE]]; transitionCellType: Core.CellType _ CoreOps.CreateCellType [ class: transitionClass, public: CoreCreate.Wires["Target", "Expression", "Source"]]; MealyMachine: PUBLIC PROC [cx: Sisyph.Context, s: ROPE _ NIL] RETURNS [ct: CellType] = { fsaCell: CellType _ NIL; fsaName: ROPE _ NIL; IF s=NIL THEN { }; fsaCell _ Sisyph.ExtractSchematicByName[Rope.Cat[s, fsaExtension], cx]; fsaName _ CoreOps.GetCellTypeName[fsaCell]; fsaName _ Rope.Substr[fsaName, 0, Rope.Index[fsaName, 0, fsaExtension]]; [] _ CoreOps.SetCellTypeName[fsaCell, fsaName]; ct _ CoreOps.CreateCellType [ class: machineClass, public: CoreCreate.Union[CoreOps.CopyWire[fsaCell.public], CoreCreate.Wires["Vdd", "Gnd", "Clock", "Reset"]], data: fsaCell, name: fsaName]; }; MealyState: PUBLIC PROC [o: NAT] RETURNS [ct: CellType] = { ct _ CoreOps.CreateCellType [ class: stateClass, public: CoreCreate.Wires["Target", "Source", CoreCreate.Seq["Output", o]]]; }; MealyTransition: PUBLIC PROC RETURNS [ct: CellType] = { ct _ transitionCellType; }; RecastMealyMachine: Core.RecastProc = { ERROR; }; END. ΜFSAExtrasImpl.mesa Copyright Σ 1986, 1987 by Xerox Corporation. All rights reserved. Barth, April 1, 1987 11:13:32 am PST Bertrand Serlet April 2, 1987 9:39:46 pm PST objectName: ROPE _ CDDirectory.Name[Sisyph.GetCDObj[cx]]; index: INT _ Rope.Find[s1: objectName, s2: ".icon"]; length: INT _ Rope.Length[objectName]; IF index<0 OR index#length-5 THEN ERROR; -- .icon not in string or not at end of string s _ Rope.Substr[objectName, 0, length-5]; Κ0˜codešœ™KšœB™BK™$K™,—K™KšΟk œ4˜=K˜šΟn œœ˜Kšœ"˜)Kšœ ˜Kšœœœ ˜—K˜šœœ ˜J˜—šœœVœ˜€J™—šœœ8œ˜`J™—šœ"œ=œ˜jJ™—šœ<˜