首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做CSC3050、代写C/C++程序语言
项目预算:
开发周期:
发布时间:
要求地区:
CSC3050 Project 4: Cache Simulation
CSC3050 Teaching Group
November 20, 2024
1 Introduction
Cache is an important component of a CPU system that has a signiffcant impact on computer
performance by reducing memory access times. The focus of this project is to simulate the
cache in the RISC-V architecture to give you hands-on experience with the cache system
and its role in improving system performance.
2 Overview
This 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. Moreover,
you need to use the single-level cache simulator you implemented to compare the cache
performance under different cache parameters.
2. 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 need
to examine further how a multi-level cache can improve performance compared to a
single-level cache.
3. Implementation of Pre-fetching: In this section, you are required to implement
a critical technique known as pre-fetching. Moreover, you need to compare the cache
performance with and without pre-fetching.
3 Single-Level Cache Simulation
• Implementation Requirements: You are required to implement a Cache class for
simulating a single-level cache (The code from [1] is a reference code for your). The
ffle structure and description you may use are shown in Table 1.
The simulated cache should be able to perform some parameter tuning, such as cache
size, block size, and associativity level. Besides that, you are required to simulate
1ffle name Discription
include/Cache.h Statement of the Cache class.
src/Cache.cpp Implementation of Cache class.
src/MainSinCache.cpp Main entrance of the single-level cache simulator.
src/MainMulCache.cpp Main entrance of the multi-level cache simulator.
Table 1: File structure and description of single-level and multi-level cache simulation.
Parameter Values
Cache Size 4KB to 1MB, incremented by 4X.
Block Size 32Bytes to 256Bytes incremented by 2X.
Associativity 2 to 32 incremented by 2X
Write Back True or False.
Write Allocate True of False.
Table 2: Parameters used in single-level cache simulation.
Write Back and Write Allocate policies using the LRU replacement algorithm in your
simulation. The parameters that are tunable and their ranges are listed in Table 2.
Finally, some performance data (e.g. miss rate of the cache and total access latency)
needs to be saved in a CSV ffle.
• Performance Evaluation: After the implementation, you are required to evaluate
the 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 is
not limited to
– Analyzing the trend of Miss Rate with Block Size under different cache sizes
– Analyzing the change of Associativity with Miss Rate under different cache sizes
– Analyzing the amount of cache misses per thousand instructions under different
cache sizes
You are also free to design scenarios for performance evaluation as you wish. But
please analyze the performance in at least two different scenarios. You should provide
graphical 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 cache
in 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 Table
4, 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 your
report.
Level Capacity Associativity Block Size Write Policy Hit Latency
L1 16 KB 1 way 64 Bytes Write Back 1 CPU Cycle
Table 3: Cache parameters for single-level cache.
Level Capacity Associativity Block Size Write Policy Hit Latency
L1 16 KB 1 way 64 Bytes Write Back 1 CPU Cycle
L2 128 KB 8 ways 64 Bytes Write Back 8 CPU Cycle
L3 2 MB 16 ways 64 Bytes Write Back 20 CPU Cycle
Table 4: Cache parameters for multi-level cache.
5 Pre-Fetching Implementation
• Implementation Requirements: Based on the multi-level cache simulation, you are
required to further add the pre-fetching technique. Specifically, the mechanism is to
prefetch data in advance based on a detected memory access pattern. In this project,
you will implement a pre-fetching algorithm capable of detecting fixed-stride memory
access patterns; the pseudo-code of the algorithm is summarized in Algorithm 1.
Algorithm 1 Stride-Based Pre-fetching Algorithm
1: initialize: stride = 0, is prefetch = false.
2: for Each Memory Access do
3: Calculate the memory access stride (the distance between the current memory access
address and the address of the previous memory access with the same operation).
4: if is prefetch = false and there are more than three times with the same stride then
5: is prefetch = true
6: prefetch address = current address + stride
7: Prefetching(prefetch address)
8: end if
9: if is prefetch = true and more than three times the different strides are detected
then
10: is prefetch = false.
11: Stop prefecting.
12: end if
13: end for
• 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 is the
same as that in the previous part. Moreover, the test prefetch.trace is the test trace
3specifically designed for prefetching; you can do the performance comparison based on
it. The 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 other
languages, 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
that need to be included are as follows:
– The 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 name
should be your student ID, like 221019040.zip.
7 Grading Details
The 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 your
code 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 simply
submit the code from the reference [1] or only do simple tasks like adding comments, we
consider that you haven’t put much effort and your grade will be directly marked as zero.
References
[1] Hao He, “RISCV-Simulator,” https://github.com/hehao98/RISCV-Simulator, 2019.
4
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!