Originally from University of Wisconsin-Madison CS/ECE 752.
Due on January 20 11:59 pm (PST): See Submission for details
GitHub Classroom link for 154B: https://classroom.github.com/a/U2i19Erv GitHub Classroom link for 201A: https://classroom.github.com/a/5c60g6T7
In this assignment you are going to develop and run a set of experiments to test the effects of changing different components of a computer system on its performance. We will use the Iron Law of Performance to guide our experiments. We will investigate the effects of changing the ISA and the CPU frequency on the performance of a computer system.
Our research question is: For a simple CPU model (i.e., fixed microarchitecture), does ISA or technology make a bigger impact on system performance?
You are going to use a matrix multiplication program as the workload for your experiments. Matrix multiplication is a commonly used kernel in many domains such as linear algebra, machine learning, and fluid dynamics.
For this assignment we are going to use a matrix multiplication program as our workload.
The program takes and integer as input that determines the size
of the square matrices A
, B
, and C
.
void multiply(double **A, double **B, double **C, int size)
{
for (int i = 0; i < size; i++) {
for (int k = 0; k < size; k++) {
for (int j = 0; j < size; j++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
}
We have provided three gem5 workloads for you that you can get with obtain_resources
, one for RISC-V, one for Arm, and one for x86.
The names are:
matrix_multiply_riscv_run
matrix_multiply_arm_run
matrix_multiply_x86_run
These workloads have gem5 region of interest (ROI) markers that allow you to measure the performance of the matrix multiplication program.
By default, at the beginning of the ROI the statistics will be reset.
At the end of the ROI, the statistics will be dumped to the stats.txt
file.
Additionally, when gem5 exits, the statistics will be dumped to the stats.txt
file.
CAVEAT [PLEASE READ CAREFULLY]: When using these workloads with gem5, your simulation will output two sets of statistics in the same
stats.txt
file. Each set of statistics start with a line like below.
---------- Begin Simulation Statistics ----------
Please make sure to ignore the second set of generated statistics in your analysis.
For this assignment, we will set up an experiment to see effect of changing a system’s component on it performance.
You will need to write configuration scripts using gem5’s stdlib that allow you to change the ISA, CPU and cache frequency.
Under the components
directory, you will find modules that define the different models that you should use in your configuration scripts.
RISCVBoard
, X86Board
, and ArmBoard
in this assignment.RISCVSingleCycleCPU
, ArmSingleCycleCPU
, and X86SingleCycleCPU
for this assignment.MESITwoLevelCache
in this assignment.DDR3
memory in this assignment.Remember, you should use the --outdir
option to specify the output directory for your simulation results so that they do not overwrite each other.
Each simulation should take between 1-5 minutes.
Complete the following steps and answer the questions for your report. Collect data from your simulation runs and use simulator statistics to answer the questions. Use clear reasoning and visualization to drive your conclusions.
Before starting with simulations, answer the following questions in your report.
Write a gem5 runscript that allows you to run either the RISC-V, Arm, or x86 matrix multiplication program. Use a frequency of 1 GHz and DDR3 as the memory model.
In your report, answer the following questions after simulation supported with data.
Hint: In
workloads/matmul-basic
the makefile will generate the assembly code for the matrix multiplication program for each ISA based on the binary provided. You may find that useful to understand the differences between the ISAs.
Add the ability to change the frequency of the CPU and cache in your configuration script. Use DDR3 as the memory model.
In your report, answer the following questions after simulation supported with data.
Answer the following question in your report based on the four steps above.
For a simple CPU model (i.e., fixed microarchitecture), does ISA or technology make a bigger impact on system performance?
We gathered data on the effects of the ISA with a fixed memory and frequency and the effects of the frequency with a fixed ISA and memory Use the data you gathered to support your answer to the research question.
Answer the following questions in your report.
You will submit this assignment via GitHub Classroom.
questions.md
file.Make sure you include both your runscript, an explanation of how to use your script, and the questions to the questions in the questions.md
file.
Include a detailed explanation of how to use your script and how you use your script to generate your answers (this will be more applicable in future assignments).
Make sure that all paths are relative to this directory (assignment-1/
).
The code included in the “Example command to run the script” section should be able to be copied and pasted into a terminal and run without modification.
questions.md
.questions.md
.questions.md
.questions.md
.
You are required to work on this assignment individually. You may discuss high level concepts with others in the class but all the work must be completed by you.
Remember, DO NOT POST YOUR CODE PUBLICLY ON GITHUB! Any code found on GitHub that is not the base template you are given will be reported to SJA. If you want to sidestep this problem entirely, don’t create a public fork and instead create a private repository to store your work.