系统级编程_lab11

系统级编程_lab11

ID:10237997

大小:350.00 KB

页数:6页

时间:2018-06-12

系统级编程_lab11_第1页
系统级编程_lab11_第2页
系统级编程_lab11_第3页
系统级编程_lab11_第4页
系统级编程_lab11_第5页
资源描述:

《系统级编程_lab11》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、Lab11:MemoryMountainRequirementsPlatform:ThislabassumesthatyouareusingVisualC++undera32-bitversionofWindows,usingIntelPentiumorPentium-equivalentmachines.Theexactcompilerandplatformaremostlyunimportant,asthelabisreasonablyportable.GettoknowyourCacheTh

2、isplatformofIntelPentiummachineshasamemoryhierarchy,whichincludesmultilevelofCache,suchasL1cache,L2cache,andsometimesL3Cachemaybealsoexist.Youcanusethesometools,suchaseverest.exe,tofindoutthebasicinformationofCacheofthecomputersystem,whichyouareuings.

3、Forexample,tousingeverest.exe,justdouble-clicktorunit.Afteritmakessomeinformationcollection,itwillshowalltheinformationaboutyoucomputersysteminitsframe.Thefollowingisanexampleofitsmainframe.YoucanseetheinformationabouttheCache.Now,runeverest.exetofind

4、outtheinformationofyourcomputersystem’sCache,andfilltheblank.TypeSizeinbyteL1cache64KBL2cache2ML3cacheTheprojectofmemory_mountainPleasedownloadtheprojectofmemory_mountain.rarfirst.ThisprojectiftheWindows-versionofCMUCSAPPofmountain.c,whichyoucanfindin

5、lthetextbookchapter6.6(Notes:thisisthefirstversion),lorfromhttp://csapp.cs.cmu.edu/public/1e/public/code.html/mountain.c(Notes:thisisthefirstversion)lorfromhttp://csapp.cs.cmu.edu/public/code.html/mountain.c(Notes:thisisthefirstversion)YourTask1.Readt

6、hesourcecodeinmountain.cpp,andanswerthefollowingquestions:(Notes:youdon’thavetopaytoomuchattentiononthefunctionfcyc2())1)Whatisthevariableofsizeandstrideusedfor?size是工作集的大小,即操作的数组的总大小,size越小,得到的工作集越小,时间局部性也就越好。stride是步长,表示读取的两个元素之间的间隔,stride越小,得到的空间局部

7、性越好。步长stride的范围为1~16。1)Whatisthemeaningofthereturnvalueofthefunctionrun()?Run()是一个封装函数,对于每个工作集大小size和步长stride的组合,它调用test()函数,并返回测量出的读吞吐率,单位为MB/s。2.Ifnecessary,makesomechangetothevalueofMINBYTES,MAXBYTES,andMAXSTRIDE.3.Buildtheprojectandrunit,theyoucan

8、getanoutputfilenamedasout.txt.4.Copythedatainout.txtintoanExcelfile.Justasshowninthefollowingfigure.5.ClickanycellinthisExcelfile,thenaddachart.ThenclickFinish.5.Thenyoucangetafigurealikethis:6.ThefollowingtwofiguresarefromCSAPPe1andCSAPPe2Fig

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。