subject

In this project, you need to implement a simple cache simulator that takes as an input the configurations of the cache to simulate, such as: size, associativity and replacement policy. when you run you simulator, you need to additionally provide the path of the trace file that includes the memory accesses. your simulator will parse the trace file, which looks like:

r 0x2356257

w 0x25

each line consists of two parts, the operation type (read or write) and byte address in hexadecimal. after reading each line, the simulator will simulate the impact of that access on the cache state, e. g., the lru state of the accessed set and the current valid blocks in the set. your simulator needs to maintain information such as hits, misses and otheruseful statistics throughout the whole run. in this project, you need to implement two different cache replacement policies: lru and fifo. in lru, the least-recently-used element gets evicted, whereas in fifo, the element that was inserted the earliest gets evicted. implementation hint: allocate your cache as a 2d array, where each row is a set. on each item of the array keep track of information like the tag of the data in this block. you can create multiple instances of such a 2d array for different purposes; for example, you can create another 2d array to track the lru position of the corresponding block in the lru stack of the set. assume 64b block size for all configurationsinputs to simulatorthe name of your executable should be sim, and your simulator should take inputs as following:

./sim is the size of the simulated cache in bytes is the associativity replacement policy: 0 means lru, 1 means fifo trace file name with full pathexample: ./sim32768 8 1 /home/traces/mcf. t

this will simulate a 32kb cache with 8-way associativity and fifo replacement policy. the memory trace will be read from /home/traces/mcf. t

note: the trace file will contain addresses that can be for 64-bit system, so you might need data types that are large enough to read them correctly and bookkeep the metadata in your simulator. for example, if the tag is 9 bytes and you allocate your tag array bookkeeping array as an array of integers, you will not be able to store the whole 9 bytes; integer is only 4 bytes. accordingly, use data types such as long long intand its equivalents in other languages. outputfrom simulator: the following outputs are expected from your simulator: a. the read miss ratio for l1 cacheb. the write miss ratio for l1 cachec. the total miss ratio for l1 cache

in c language

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 23.06.2019 03:50
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria.what am i?
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
You know the right answer?
In this project, you need to implement a simple cache simulator that takes as an input the configura...
Questions
question
Mathematics, 05.05.2020 02:20
question
Mathematics, 05.05.2020 02:20
question
Mathematics, 05.05.2020 02:20
question
Mathematics, 05.05.2020 02:20
question
Mathematics, 05.05.2020 02:20
question
Biology, 05.05.2020 02:20
question
History, 05.05.2020 02:20
Questions on the website: 13722363