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:40
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
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
Computers and Technology, 27.02.2020 19:29
question
Mathematics, 27.02.2020 19:29
question
Mathematics, 27.02.2020 19:29
question
Mathematics, 27.02.2020 19:29
Questions on the website: 13722362