The purpose of this assigment is to:
This assignment is to be completed individually.
NOTE: this assignment writeup is a work in progress. If you discover any problems or issues, please let me know as soon as possible.
In this homework, you will be compile, run, and then simulate a very simple program that simulates a simple CPU. In other words, you will simulate a simulator.
The program in question is from Prof. Daniel Jimenez at TAMU, and is a simple toy simulator that estimates the CPI of a multi-cycle CPU. The source code is here.
The results of all steps need to be neatly documented in a report you must upload to canvas for grading.
Download sim.cc into a suitable directory on a linux machine.
Follow the directions in Part I of the gem5 tutorial to build gem5, create a simple configuration script, and adding cache to the configuration script.
If you have a personal linux machine, you will have to make sure the "scons" and "swig" packages are installed.
If you have a reasonably fast PC with a decent amount of memory, but it runs windows, I highly recommend running linux in a virtual machine using the Virtual Box platform. It is quite straightforward to create a VM and install the latest stable version of Ubuntu on it.
If you are using the best-tux.cae.wisc.edu machines, you will need to issue the following command to pick up locally-installed versions of scons and swig (you can also add this to the .bashrc file in your home directory, if you wish; that way it is automatically performed whenever you log in):
$ source /home/vhosts/ece752.ece.wisc.edu/.bashrc
The above script will also set GEM5=/home/vhosts/ece.752.wisc.edu/src/gem5 as a shortcut to find the gem5 install on the best-tux machines. You should create your own installation and set this variable to point to that location.
NOTE: There is one small issue with the compilation command in the Learning gem5 book: it will not compile the MinorCPU model by default. Use the following command instead:
Run your sim.opt program in gem5 instead of the 'hello' example from the tutorial by changing the location of the binary in the configuration file. Use the two_level.py file you created while following the tutorial.
By default, gem5 will write the output file to the same folder (m5out) every time. Make sure to move your output file before a subsequent run.
You should run the sim.opt program a total of twelve times in the configurations shown below, varying the CPU model, clock frequency, and main memory. You will need to refer to the tutorial to figure out how to do modify these configuration parameters.
CPU Model | CPU Frequency (GHz) | Memory |
TimingSimpleCPU | 1 | DDR3_1600_8x8 |
TimingSimpleCPU | 2 | DDR3_1600_8x8 |
TimingSimpleCPU | 4 | DDR3_1600_8x8 |
MinorCPU | 1 | DDR3_1600_8x8 |
MinorCPU | 2 | DDR3_1600_8x8 |
MinorCPU | 4 | DDR3_1600_8x8 |
TimingSimpleCPU | 4 | DDR3_2133_8x8 |
TimingSimpleCPU | 4 | LPDDR2_S4_1066_1x32 |
TimingSimpleCPU | 4 | HBM_1000_4H_1x64 |
MinorCPU | 4 | DDR3_2133_8x8 |
MinorCPU | 4 | LPDDR2_S4_1066_1x32 |
MinorCPU | 4 | HBM_1000_4H_1x64 |
After collecting all of the data from the previous steps, analyze the statistics your runs generated and write a report. Your report should be nicely-formatted PDF file, and should answer the following questions:
Submit your archive and report to the Dropbox on Canvas.