系统级编程_Lab11.doc_第1页
系统级编程_Lab11.doc_第2页
系统级编程_Lab11.doc_第3页
系统级编程_Lab11.doc_第4页
系统级编程_Lab11.doc_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Lab11:Memory MountainRequirementsPlatform: This lab assumes that you are using Visual C+ under a 32-bit version of Windows, using Intel Pentium or Pentium-equivalent machines. The exact compiler and platform are mostly unimportant, as the lab is reasonably portable.Get to know your Cache This platform of Intel Pentium machines has a memory hierarchy, which includes multi level of Cache, such as L1 cache, L2 cache, and sometimes L3 Cache maybe also exist.You can use the some tools, such as everest.exe, to find out the basic information of Cache of the computer system, which you are uings.For example, to using everest.exe, just double-click to run it. After it makes some information collection, it will show all the information about you computer system in its frame.The following is an example of its main frame. You can see the information about the Cache.Now, run everest.exe to find out the information of your computer systems Cache, and fill the blank.TypeSize in byteL1 cache64KBL2 cache2ML3 cacheThe project of memory_mountain Please download the project of memory_mountain.rar first.This project if the Windows-version of CMU CSAPP of mountain.c, which you can find in l the textbook chapter 6.6(Notes: this is the first version), l or from /public/1e/public/code.html/mountain.c(Notes: this is the first version)l or from /public/code.html/mountain.c(Notes: this is the first version)Your Task1Read the source code in mountain.cpp, and answer the following questions: (Notes: you dont have to pay too much attention on the function fcyc2() )1) What is the variable of size and stride used for? size是工作集的大小,即操作的数组的总大小,size越小,得到的工作集越小,时间局部性也就越好。stride是步长,表示读取的两个元素之间的间隔,stride越小,得到的空间局部性越好。步长stride的范围为116。1) What is the meaning of the return value of the function run()?Run()是一个封装函数,对于每个工作集大小size和步长stride的组合,它调用test()函数,并返回测量出的读吞吐率,单位为MB/s。2If necessary, make some change to the value of MINBYTES, MAXBYTES, and MAXSTRIDE.3Build the project and run it, the you can get an output file named as out.txt.4Copy the data in out.txt into an Excel file. Just as shown in the following figure.5Click any cell in this Excel file, then add a chart.Then click Finish.5Then you can get a figure alike this:6. The following two figures are from CSAPP e1 and CSAPP e2Figure of CSAPP e1Figure of CSAPP e27Just Paste your figure here:8How many ridges(山脊) do you get? And what are they correspond to? 有3个山脊。最高的是:L1缓存;中间是L2缓存;最低的是:memory;9Just compare the mountain with the information that you just got by running as everest.exe. And explain the How the spatial locality and temporal locality are shown in this figure.x轴可以看出stride与吞吐量的关系:stride越小,吞吐量越大,空间局部性越好,吞吐量随stride的增大而减小。图中二级缓存和memory的山脊上随着stride的增加有明显的空间局部性的斜坡,即stride越大吞吐量越小,空间局部性也越差。y轴可以看出size与吞吐量的关系:size

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论