Clone the repository to your local machine Navigate to the project directory and build the simulation by running the command make
Usage:
./main [inputfile] [page table size] [TLB size] [page replacement algorithm]
where:
- inputfile is the name of the input file containing the virtual memory address traces
- page table size is the number of pages that can be stored in the page table (in pages)
- TLB size is the number of entries in the TLB (in pages)
- page replacement algorithm is the algorithm to use for page replacement. Possible options are FIFO, LRU, OPT.
- The output of the simulation will include statistics on the number of page faults, the TLB hit rate, and the page replacement algorithm used.
NOTE: Find the sample input files in the Input folder
g++ (or any c++ compiler)
The input file should contain a list of virtual memory addresses, one per line. Each address should be a decimal number.
FIFO
: First-In, First-Out algorithm
LRU
: Least Recently Used algorithm
OPT
: Optimal Page Replacement algorithm