DIRECTORY Atom, Basics, CacheOps, ClusterParams, Commander, Cucumber, Dragon, DragonRosemary, DragOpsCross, FS, IO, LizardRosemary, Process, RandomCode, Rope, RoseCreate, RoseDisplayInsides, RoseRun, RoseTypes, TypeScript, ViewerClasses, ViewerIO, ViewRec; ClusterParamsImpl: CEDAR PROGRAM IMPORTS Atom, CacheOps, Commander, Cucumber, DragonRosemary, FS, IO, Process, RandomCode, RoseCreate, RoseDisplayInsides, RoseRun, TypeScript, ViewerIO, ViewRec EXPORTS ClusterParams = BEGIN OPEN ClusterParams; vm: PUBLIC CacheOps.VirtualMemory _ NIL; randomBackground: PUBLIC Rope.ROPE _ "RandomBackground.quad"; randomStartPC: PUBLIC Dragon.Word _ 102000H; iCacheSkipRejects: PUBLIC BOOL _ FALSE; iCache: PUBLIC CacheOps.Cache _ NIL; eCache: PUBLIC CacheOps.Cache _ NIL; clusterLog: PUBLIC IO.STREAM _ IO.noWhereStream; ifuLogRef: PUBLIC REF IO.STREAM _ NEW[IO.STREAM]; euLogRef: PUBLIC REF IO.STREAM _ NEW[IO.STREAM]; eCacheLogRef: PUBLIC REF IO.STREAM _ NEW[IO.STREAM]; lizardSimRef: PUBLIC REF LizardRosemary.Simulation _ NEW[LizardRosemary.Simulation]; clusterTestSim: RoseTypes.Simulation _ NIL; clusterDisplay: RoseDisplayInsides.Display _ NIL; clusterBrower: ViewerClasses.Viewer _ NIL; clusterPanel: PUBLIC REF ControlPanel _ NIL; DoStartCluster: Commander.CommandProc = { vm _ CacheOps.NewVirtualMemory[]; iCache _ CacheOps.NewCache[vm]; eCache _ CacheOps.NewCache[vm]; clusterTestSim _ RoseCreate.CreateSim[steady: TRUE]; RoseCreate.CreateTest[ typeName: "Cluster", rootName: "ClusterRoot", testName: "T", sim: clusterTestSim, decider: RoseCreate.DecideFromFile["Cluster.expand"], dual: FALSE ]; clusterDisplay _ RoseDisplayInsides.NewDisplay [sim: clusterTestSim, info: [iconic: TRUE, name: "Cluster"]]; clusterLog _ clusterDisplay.log; TypeScript.ChangeLooks[ViewerIO.GetViewerFromStream[clusterLog], 'f]; ifuLogRef^ _ clusterLog; euLogRef^ _ clusterLog; eCacheLogRef^ _ clusterLog; clusterBrower _ RoseDisplayInsides.BrowseDisplay [display:clusterDisplay, info: [iconic:TRUE, name:"Cluster Browser"]]; StartPanel[]; clusterPanel.diagnostic _ cmd.commandLine; }; StartPanel: PROC = { clusterPanel _ NEW[ControlPanel _ [ ckptFile: "Cluster.ckpt", errMsg: "", enaIFULog: TRUE ]]; [] _ ViewRec.ViewRef[ agg: clusterPanel, label: "Dragon Panel ",specs: CONS[[ "cycle", Value[val:NIL, visible:TRUE, dontAssign:TRUE]], CONS[[ "phase", Value[val:NIL, visible:TRUE, dontAssign:TRUE]], CONS[[ "instrCount", Value[val:NIL, visible:TRUE, dontAssign:TRUE]], NIL]]]] }; PanelCheck: PUBLIC PROC = BEGIN lastPanel: ControlPanel; FOR firstPanelCheck: BOOL _ TRUE, FALSE DO IF firstPanelCheck OR lastPanel.enaIFULog # clusterPanel.enaIFULog THEN IF clusterPanel.enaIFULog THEN ifuLogRef^ _ clusterLog ELSE ifuLogRef^ _ IO.noWhereStream; IF firstPanelCheck OR lastPanel.enaEULog # clusterPanel.enaEULog THEN IF clusterPanel.enaEULog THEN euLogRef^ _ clusterLog ELSE euLogRef^ _ IO.noWhereStream; IF firstPanelCheck OR lastPanel.enaECacheLog # clusterPanel.enaECacheLog THEN IF clusterPanel.enaECacheLog THEN eCacheLogRef^ _ clusterLog ELSE eCacheLogRef^ _ IO.noWhereStream; lastPanel _ clusterPanel^; Process.Pause[Process.SecondsToTicks[1]]; ENDLOOP; END; Remark: PUBLIC PROC [message: IO.ROPE] = {RoseRun.DisableableStop[Remark, message]}; CheckPoint: PUBLIC PROC [fileName: IO.ROPE, root: RoseTypes.Cell] = BEGIN file: IO.STREAM _ NIL; clusterPanel.errMsg _ "Checkpointing..."; file _ FS.StreamOpen[fileName: fileName, accessOptions: create, keep: 2 ! FS.Error => {clusterPanel.errMsg _ error.explanation; GOTO Punt} ]; TRUSTED BEGIN ENABLE ABORTED => GOTO Close; Cucumber.Transfer[what: root, where: file, direction: out ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; Cucumber.Transfer[what: clusterPanel, where: file, direction: out ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; Cucumber.Transfer[what: Atom.GetProp[$Cluster, $RegStores], where: file, direction: out ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; clusterPanel.errMsg _ NIL; EXITS Close => Remark["Checkpoint failed, OK to proceed or abort"]; END; file.Close[ ! IO.Error, FS.Error => CONTINUE ]; EXITS Punt => Remark["Couldn't open checkpoint file, OK to proceed or abort"]; END; RollBack: PUBLIC PROC [fileName: IO.ROPE, root: RoseTypes.Cell] RETURNS [oldPanel: REF ControlPanel] = BEGIN file: IO.STREAM _ NIL; oldPanel _ NEW[ControlPanel _ clusterPanel^]; clusterPanel.errMsg _ "Rolling back..."; file _ FS.StreamOpen[fileName: fileName ! FS.Error => {clusterPanel.errMsg _ error.explanation; GOTO Punt} ]; TRUSTED BEGIN regStores: REF ANY; Cucumber.Transfer[what: root, where: file, direction: in ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; Cucumber.Transfer[what: oldPanel, where: file, direction: in ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; Cucumber.Transfer[what: regStores, where: file, direction: in ! Cucumber.Error => {clusterPanel.errMsg _ msg; GOTO Close}]; Atom.PutProp[$Cluster, $RegStores, regStores]; clusterPanel.errMsg _ NIL; EXITS Close => BEGIN clusterPanel.errMsg _ IO.PutFR["at %g: %g", IO.int[file.GetIndex[]], IO.rope[clusterPanel.errMsg]]; DragonRosemary.Assert[FALSE, "Rollback failed, recommend you abort"]; END; END; file.Close[]; EXITS Punt => Remark["Couldn't open rollback file, OK to proceed or abort"]; END; InsertRandomProgramInVM: PUBLIC PROC[ vm: CacheOps.VirtualMemory, seed: INT, log: IO.STREAM] = { nextByteAddr: Dragon.Word _ randomStartPC; WriteOneCodeByte: PROC [byte: [0..255]] = BEGIN background: Basics.LongNumber; CacheOps.SetFlags[c: eCache, address: nextByteAddr/4, mapped: TRUE, writeProtect: FALSE, dirty: FALSE]; background.lc _ CacheOps.Access[c: eCache, address: nextByteAddr/4].data; SELECT nextByteAddr MOD 4 FROM 0 => background.hh _ byte; 1 => background.hl _ byte; 2 => background.lh _ byte; 3 => background.ll _ byte; ENDCASE => ERROR; CacheOps.Write[c: eCache, address: nextByteAddr/4, data: background.lc]; nextByteAddr _ nextByteAddr+1; END; CacheOps.VirtualMemoryFromFile[vm, randomBackground]; RandomCode.GenerateRandomProgramBytes[ initialByteAddress: randomStartPC, randomSeed: seed, seeOneByte: WriteOneCodeByte, dribble: log ]; eCache _ CacheOps.NewCache[eCache]; -- resets first free cycle, cache lines }; Commander.Register["Cluster", DoStartCluster, "Cluster fires up a Rosemary simulation of a single-processor Dragon. Format is\n Cluster CodeFile.quad Expansion.expand\n"]; END.} 6ClusterParamsImpl.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. last modified by E. McCreight, March 11, 1986 12:03:44 pm PST last modified by Curry, September 8, 1985 1:54:50 pm PDT Herrmann, September 6, 1985 12:53:11 pm PDT Initializes the Cluster Rosemary simulation parameters Κψ˜šœ™Jšœ Οmœ1™˜GKšœžœ4žœ ˜EKš žœžœžœžœžœ˜+šœ9˜9Kšœ0žœ ˜=—šœA˜AKšœ0žœ ˜=—šœW˜WKšœ0žœ ˜=—Kšœžœ˜Kšžœ>˜CKšžœ˜—Kšœžœžœ žœ˜/JšžœI˜NJšžœ˜J˜—š Ÿœžœžœ žœžœ˜?Jšžœ žœ˜&Jšž˜Kšœžœžœžœ˜Kšœ žœ˜-Kšœ(˜(šœžœ˜'Kšœžœ4žœ ˜EKšžœž˜ Kšœ žœžœ˜šœ8˜8Kšœ0žœ ˜=—šœ<˜žœžœ žœ˜gJšœI˜Išžœžœž˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšžœžœ˜—JšœH˜HJšœ˜Jšžœ˜J˜—Jšœ5˜5šœ&˜&Jšœ"˜"Jšœ˜Jšœ˜Jšœ˜Jšœ˜—Jšœ$Οc'˜KJšœ˜—J˜J˜Jšœ­˜­Jšžœ˜J˜——…—j"˜