国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務合肥法律

代做CS 211: Computer Architecture

時間:2024-04-15  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



CS 211: Computer Architecture, Spring 2024
Programming Assignment 5: Simulating Caches (100 points)
Instructor: Prof. Santosh Nagarakatte
Due: April 25, 2024 at 5pm Eastern Time.
Introduction
The goal of this assignment is to help you understand caches better. You are required to write a
cache simulator using the C programming language. The programs have to run on iLab machines.
We are providing real program memory traces as input to your cache simulator.
No cheating or copying will be tolerated in this class. Your assignments will be automatically
checked with plagiarism detection tools that are powerful. Hence, you should not look at your
friend’s code or use any code from the Internet or other sources such as Chegg/Freelancer. We
strongly recommend not to use any large language model and use the code sample provided by
it as it will likely trigger plagiarism violations. All violations will be reported to office of student
conduct. See Rutgers academic integrity policy at:
http://academicintegrity.rutgers.edu/
Memory Access Traces
The input to the cache simulator is a memory access trace, which we have generated by executing
real programs. The trace contains memory addresses accessed during program execution. Your
cache simulator will have to use these addresses to determine if the access is a hit or a miss, and
the actions to perform in each case. The memory trace file consists of multiple lines. Each line of
the trace file corresponds to a memory access performed by the program. Each line consists of two
columns, which are space separated. First column lists whether the memory access is a read (R)
or a write (W) operation. The second column reports the actual 48-bit memory address that has
been accessed by the program. Here is a sample trace file.
R 0x9cb3d40
W 0x9cb3d40
R 0x9cb3d44
W 0x9cb3d44
R 0xbf8ef498
Part One - One Level Cache - 50 points
You will implement a cache simulator to evaluate different configurations of caches. The followings
are the requirements for the first part of the cache simulator.
1
• Simulate only one level cache; i.e., an L1 cache.
• The cache size, associativity, the replacement policy, and the block size are input parameters.
Cache size and block size are specified in bytes.
• You have to simulate a write through cache.
• Replacement Algorithm: You have to support two replacement policies. The two replacement
policies are: First In First Out (FIFO) and Least Recently Used (LRU).
Next, you will learn more about cache replacement policies.
Cache Replacement Policies
The goal of the cache replacement policy is to decide which block has to be evicted in case there is no
space in the set for an incoming cache block. It is always preferable – to achieve the best performance
– to replace the block that will be re-referenced furthest in the future. In this assignment, you will
use two different ways to implement the cache replacement policy: FIFO and LRU.
FIFO
When the cache uses the FIFO replacement policy, it always evicts the block accessed first in the
set without considering how often or how many times the block was accessed before. So let us say
that your cache is empty initially and that each set has two ways. Now suppose that you access
blocks A, B, A, C. To make room for C, you would evict A since it was the first block to be brought
into the set.
LRU
When the cache used the LRU replacement policy, it discards the least recently used items first.
The cache with an LRU policy has to keep track of all accesses to a block and always evict the
block that been used (or accessed) least recently as the name suggests.
Cache Simulator Interface
You have to name your cache simulator first. Your program should support the following usage
interface:
./first <cachesize> <assoc:n> <cache policy> <block size> <trace file>
where:
• The parameter cache size is the total size of the cache in bytes. This number should be a
power of 2.
2
• The parameter assoc:n specifies the associativity. Here, n is a number of cache lines in a set.
• The parameter cache policy specifies the cache replacement policy, which is either fifo or
lru.
• The parameter block size is a power of 2 that specifies the size of the cache block in bytes.
• The parameter trace file is the name of the trace file.
Simulation Details
• When your program starts, there is nothing in the cache. So, all cache lines are empty.
• You can assume that the memory size is 248 . Therefore, memory addresses are at most 48
bit (zero extend the addresses in the trace file if they are less than 48-bit in length).
• The number of bits in the tag, cache address, and byte address are determined by the cache
size and the block size.
• For a write-through cache, there is the question of what should happen in case of a write
miss. In this assignment, the assumption is that the block is first read from memory (i.e.,
one memory read), and then followed by a memory write.
• You do not need to simulate data in the cache and memory in this assignment. Because,
the trace does not contain any information on data values transferred between memory and
caches.
Sample Run
Your program should print out the number of memory reads (per cache block), memory writes (per
cache block), cache hits, and cache misses. You should follow the exact same format shown below
(no space between letters), otherwise, the autograder can not grade your program properly.
./first ** assoc:2 fifo 4 trace1.txt
memread:336
memwrite:334
cachehit:664
cachemiss:336
The above example, simulates a 2-way set associate cache of size ** bytes. Each cache block is 4
bytes. The trace file name is trace1.txt.
Note: Some of the trace files are quite large. So it might take a few minutes for the autograder to
grade all testcases.
3
Part II - Two Level Cache - 50 points
Most modern CPUs have multiple level of caches. In the second part of the assignment, you have
to simulate a system with a two-level of cache (i.e., L1 and L2). Multi-level caches can be designed
in various ways depending on whether the content of one cache is present in other levels or not.
In this assignment you implement an exclusive cache: the lower level cache (i.e., L2) contains only
blocks that are not present in the upper level cache (i.e., L1).
Exclusive Cache
Consider the case when L2 is exclusive of L1. Suppose there is a read request for block X. If the
block is found in L1 cache, then the data is read from L1 cache. If the block is not found in the
L1 cache, but present in the L2 cache, then the cache block is moved from the L2 cache to the L1
cache. If this causes a block to be evicted from L1, the evicted block is then placed into L2. If the
block is not found in either L1 or L2, then it is read from main memory and placed just in L1 and
not in L2. In the exclusive cache configuration, the only way L2 gets populated is when a block is
evicted from L1. Hence, the L2 cache in this configuration is also called a victim cache for L1.
Sample Run
The details from Part 1 apply here to the second level L2 cache. Your program gets two separate
configurations (one for level 1 and one for level 2 cache). Both L1 and L2 have the same block size.
Your program should report the total number of memory reads and writes, followed by cache miss
and hit for L1 and L2 cache. Here is the format for part 2.
./second <L1 cache size> <L1 associativity> <L1 cache policy> <L1 block size>
<L2 cache size> <L2 associativity> <L2 cache policy> <trace file>
This is an example testcase for part 2.
./second ** assoc:2 fifo 4 64 assoc:16 lru trace2.txt
memread:**77
memwrite:2**
l1cachehit:6501
l1cachemiss:3499
l2cachehit:222
l2cachemiss:**77
The above example, simulates a 2-way set associate cache of size ** bytes. bytes with block size of
4 for L1 cache. Similarly, L2 cache is a fully associate cache of size 64 bytes. Further, the trace file
used for this run is trace2.txt. As you can see, the program outputs the memory read and memory
writes followed by the L1 and L2 cache hits and misses in the order shown above.
4
Structure of your submission
All files must be included in the pa5 folder. The pa5 directory in your tar file must contain 2
subdirectories, one each for each of the parts. The name of the directories should be named first
and second. Each directory should contain a c source file, a header file (optional) and a Makefile.
To create this file, put everything that you are submitting into a directory named pa5. Then, cd
into the directory containing pa5 (i.e., pa5’s parent directory) and run the following command:
tar cvf pa5.tar pa5
To check that you have correctly created the tar file, you should copy it (pa5.tar) into an empty
directory and run the following command:
tar xvf pa5.tar
This is how the folder structure should be.
* pa5
- first
* first.c
* first.h
* Makefile
- second
* second.c
* second.h
* Makefile
Autograder
First Mode
Testing when you are writing code with a pa5 folder.
• Let us say you have a pa5 folder with the directory substructure as described in the assignment
description.
• copy the pa5 folder to the directory of the autograder.
• Run the autograder with the following command.
python3 pa5_autograder.py
It will run the test cases and print your scores.
5
Second Mode
This mode is to test your final submission (i.e., pa5.tar)
• Copy pa5.tar to the autograder directory.
• Run the autograder with pa5.tar as the argument as shown below
python3 pa5_autograder.py pa5.tar
Grading Guidelines
This is a large class so that necessarily the most significant part of your grade will be based on
programmatic checking of your program. That is, we will build the binary using the Makefile and
source code that you submitted, and then test the binary for correct functionality against a set of
inputs. Thus:
• You should not see or use your friend’s code either partially or fully. We will run state of the
art plagiarism detectors. We will report everything caught by the tool to Office of Student
Conduct.
• You should make sure that we can build your program by just running make.
• Your compilation command with gcc should include the following flags: -Wall -Werror -
fsanitize=address
• You should test your code as thoroughly as you can. For example, programs should not crash
with memory errors.
• Your program should produce the output following the example format shown in previous
sections. Any variation in the output format can result in up to 100% penalty. Be especially
careful to not add extra whitespace or newlines. That means you will probably not get any
credit if you forgot to comment out some debugging message.
• Your folder names in the path should have not have any spaces. Autograder will not work if
any of the folder names have spaces.
Be careful to follow all instructions. If something doesn’t seem right, ask on Canvas discussion
forums or contact the TAs during office hours.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

















 

掃一掃在手機打開當前頁
  • 上一篇:CS 2550代做、代寫SQL設計編程
  • 下一篇:菲律賓國旗(國旗的含義是什么)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業(yè)
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關于我們 | 打賞支持 | 廣告服務 | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久精品国产精品亚洲| 国产福利久久| 国产成人免费观看| 黄色片视频在线播放| 国产精品福利在线观看| 黄色一级一级片| 久久中文久久字幕| 成人精品久久一区二区三区| 午夜欧美不卡精品aaaaa| 91免费在线观看网站| 日本一区视频在线| 国产精品美女午夜av| 国产欧美欧洲| 日产精品久久久一区二区| 久久精品这里热有精品| 国产综合色香蕉精品| 中文字幕一区二区三区四区五区人| 国产精品96久久久久久又黄又硬| 欧美一区视久久| 欧美精品久久久久a| 久久香蕉综合色| 狠狠色综合一区二区| 尤物av无码色av无码| 国产成人亚洲欧美| 精品一区二区久久久久久久网站| 亚洲综合国产精品| 国产成人久久精品| 99免费视频观看| 欧美日韩日本网| 亚洲三区视频| 国产精品狼人色视频一区| 91久久中文字幕| 欧美日韩在线不卡视频| 又粗又黑又大的吊av| 久久久久久免费看| 国产一区二区三区高清视频| 亚洲va久久久噜噜噜| 国产精品久久久久免费a∨| 91久久夜色精品国产网站| 黄色大片中文字幕| 污视频在线免费观看一区二区三区| 国产精品视频午夜| 成人97在线观看视频| 国产精品电影一区| 99在线视频免费观看| 欧美性受xxx| 中文字幕av日韩精品| 久久久久亚洲精品| 国产欧美日韩在线播放| 日本不卡一二三区| 久久av在线看| 久久精品99久久| 国产剧情日韩欧美| 欧美午夜视频在线| 亚州av一区二区| 精品国产乱码久久久久久108| 久久综合狠狠综合久久综青草| 精品无码av无码免费专区| 日韩国产欧美一区| 丁香六月激情婷婷| 久久这里有精品| 久久精品99久久香蕉国产色戒| 91av成人在线| www.com毛片| 精品日韩在线播放| 日韩精品一区二区三区四| 亚洲精品一区国产精品| 国产精品电影一区| 国产精品网红直播| 日韩中文视频免费在线观看| 91九色蝌蚪国产| 国产久一一精品| 国产在线xxxx| 极品粉嫩国产18尤物| 日韩精品一区二区三区色欲av| 亚洲精品偷拍视频| 亚洲最大成人网色| 欧美日韩成人网| 欧美成人免费一级人片100| 国产精品入口日韩视频大尺度| 国产二区不卡| 国产高清自拍99| 91精品国产综合久久香蕉| av免费网站观看| 国产精品一区二区电影| 国产日韩精品在线播放| 黄页网站大全在线观看| 精品欧美一区免费观看α√| 欧美中文在线免费| 欧洲精品久久久| 茄子视频成人免费观看| 日av中文字幕| 欧美中日韩在线| 欧美极品欧美精品欧美图片| 欧美中文字幕在线播放| 欧洲成人一区二区| 青青草视频国产| 欧美日韩国产精品一区二区| 欧美日韩视频免费在线观看| 欧美一区二区综合| 欧美精品一区二区视频| 欧美精品免费观看二区| 欧美 日韩 激情| 国模吧一区二区| 高清亚洲成在人网站天堂| 阿v天堂2017| 久久久免费在线观看| 久久精品国产精品青草色艺| 色婷婷综合久久久久| 久久天堂电影网| 国产精品久久91| 美女精品视频一区| 亚洲一区二区在线看| 痴汉一区二区三区| 日本久久久久久| 欧美亚洲国产日韩2020| 国产综合精品一区二区三区| 成人h视频在线| 久久理论片午夜琪琪电影网| 日韩中文字在线| 久久综合久久88| 亚洲一区国产精品| 人偷久久久久久久偷女厕| 精品无人乱码一区二区三区的优势| 国产嫩草一区二区三区在线观看| 成人综合视频在线| 国产超级av在线| 国产精品麻豆va在线播放| 欧美激情中文字幕在线| 日韩av一区二区三区在线观看| 欧美精品一区二区性色a+v| 国产日本欧美一区二区三区 | 欧美一区二区激情| 欧美国产综合视频| 国产美女在线精品免费观看| av一区二区在线看| 久久av免费观看| 国产精品国产一区二区| 亚洲精蜜桃久在线| 欧美亚洲视频一区| 成人中文字幕av| 日韩亚洲在线观看| 欧美激情日韩图片| 日韩高清专区| 国产内射老熟女aaaa| 国产成人精品免高潮费视频| 久久天天躁狠狠躁夜夜爽蜜月| 欧美激情一二区| 日韩激情免费视频| 成人一级生活片| 国产v亚洲v天堂无码| 欧美精品亚州精品| 日本精品一区二区三区不卡无字幕 | 北条麻妃在线视频观看| 国产成人免费电影| 亚洲精品免费网站| 黄黄视频在线观看| 国产传媒久久久| 欧美日韩福利电影| 欧美在线一区二区视频| 9a蜜桃久久久久久免费| 国产成人生活片| 中文字幕一区二区三区精彩视频| 欧美怡红院视频一区二区三区| 成人h视频在线| 国产精品久久久久久久久久99 | 国产精品高潮在线| 日本精品一区二区三区高清 久久| 国产美女无遮挡网站| 国产成人无码精品久久久性色 | 国产女人18毛片| 国产精品欧美一区二区| 日本欧美中文字幕| 97色伦亚洲国产| 欧美日韩不卡合集视频| 精品人妻大屁股白浆无码| 国产成人精品电影久久久| 一本久道中文无码字幕av| 国产综合在线看| 久久人人爽人人爽人人片亚洲| 性欧美亚洲xxxx乳在线观看| 国产精品一区=区| 久久成人精品一区二区三区| 日韩手机在线观看视频| 久久青草精品视频免费观看| 亚洲一区二区三区av无码| 国产日韩一区欧美| 国产精品久久久久久久久久三级 | 国产精品69页| 亚洲人久久久| 成人国产一区二区| 欧美精品video| 国产熟女高潮视频| 国产精品久久久久秋霞鲁丝| 日韩激情免费视频| 久久国产一区| 日本不卡在线观看| 久久久久久久激情视频| 日韩精品久久一区二区三区| 久久精品ww人人做人人爽|