- Linux or Mac OSX environment
- g++ compiler
-
Put all unzipped files into a single directory.
- Note: The exception to this is the ‘../Program/‘ directory, which contains Program1File1.txt and Program2File1.txt.
- Note: If you replace either Program with a new file,
make sure to adjust
PROGRAM1orPROGRAM2#definesin Testbench.hpp. (see above)
-
Configure the Testbench.hpp to suit different cache variations. (see above)
-
In terminal, navigate to the containing directory
-
Run -> 'make'. This will compile the source code.
-
Run -> './sisyphus_mips_emulator'. This will run the program simulation. Output will be to Terminal.
-
On termination of the program, the code outputs:
- The entire memory of our program
- A summarized output
Example Output:
************************************************************* * _______ __ __ * * | ___|.--.--.-----.----.--.--.| |_|__|.-----.-----. * * | ___||_ _| -__| __| | || _| || _ | | * * |_______||__.__|_____|____|_____||____|__||_____|__|__| * * ______ __ __ __ * * | |.-----.--------.-----.| |.-----.| |_.-----.| | * * | ---|| _ | | _ || || -__|| _| -__||__| * * |______||_____|__|__|__| __||__||_____||____|_____||__| * * |__| * ************************************************************* * * * Inputs: * * \ * * \--> iCache Size = 256 * * \ * * \--> dCache Size = 128 * * \ * * \--> Block Fill Size = 1 * * \ * * \--> Cache Write Policy = Write Back * * \ * * \--> Program = Programs/Program2File1.txt * * * * Results: * * \ * * \--> Memory[6] = 1 * * \ * * \--> Memory[7] = 543780465 * * \ * * \--> Memory[8] = 544109430 * * \ * * \--> Memory[9] = 543780465 * * \ * * \--> iCache Hit Rate = 99.10886% * * \ * * \--> dCache Hit Rate = 68.16000% * * \ * * \--> # of instructions = 15598 * * \ * * \--> Clock Cycles = 22986 * * \ * * \--> CPI = 1.474 * * * *************************************************************
- Open Testbench.hpp in a text editor.
- Change relevant parameters. Save.