1. Homepage
  2. Programming
  3. 1DT038 Computer Architecture 2024 Spring Final Project Part 1: L1 Data Cache

1DT038 Computer Architecture 2024 Spring Final Project Part 1: L1 Data Cache

Engage in a Conversation
UPPSALA1DT038Computer ArchitectureC++L1 Data CacheGem5

Computer Architecture 2024 Spring CourseNana.COM

Final Project Part 1 CourseNana.COM

Overview CourseNana.COM

Tutorial CourseNana.COM

Part 1 (5%) CourseNana.COM

Write C++ program to analyze the specification of L1 data cache. Part 2 (5%) CourseNana.COM

Given the hardware specifications, try to get the best performance for more complicated program. CourseNana.COM

Gem5 Introduction CourseNana.COM

What is Gem5 simulator ? CourseNana.COM

  • ●  A modular platform for computer-system architecture research. CourseNana.COM

  • ●  Can help investigate impact of microarchitechture to applications. CourseNana.COM

  • ●  For example, the cache size, cpu and memory architecture could all be CourseNana.COM

    configured. CourseNana.COM

    ./build/X86/gem5.opt ./configs/example/fs.py --num-cpu=4 \
    --cpu-clock=2GHz \
    --caches --l2cache \ --cpu-type=TimeSimpleCPU \
    CourseNana.COM

    --mem-size=4GB \ --mem-type=DDR4_2400_8x8 CourseNana.COM

What information can we get and for what? CourseNana.COM

Timing, memory bandwidth, miss rate, details of executed instructions, etc. Timing DCache miss rate CourseNana.COM

You can find this information in stats.txt CourseNana.COM

Executed instructions CourseNana.COM

Environment Setup CourseNana.COM

Steps of Environment Setup CourseNana.COM

TA has already built the Gem5 environment in a Docker Image, all you need to do is install the Docker and download the image. CourseNana.COM

Steps: CourseNana.COM

1. Linux installation
2. Docker installation
3. Download Gem5 image 4. Run Gem5 simulation
CourseNana.COM

(If your computer already has Docker, you can skip step 1 & step 2) CourseNana.COM

Step1. Linux installation CourseNana.COM

Since Docker needs to run in a Linux environment, if your OS is a Windows, we strongly recommend you install WSL2. CourseNana.COM

  1. (1)  Open the command prompt (cmd) and type CourseNana.COM

    $ wsl --install -d Ubuntu CourseNana.COM

  2. (2)  Restart your computer CourseNana.COM

  3. (3)  Re-open the cmd, type wsl to enter the Linux environment CourseNana.COM

Step2. Docker installation CourseNana.COM

  1. Open your Linux environment CourseNana.COM

  2. Use the following commands to install Docker. CourseNana.COM

$ curl -fsSL https://get.docker.com -o get-docker.sh $ sudo sh get-docker.sh CourseNana.COM

3. Add user name to the docker group. CourseNana.COM

$ sudo gpasswd -a $USER docker $ newgrp docker CourseNana.COM

Step2. Docker installation (option) CourseNana.COM

If you want to use the Docker GUI, you can follow the installation steps on this website: https://docs.docker.com/desktop/install/windows-install/ CourseNana.COM

Step3. Download Gem5 image CourseNana.COM

Step4. Run Gem5 simulation CourseNana.COM

Go to home directory and use ./run_system<1|2> <CPP_FILE> to run the simulation. CourseNana.COM

$ cd /home
$ ./run_system1 example.cpp
CourseNana.COM

If there is no error in your cpp file, you will get the following text. CourseNana.COM

You can then go to stats.txt file to find more simulation information. CourseNana.COM

Docker commands CourseNana.COM

$ docker start 2024CA_FP
$ docker exec -it 2024CA_FP bash
CourseNana.COM

  • ●  Copy file from container to local (type it outside the container) docker cp 2024CA_FP:<PATH_IN_CONTAINER> <FILE_NAME> CourseNana.COM

  • ●  Copy file from local to container (type it outside the container) docker cp <FILE_NAME> 2024CA_FP:<PATH_IN_CONTAINER> CourseNana.COM

Description CourseNana.COM

In project1, we have created two simple computer systems, both of which have the same hardware architecture, differing only in the specifications of their L1 data caches. CourseNana.COM

Your task is to find out the specifications of these two L1 data caches by writing C++ programs. We will show you more detailed information on the next page. CourseNana.COM

System Specifications CourseNana.COM

I cache size CourseNana.COM

I cache associativity CourseNana.COM

D cache size CourseNana.COM

D cache associativity CourseNana.COM

Block size CourseNana.COM

system1 CourseNana.COM

system2 CourseNana.COM

* I cache and D cache use the same policy and block size Memory size: 8192MB CourseNana.COM

Grading Policy CourseNana.COM

Report
Complete the table on the previous page. (40%) CourseNana.COM

8 blanks, each blank 5%.
For each specification, please make sure your report contain the following CourseNana.COM

information. (60%) CourseNana.COM

  1. [5%] Show the screenshot of your code and explain your design concept. (i.e. what you CourseNana.COM

    want to measure through this code) CourseNana.COM

  2. [10%] Show your measurement result in a chart format. Please clearly indicate what CourseNana.COM

    information you extracted from the stats.txt file and what you observed from the chart. CourseNana.COM

4 specs, each spec 15%. CourseNana.COM

Submission CourseNana.COM

Please submit your report and code on E3 before 23:59 on May 23, 2024. Format CourseNana.COM

  • ○  Report name: FP1_team<ID>_report.pdf CourseNana.COM

  • ○  Code: please put all your code in a folder CourseNana.COM

    named FP1_team<ID>_code and compress it into a zip file with same name. CourseNana.COM

FAQ CourseNana.COM

What program should I write?
We do not limit the content of your program, but if you have no direction, you can refer CourseNana.COM

to p.35-42 of this slide. CourseNana.COM

How to write program in Docker?
You can write your program on your local computer and copy it into the Docker CourseNana.COM

container using docker cp command (see p.13). Or you can use Vim to write the program directly in Docker (see Appendix). CourseNana.COM

How to execute my program?
Please follow the steps in p.12 CourseNana.COM

Appendix – Vim CourseNana.COM

What is Vim? CourseNana.COM

  • ●  Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. CourseNana.COM

  • ●  There are many commands in Vim. We will only teach you the most basic ones, while more advanced commands can be found on this website. CourseNana.COM

How to use Vim? CourseNana.COM

1. Type vim <FILE_NAME> in terminal to open Vim editor. $ vim test.cpp CourseNana.COM

2. Press button i to enter insert mode CourseNana.COM

CourseNana.COM

How to use Vim? CourseNana.COM

  1. Modify files with keyboard (use ↑↓←→ button to shift the cursor) CourseNana.COM

  2. Press button esc to return to command mode CourseNana.COM

  3. Type :wq , and then press enter to return to terminal CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UPPSALA代写,1DT038代写,Computer Architecture代写,C++代写,L1 Data Cache代写,Gem5代写,UPPSALA代编,1DT038代编,Computer Architecture代编,C++代编,L1 Data Cache代编,Gem5代编,UPPSALA代考,1DT038代考,Computer Architecture代考,C++代考,L1 Data Cache代考,Gem5代考,UPPSALAhelp,1DT038help,Computer Architecturehelp,C++help,L1 Data Cachehelp,Gem5help,UPPSALA作业代写,1DT038作业代写,Computer Architecture作业代写,C++作业代写,L1 Data Cache作业代写,Gem5作业代写,UPPSALA编程代写,1DT038编程代写,Computer Architecture编程代写,C++编程代写,L1 Data Cache编程代写,Gem5编程代写,UPPSALAprogramming help,1DT038programming help,Computer Architectureprogramming help,C++programming help,L1 Data Cacheprogramming help,Gem5programming help,UPPSALAassignment help,1DT038assignment help,Computer Architectureassignment help,C++assignment help,L1 Data Cacheassignment help,Gem5assignment help,UPPSALAsolution,1DT038solution,Computer Architecturesolution,C++solution,L1 Data Cachesolution,Gem5solution,