项目2:缓存模拟CMPEN 431:计算机体系结构简介项目目标本课程的课程项目旨在探索微处理器设计参数的微体系结构设计空间。该项目将帮助您a)学习阅读提供的框架代码b)了解如何开发一个简单的缓存模拟模型d)一旦功能齐全,探索不同缓存层次结构的边际效益以帮助开发未来的项目2Project 2: Cache SimulationCMPEN 431:
Introduction to Computer Architecture
Due Date: 2nd December 2022 (11.59 PM) EST1. Project Goal
The course projects in this class serve to explore the microarchitectural design space ofuniprocessor design parameters. This project will help you toa) learn to read the provided framework codeb) see how a simple cache simulation model can be developedc) once fully functional, explore the marginal benefits of different cache hierarchies to helpdevelop the future project2. Instructions
1) Copy the tarball to a CSE machine and extract it into a local directory of your choosing.You should use CSE Linux Lab machines (i.e. e5-cse-135-01.cse.psu.edu through e5-cse-135-40.cse.psu.edu). To connect to these machines remotely, you should install a VPN on yourcomputer and then use ssh to connect to one of the machines. For more details, please refer tothe CSE Student Lab access information: https://www.eecs.psu.edu/cse-student-lab-access/index.aspx.
This project simulates putting the memory references and values generated through naive (O(N3) ) matrix multiplication of square matrices of size N through a parameterized cachehierarchy, that is, a specific cache will be generated respectively by the arguments in each testcase in Makefile. The arguments represent as below:1st, the size of the simulated matrix2nd, the number of matrix multiplications to perform3rd, the name of the cache level (for example, the second-level L2)4th, the size of this level5th, the associativity of this level6th, the block size of this level7th and the subsequent, the first-level L1 cache, and its arguments.If you implement it correctly, your logic would work for all these test cases. Most of thefunctionality for this program has already been provided. However, five key functions neededto properly perform caching(setSizesOffsetsAndMaskFields, getindex, gettag, writeback, fill)are currently implemented as stub functions that either does nothing, causing the program tocrash if they are relied upon. Your job will be to implement these missing functionalitieswithin the functions defined in "YOURCODEHERE.c", and descriptions of the functionalityof each function are in YOURCODEHERE.h.You will need to read through the provided framework to figure out how to properly use the"performaccess function to set local contents based on another level's data (fill) and to writedata from the local contents into the next level of the memory hierarchy (writeback).You will need to familiarize yourself with the existing functions defined in csim.c, specifically"performaccess", and the cache structure defined in csim.h, although you are not allowedto modify them. You are likewise not allowed to modify anything other than implementingthe missing functionalities within the functions defined in "YOURCODEHERE.c". You willinvoke "performaccess" in your logistic, the input argument “size” could be fixed as 8.Your project, once complete, will be able to correctly execute all tests invoked by "make test"as well as other cache and matrix configurations not present in the test list. The test list wasalready included in the Makefile. Only cache hierarchies with monotonically nondecreasingblock sizes (in integer multiples of 8 bytes) throughout the cache hierarchy will be tested.Similarly, only cache hierarchies with monotonically nondecreasing capacity from upper tolower caches will be tested.2) Ensure that your environment is correctly configured (e.g. with default gcc, etc.) byrunning "make test". You can verify the correct initial state of your environment/files bynoting the following:
a) the code should compile without any errors or warnings.b) the first test case (no cache instantiated) should run to completion and match theoutput in the included copy of the output from running “make test” on a completed version ofthe program
c) the second test case should quickly generate a “Segmentation fault” due to theunimplemented stub functions3) Modify YOURCODEHERE.c -- this is the only file you will be modifying and turning in.Your project MUST compile without modification to the Makefile, or any other source files.Your code will be recompiled against the other files in their original state, on CSE servers.Any reliance on additional modifications will likely result in non-compiling status under testand a zero for the project. Please note that the CSE lab machines are 64-bits (represented aslocalVAbits variable), so 1 word = 8 bytes. You will reflect this in your implementation.Please ensure that any code you develop on a non-CSE platform works on the CSE servers, asthe code is NOT GENERALLY PORTABLE.4) Continue to test your project. All tests in "make test" should run to completion (expectedtotal run time 1-2 minutes, mostly in the last test). Statistics from your output file (NMM-csim.testout) for matrix sizes <= N=8 should match the provided output statistics(NMM-csim.WORKING.testout) exactly. Statistics for larger matrix sizes should be very similar butthe output may or may not be identical.3. Your SubmissionYou will turn in only the "YOURCODEHERE.c" file via CANVAS. Your results will betested on CSE lab machines. In addition to your code fixes, provide, as a multi-line commentin YOURCODEHERE.c, a description of your testing approach to check whether or not youroutput is correct, given that the contents of invalid memory locations within the cache willcontain arbitrary data that may not match between different runs.
WX:codehelp
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。