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 02:30
Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type)] and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to zero, it should output wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the â€r’ or â€r’ team, their game time will be 10% faster. and if they are on the â€b’ or â€b’ team, their game time will be 15% faster. and if they are on the â€y’ or â€y’ team, their game time will be 20% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 6 but less than or equal to 12 and if they are on the â€r’ or â€r’ team, their game time will be 20% faster. and if they are on the â€b’ or â€b’ team, their game time will be 25% faster. and if they are on the â€y’ or â€y’ team their game time will be 30% faster. and if they are on any other team, they will play 0% faster. if the number of players is greater than 12 but less than or equal to 18 and if they are on the â€r’ or â€r’ team, their game time will be 30% faster. and if they are on the â€b’ or â€b’ team, their game time will be 35% faster. and if they are on the â€y’ or â€y’ team, their game time will
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 24.06.2019 19:30
Can someone who is skilled at coding create me a java chess game. don't copy from online source codes. make it original ! : d
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
In our new car, we were able to drive 30 miles in a half an hour. from this information, we can determine the car's a. acceleration. b. velocity. c. speed. d. direction.
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, 23.07.2019 15:30
Questions on the website: 13722360