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, 24.06.2019 11:00
The program below has been generalized to read a user's input value for hourlywage. run the program. notice the user's input value of 10 is used. modify that input value, and run again. generalize the program to get user input values for workhoursperweek and workweeksperyear (change those variables' initializations to 0). run the program. monthsperyear will never change, so define that variable as final. use the standard for naming final variables. ex: final int max_length
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
question
Computers and Technology, 24.06.2019 17:30
What is the next step if your volume does not work on computer
Answers: 2
question
Computers and Technology, 25.06.2019 04:20
Austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names. an unknown individual took control of austin's servers and transferred the domain names to another registrant without austin's permission. the new registrant began using the domain names to host malicious content—including hate letters to customers and fraudulent contact information—and to post customers' credit-card numbers and other private information, thereby tarnishing austin's goodwill. austin filed a suit in a federal district court against the new registrant under the anticybersquatting consumer protection act. is austin entitled to a transfer of the domain names? austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names
Answers: 3
You know the right answer?
In this project, you need to implement a simple cache simulator that takes as an input the configura...
Questions
Questions on the website: 13722367