- Read only – like an instruction cache. (It’s bad to allow users to write to the instructions)
- This cache has 8 sets with 1 line each, and 32 bytes of data per line.
- Please find the struct defining this cache at the top of cache.c
- Watch the lecture videos about cache memories.
- Read Section 6.1-6.4 of the CSAPP book.
- Complete the function in cache.c that reads a single character from the cache. If the data in the cache is not valid then the cache goes to the next level down and reads the data into the cache (a function to put the data on the system bus is provided).
- Write additional tests in main. Only one very simple test is provided to demonstrate how to use the cache.
- You may find it useful to write a function to print the entire contents of the cache for debugging.
- A struct describing the cache is included for you at the top of the file. Do not modify these structs.
- Global counters track cache hits and misses. Increment these in your code to collect performance data.
- We will be testing your function with a separte main function and text file. We will be testing with the struct and the Read_Data_From_Ram function provided.
- Caches are built into hardware and not changed after manufactured. You may hardcode any data pertaining cache sizes.
bit shift, bitwise ‘and’, integer division and modulus operators can be really useful for extracting the tag, set, and byte data.
- cache_template.c (https://canvas.wisc.edu/courses/280031/files/26017993/download?download_frd=1) – rename this to cache.c
- alice_in_wonderland.txt (https://canvas.wisc.edu/courses/280031/files/26017995/download?download_frd=1)
- Upload you cache.c file to Canvas
- You may submit as many times as you wish
- Make sure you do your own work – we use Moss to identify academic misconduct
C|C++|Java|Python|Matlab|Android|Jsp|Prolog|MIPS|Haskell|R|Linux|C#|PHP|SQL| .Net|Hadoop|Processing|JS|Ruby|Scala|Rust|Data Mining|数据库|Oracle|Mysql| Sqlite|IOS|Data Mining|网络编程|多线程编程|Linux编程|操作系统| 计算机网络|留学生|编程|程序|代写|加急|个人代写|作业代写|Assignment