Assignment Overview
This assignment focuses on the interactions between primary storage and the data cache, and is the first milestone in a larger simulation. You will design and implement the C/C++ program which is described below.
It is worth 20 points (2% of course grade) and must be completed no later than 11:59 PM on Thursday, 3/12.
Assignment Deliverables
The deliverables for this assignment are the following files:
proj07.makefile the makefile which produces proj07 proj07.student.c the source code file for your solution
Be sure to use the specified file names and to submit your files for grading via the CSE Handin system before the project deadline.
Assignment Specifications
The program will simulate the steps required to manage primary storage and the data cache. Primary storage consists of 1,048,576 bytes of RAM; physical addresses are 20 bits in length. The data cache is a direct-mapped, write-back cache which contains 8 lines. Each cache line contains 16 bytes of data, as well as the control information (valid bit, modified bit, and tag bits).
- Your program will accept command-line arguments to specify the file which contains the memory references (the -refs option) and to control the display of debugging information (the -debug option).
- The -refs option will be followed by the name of the file which contains zero or more memory references. Each line of the file will contain the following information:
- physical address being referenced (five hexadecimal digits, with leading zeroes)
- operation being performed (one character; R for read and W for write)
- if the operation is a write, the value being written (four bytes, where each byte is given as two hexadecimal digits, with leading zeroes)
Items in the line will be separated by exactly one space, and the line will terminate with a newline. For example:
00bd8 R
20ac4 W 12 34 56 78
20ad0 R
- For each memory reference in the file, your program will display one line with the following information:
- physical address being referenced (five hexadecimal digits, with leading zeroes)
- operation being performed (one character; R for read and W for write)
- tag bits (four hexadecimal digits, with leading zeroes)
- cache line accessed (one hexadecimal digit)
- byte offset (one hexadecimal digit)
Items in the line will be separated by exactly one space, and the line will terminate with a newline. For example:
00bd8 R 0017 5 8
20ac4 W 0415 4 4
20ad0 R 0415 5 0
- After the simulation is completed, your program will display the contents of the data cache. The display will contain one line for each data cache entry:
- index of the data cache entry (one hexadecimal digit)
- V bit (one character; 0 for not valid, 1 for valid)
- M bit (one character; 0 for not modified, 1 for modified)
- tag bits (four hexadecimal digits, with leading zeroes)
- data block (16 bytes of data, where each byte is given as two hexadecimal digits, with leading zeroes)
Items within a line will be separated by exactly one space, and each line will terminate with a newline. The data cache display will begin and end with a blank line (for readability), and will include appropriate column headers.
- If the -debug option has been selected, your program will also display the following:
- the contents of the data cache at the start of the simulation
- the contents of the data cache after each memory reference is processed
- The program will include appropriate error-handling.
Assignment Notes
- As stated above, your source code file will be named proj07.student.c; that source code file may contain C or C++ statements.
- You must use g++ to translate your source code file in the CSE Linux environment.
- Valid executions of the program might appear as follows:
proj07 debug refs test1 proj07 refs test2 -debug proj07 refs test3
- Your program must create a data structure representing the data cache and set all of the entries to zero at the start of the simulation.
For this assignment, processing the memory references will not update the data cache. In subsequent assignments, your program will actively manage the data cache (and thus the display will change over time).
Reviews
There are no reviews yet.