1. Homepage
  2. Programming
  3. CSC3050 Computer Architecture Project 3: Cache Simulation

CSC3050 Computer Architecture Project 3: Cache Simulation

Engage in a Conversation
CUHKCSC3050Computer ArchitectureCache SimulationCC++RISC-V

CSC3050 Project 3: Cache Simulation CourseNana.COM

April 24, 2024 CourseNana.COM

1 Introduction CourseNana.COM

Cache is an important component of a CPU system that has a significant impact on computer performance by reducing memory access times. The focus of this project is to simulate the cache in the RISC-V architecture to give you hands-on experience with the cache system and its role in improving system performance. CourseNana.COM

2 Overview CourseNana.COM

This project is divided into three main parts: CourseNana.COM

Single-Level Cache Simulation: In this part, you are required to implement a cache simulator that enables the single-level cache simulation. After that, you are required to simulate different cache conditions for single-level cache and compare how dierent cache conditions aects the cache performance. CourseNana.COM

Multi-level Cache Simulation: In this part, based on the single-level cache simu- lator, you are required to further implement the multi-level cache simulation. You are required to further exam how multi-level cache can improve the performance. CourseNana.COM

Integration with CPU Simulation: In this part, you are required to integrate the cache simulator with CPU simulator that simulates a pipeline CPU with multi-level cache. You will also do some performance comparison between CPU with cache and CPU without cache. CourseNana.COM

Single-Level Cache Simulation CourseNana.COM

Implementation Requirements: You are required to implement a Cache class for simulating a single-level cache (The code from [1] can serve as a reference for your implementation). The file structure and description you may used are shown in Table 1. CourseNana.COM

The simulated cache should be able to perform some parameter tuning such as cache size, block size and associativity level. Besides that, you are required to simulate CourseNana.COM

file name CourseNana.COM

include/Cache.h src/Cache.cpp src/MainSinCache.cpp src/MainMulCache.cpp CourseNana.COM

Discription CourseNana.COM

Statement of the Cache class.
Implementation of Cache class.
Main entrance of the single-level cache simulator. Main entrance of the multi-level cache simulator.
CourseNana.COM

Table 1: File structure and description of single-level and multi-level cache simulation. CourseNana.COM

Write Back and Write Allocate policies using the LRU replacement algorithm in your simulation. Finally, some performance data (e.g. miss rate of the cache and total access latency) needs to be saved in a CSV file. CourseNana.COM

Performance Evaluation: For single-level cache simulation, you should compare the system performance for dierent parameter combinations as given in Table. 2. After CourseNana.COM

Parameter CourseNana.COM

Cache Size Block Size Associativity Write Back Write Allocate CourseNana.COM

Values CourseNana.COM

4KB to 1MB, incremented by 4X. 32Bytes to 256Bytes incremented by 2X. 2 to 32 incremented by 2X
True or False.
True of False.
CourseNana.COM

Table 2: Parameters used in single-level cache simulation. CourseNana.COM

that, you are required to do some analysis of the results of the simulation (We will provide you with two test traces (trace1.trace and trace2.trace) and you can choose one of them for testing and analysis). This includes, but is not limited to CourseNana.COM

Analyzing the trend of Miss Rate with Block Size under dierent cache sizes, CourseNana.COM

Analyzing the change of Associativity with Miss Rate under dierent cache sizes, CourseNana.COM

Analyzing the amount of cache misses per thousand instructions under dierent cache sizes. CourseNana.COM

You should provide graphical or tabular data and conduct the analysis based on the data mentioned above. You should put your results and analysis in your report. CourseNana.COM

4 Multi-Level Cache Simulation CourseNana.COM

Implementation Requirements: You are required to simulate the multi-level cache in this part. Your simulator is required to support the switch between two dierent types of multi-level cache: inclusive cache and exclusive cache (The referenced code in [1] is implemented as the inclusive cache). Besides that, Your simulator is also required to support the cache with a victim cache or not (The referenced code in [1] does not implement the victim cache). Specifically, the victim cache is set to the size CourseNana.COM

of 8 lines of data, and the L1 cache is direct mapped (which means the associativity is one). CourseNana.COM

Performance Evaluation: For multi-level cache simulation, you should conduct the following comparisons based on one of the test traces: CourseNana.COM

  • –  Comparing the performance between the single-level cache with the inclusive three-level cache whose parameters are given in Table 3 and Table 4, respectively. CourseNana.COM

  • –  Comparing the performance between the inclusive and exclusive three-level cache (without the victim cache) whose whose parameters are given in Table 4. CourseNana.COM

  • –  Comparing the performance between the three-level inclusive cache with and with- out victim cache. CourseNana.COM

    In addition, the cache miss latency is set to be 100 CPU cycles. Also, graphical or tabular data are required and you should put the above comparisons and analysis in your report. CourseNana.COM

Capacity Associativity Block Size Write Policy Hit Latency CourseNana.COM

16 KB 1 way 64 Bytes Write Back 1 CPU Cycle Table 3: Default cache setting used in single-level cache simulation. CourseNana.COM

Capacity CourseNana.COM

16 KB 128 KB 2 MB CourseNana.COM

Associativity CourseNana.COM

1 way 8 ways 16 ways CourseNana.COM

Block Size CourseNana.COM

64 Bytes 64 Bytes 64 Bytes CourseNana.COM

Write Policy CourseNana.COM

Write Back Write Back Write Back CourseNana.COM

Hit Latency CourseNana.COM

1 CPU Cycle CourseNana.COM

8 CPU Cycle 20 CPU Cycle CourseNana.COM

Integration with CPU Simulator CourseNana.COM

Implementation Requirements: You are required to integrate multi-level cache with the pipeline CPU. You can directly use the CPU simulator in [1] to simplify your work. In this part you need to simulate a inclusive three-level cache without victim cache. The cache parameters are set according to Table 4. CourseNana.COM

Performance Evaluation: You should run some RISC-V programs (We will provide some reference programs from [1]) to compare and analyze the CPI of each RISC-V program with and without Cache. An example is given in Table 5. You should put your data and analysis on your report. CourseNana.COM

Table 4: Default cache setting used in multi-level cache simulation. CourseNana.COM

6 Submission CourseNana.COM

For this project, you must use C/C++ to implement the cache simulator. If you use python, you will get a 0 score. You need to submit the following files: CourseNana.COM

File name CPI without Cache CPI with Cache CourseNana.COM

helloworld 1.3333 1.6286 Table 5: Example of the CPI comparison. CourseNana.COM

  • src/*: include all source code files CourseNana.COM

  • include/*, include all header files CourseNana.COM

  • CMakelists.txt, the cmake file for your project CourseNana.COM

  • project-report.pdf: a detailed introduction to your project. The specific things that need to be included are as follows: CourseNana.COM

    • –  The implementation details of your simulator (how to implement victim cache and exclusive cache etc.) CourseNana.COM

    • –  Performance analysis and discussion mentioned above.
      Please compress all files into a single zip file and submit it to the BlackBoard. The file name
      CourseNana.COM

      should be your student ID, like xxxxxxxxx.zip. CourseNana.COM

7 Grading Details CourseNana.COM

The overall score will be calculated as follows: CourseNana.COM

  • Single-level cache simulation: 20% CourseNana.COM

  • Multi-level cache simulation: 30% CourseNana.COM

    Implementing inclusive multi-level cache simulation without victim cache: 10% Implementing exclusive multi-level cache: 10%
    Implementing victim cache: 10% CourseNana.COM

  • Integrating multi-level cache with CPU: 10%
    Using the CPU simulator implemented by yourself: 10 points bouns. CourseNana.COM

  • Report: 40% CourseNana.COM

    Performance analysis for single-level cache simulation: 10%. Performance analysis for multi-level cache simulation: 20%. Performance analysis for integration with CPU: 10%. CourseNana.COM

  • About the reference code: To reduce the diculty and complexity of implementation, we encourage you to refer to existing code like [1]. This project is also designed based on [1]. However, if you simply submit the code from the reference [1] or only do simple tasks like adding comments, we consider that you haven’t put much eort and your grade of the coding part will be directly marked as zero (You can still get the grade of the report). CourseNana.COM

CourseNana.COM

References CourseNana.COM

[1] Hao He, “RISCV-Simulator,” https://github.com/hehao98/RISCV-Simulator, 2019. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
CUHK代写,CSC3050代写,Computer Architecture代写,Cache Simulation代写,C代写,C++代写,RISC-V代写,CUHK代编,CSC3050代编,Computer Architecture代编,Cache Simulation代编,C代编,C++代编,RISC-V代编,CUHK代考,CSC3050代考,Computer Architecture代考,Cache Simulation代考,C代考,C++代考,RISC-V代考,CUHKhelp,CSC3050help,Computer Architecturehelp,Cache Simulationhelp,Chelp,C++help,RISC-Vhelp,CUHK作业代写,CSC3050作业代写,Computer Architecture作业代写,Cache Simulation作业代写,C作业代写,C++作业代写,RISC-V作业代写,CUHK编程代写,CSC3050编程代写,Computer Architecture编程代写,Cache Simulation编程代写,C编程代写,C++编程代写,RISC-V编程代写,CUHKprogramming help,CSC3050programming help,Computer Architectureprogramming help,Cache Simulationprogramming help,Cprogramming help,C++programming help,RISC-Vprogramming help,CUHKassignment help,CSC3050assignment help,Computer Architectureassignment help,Cache Simulationassignment help,Cassignment help,C++assignment help,RISC-Vassignment help,CUHKsolution,CSC3050solution,Computer Architecturesolution,Cache Simulationsolution,Csolution,C++solution,RISC-Vsolution,