DragomanCompilerRuns.mesa
Created by Sindhu, April 27, 1985 9:45:39 am PST
Bertrand Serlet October 17, 1985 4:48:14 pm PDT
Pradeep Sindhu May 25, 1986 0:23:39 am PDT
DIRECTORY
AssociativeCache, CacheModels, Commander, Convert, DirectMapCache, Dragoman, Rope;
DragomanCompilerRuns: CEDAR PROGRAM
IMPORTS AssociativeCache, Commander, Convert, Rope, Dragoman
SHARES Dragoman =
BEGIN
TwoToThe: PROC[n: INT] RETURNS[INT] = {
IF n=0 THEN RETURN[1] ELSE RETURN[2*TwoToThe[n-1]]};
MarkCompilerGFIs: PROC [handle: Dragoman.Handle] = {
Dragoman.MarkGFI[handle, "Compiler", "CompilerServer", "FileStreamPackage", "BTreeVMImpl"];
Dragoman.MarkGFI[handle, "IOPackage", "FSImpl", "ConvertUnsafeImpl", "RefTextImpl", "RopeImpl", "RopeHashImpl"];
};
DragomanCompilerRunsGo: Commander.CommandProc = {
Variable Associative SC; Fixed DirectMap BC; Fixed Associative MC
prog: Rope.ROPE ← "SimCompMediumP";
cacheType: Rope.ROPE ← "AssSC";
FOR wordsPerQuadDiv4: INT IN [1..2] DO
wordsPerQuad: INT ← 4*wordsPerQuadDiv4;
FOR linesDiv20: INT IN [1..10] DO
FOR logQuadsPerLine: INT IN [0..3] DO
quadsPerLine: INT ← TwoToThe[logQuadsPerLine];
bc, mc: CacheModels.Cache;
handle: Dragoman.Handle ← Dragoman.Start[
backingFile: Rope.Cat[
Rope.Cat[prog, ".", cacheType, "."],
Rope.Cat[Convert.RopeFromInt[20*linesDiv20], "L."],
Rope.Cat[Convert.RopeFromInt[quadsPerLine], "QPL."],
Rope.Cat[Convert.RopeFromInt[wordsPerQuad], "WPQ.ts"]],
instr: 1,
data: 1];
bc ← AssociativeCache.NewCache[lines: 512, quadsPerLine: 8, wordsPerQuad: 8];
mc ← AssociativeCache.NewCache[lines: 50, quadsPerLine: 4, wordsPerQuad: 1];
Dragoman.SetInstructionCache[handle: handle, number: 0, cache: AssociativeCache.NewCache[lines: 20*linesDiv20, quadsPerLine: quadsPerLine, wordsPerQuad: wordsPerQuad, lru: FALSE, realCache: bc, mapCache: mc]];
Dragoman.SetDataCache[handle: handle, number: 0, cache: AssociativeCache.NewCache[lines: 20*linesDiv20, quadsPerLine: quadsPerLine, wordsPerQuad: wordsPerQuad, lru: FALSE, realCache: bc, mapCache: mc]];
MarkCompilerGFIs[handle];
Dragoman.Run[handle, "///commands/compile /indigo/Dragon/Dragoman/MediumProg.mesa /indigo/Dragon/Dragoman/MediumProgImpl.mesa"];
bc.print[bc, handle.tsOut, "Real cache"];
mc.print[mc, handle.tsOut, "Map cache"];
Dragoman.End[handle];
ENDLOOP;
ENDLOOP;
ENDLOOP;
};
Commander.Register["DragomanCompilerRunsGo", DragomanCompilerRunsGo, "Starts a Dragoman simulation of the Compiler"];
END.