Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, fnaflover8505
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
image
Computers and Technology, 22.06.2019 18:30, lizz1228
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
image
Computers and Technology, 23.06.2019 22:50, atifgujar
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
image
Computers and Technology, 24.06.2019 03:00, greenhappypiggies
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
Do you know the correct answer?
In this project, you need to implement a simple cache simulator that takes as an input the configura...

Questions in other subjects:

Konu
Chemistry, 10.12.2020 20:40
Konu
Biology, 10.12.2020 20:40