首页 > 其他分享 >CSC3050 Project 4: Cache Simulation

CSC3050 Project 4: Cache Simulation

时间:2024-11-27 20:22:46浏览次数:7  
标签:multi code CSC3050 level Cache cache Project your

CSC3050 Project 4: Cache Simulation

CSC3050 Teaching GroupNovember 20, 2024

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

2 OverviewThis project is divided into three main parts:

  1. Single-Level Cache Simulation: In this part, you are required to design and implement a cache simulator that enables the single-level cache simulation. Moreoveryouneed to use the single-level cache simulator you implemented to compare the cacheperformance under different cache parameters.

Multi-level Cache Simulation: In this part, based on the single-level cache simulator, you are required to further implement a multi-level cache simulator. You needto examine further how a multi-level cache can improve performance compared to asingle-level cache.

  1. Implementation of Pre-fetching: In this section, you are required to implementa critical technique known as pre-fetching. Moreover, you need to compare the cacheperformance with and without pre-fetching3 Single-Level Cache Simulation
  • Implementation Requirements: You are required to implement a Cache class fosimulating a single-level cache (The code from [1] is a reference code for your). Thefile structure and description you may use are shown in Table 1.The simulated cache should beable to perform some parameter tuning, such as cachesize, block size, and associativity level. Besides that, you are required to simulate

1file name

Discription

include/Cache.hStatement of the Cache class.src/Cache.cppImplementation of Cache class.src/MainSinCache.cpMain entrance of the single-level cache simulator.src/MainMulCache.cppMain entrance of the multi-level cache simulator.Table 1: File structure and description of single-level and multi-level cache simulation.Parameter Values CTrue or FalseWrite AllocateTrue of False.Table 2: Parameters used in single-level cache simulation.Write Back and Write Allocate policies using the LRU replacement algorithm in yoursaved in a CSV file.

  • Performance Evaluation: After the implementation, you are required to evaluatthe cache performance based on your simulator. We will provide you with a test trace(test.trace) to facilitate the performance evaluation. What you can do includes but isnot limited toAnalyzing the trend of Miss Rate with Block Size under different cache sizesAnalyzing the change of Associativity with Miss Rate under different cache sizesAnalyzing the amount of cache misses per thousand instructions under differentcache sizesYouare also free to design scenarios for performance evaluation as you wish. Butplease analyze the performance in at least two different scenarios. You should providegraphical or tabular data and conduct the analysis based on the data mentioned above.The results and analysis should be given in your report.4 Multi-Level Cache Simulation
  • Implementation Requirements: You are required to simulate the multi-level cachein this part based on your single-level cache simulator.
  • Performance Evaluation: You should conduct the comparison between the singlelevel and multi-level cache system whose parameters are given in Table 3 and Table4, respectively. The cache miss latency is set to 100 CPU cycles. Also, graphical or

2tabular data are required and you should put the comparisons and analysis in yourL32 MB16 ways64 BytesWrite Back20 CPU CycleTable 4: Cache parameters for multi-levelcache.5 Pre-Fetching Implementation Implementation Requirements: Based on the multi-level cache simulation, you arerequired to further add the pre-fetching technique. Specifically, the mechanism is will implement a pre-fetching algorithm capable of detecting fixed-stride memoryaccess patterns; the pseudo-code of the algorithm is summarized in Algorithm 1.Algorithm1 Stride-Based Pre-fetching Algorithm1: initialize: stride = 0, is prefetch = false.2: for Each Memory Access do 3:Calculate the memory access stride (the distance between the current 代写 CSC3050 Project 4: Cache Simulation memory accesif is prefetch = false and there are more than three times with the same stride then 5:is prefetch = true6:prefetch address = current address + stride7:Prefetching(prefetch address8:Performance Evaluation: You are required to compare the performance of a multilevel cache with and without pre-fetching. The setting of the multi-level cache isthesame as that in the previous part. Moreover, the test prefetch.trace is the test trace3specificallyThe results should be included in your report.

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

  • src/*: include all source code files
  • include/*: include all header files
  • CMakelists.txt: the cmake file for your project
  • project-report.pdf: a detailed description of your implementation. The specific things

need to be included are as followsThe implementation details of your simulator.Performance evaluation and analysis mentioned above.Please compress all files into a single zip file and submit it to the BlackBoard. The file nameshould be your student ID, like 221019040.zip.

7 Grading DetailsThe overall score will be calculated as follows:

  • Single-level cache simulation code: 20%
  • Multi-level cache simulation code: 20%
  • Pre-Fetching implementation code: 40%
  • Report: 20%For the code, we will check whether your code can run or not. Please make sure that yourcode runs correctly. If the code does not run, it will be directly marked as 0 points.

8 About the reference code To reduce the difficulty 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 simplysubmit the code from the reference [1] or only do simple tasks like adding comments, weconsider that you haven’t put much effort and your grade will be directly markedaszero.

 

标签:multi,code,CSC3050,level,Cache,cache,Project,your
From: https://www.cnblogs.com/CSE231/p/18571381

相关文章

  • Flink 热存储维表 使用 Guava Cache 减轻访问压力
    目录背景GuavaCache简介实现方案1.项目依赖2.GuavaCache集成到Flink(1)定义Cache(2)使用Cache优化维表查询3.应用运行效果(1)维表查询逻辑优化(2)减少存储压力GuavaCache配置优化总结背景在实时计算场景中,Flink应用中经常需要通过维表进行维......
  • [Javascript] Import the Same JavaScript Module Multiple Times with Cache Busting
    WhenattemptingtoloadthesamemoduletwiceinJavaScriptyou'llhitacacheandcodewon'tre-run.Inscenarioswhereyouactuallydowanttohavestateinyourmodules,you'llhavetouseacache-bustingtechniquebypassingaquerypar......
  • 请描述下application cache的更新过程?
    ApplicationCache,或者说是AppCache,是一个已经被废弃的HTML5特性,用于离线存储网页资源。由于其更新机制复杂且容易出错,它已经被ServiceWorkers和CacheAPI取代。尽管如此,如果您仍然需要了解其更新过程,以下是其工作原理:manifest文件检查:浏览器会定期检查manifest......
  • CF2038A - Bonus Project 题解
    题目传送门https://codeforces.com/contest/2038/problem/A先大致捋一下题目的含义一共有n个工程师,每个工程师完成相应的工作都有一定的奖金a,但同时也会消耗成本b,目前一共有k个工作需要做这些工程师对他们的同事很友好,他们能接受自己的总收益为0来增长经验,但不能接受自己为负......
  • k8s阶段03 持久卷, PV和PVC, CSI存储方案示例csi-driver-nfs, OpenEBS, ConfigMap, Se
    2持久卷PV和PVC在Pod级别定义存储卷有两个弊端卷对象的生命周期无法独立于Pod而存在用户必须要足够熟悉可用的存储及其详情才能在Pod上配置和使用卷PV和PVC可用于降低这种耦合关系PV(PersistentVolume)是集群级别的资源,负责将存储空间引入到集群中,通常由管理员定义......
  • Java自定义函数查看OS的File Cache — 从原理到实战
    全文目录:开篇语......
  • 【Unity寻路插件】A Pathfinding Project Pro
    A*PathfindingProjectPro是一款功能强大且高度优化的路径寻路插件,专为Unity开发者打造。它基于A*算法,广泛应用于游戏AI和实时策略游戏的寻路需求,尤其适合需要高效处理复杂路径计算的大型项目。该插件不仅支持常见的二维和三维场景,还提供多种寻路算法、性能优化工具......
  • Python cachetools常用缓存算法汇总
    文章目录cachetools介绍缓存操作设置数据生存时间(TTL)自定义缓存策略缓存装饰器缓存清理cachetools超过缓存数量maxsizecachetools使用示例cachetools介绍cachetools:是一个Python第三方库,提供了多种缓存算法的实现。缓存是一种用于临时存储计算结果的技术,以......
  • Code-Projects Hospital Management System SQL注入漏洞(CVE-2024-8368)复现
    参考文献:code-projects使用PHP的医院管理系统,源代码v1.0/hms/doctor/index.phpSQL注入·问题#1·青銮机器人/CVE·GitHub的国家信息安全漏洞库(cnnvd.org.cn)免责声明本文仅用于安全研究和学习目的。请勿将文中提供的漏洞复现方法、脚本或其他信息用于未经授......
  • <Project-8.1 pdf2tx-MM> Python Flask 用浏览器翻译PDF内容 2个翻译引擎 繁简中文结果
    更新ProjectName:pdf2tx(P6)Date:5oct.24Function:在浏览器中翻译PDF文件Code:https://blog.csdn.net/davenian/article/details/142723144升级ProjectName:pdf2tx-mm(P8)7oct.24 加入多线程,分页OCR识别,提高性能与速度使用googletranslator, AzureAPI做......