This project was produced with the intention to read in a memory trace and simulate the actions of a virtual memory system with a single level page table. The three page replacement algorithms implemented for this simulator are:
- FIFO (First In, First Out)
- LRU (Least Recently Used)
- Segmented FIFO
- Use the command "make", and it will compile a memsim executable
- Alternatively, you can compile using "g++ -o memsim memsim.cpp" to compile
- FIFO and LRU format: ./memsim tracefile nFrames policy quiet/debug
- VMS format: ./memsim tracefile nFrames policy percentage quiet/debug
- policy: fifo, lru or vms
- percentage: 1-100
- tracefile: name of the tracefile
- nFrames: number of frames to use
- quiet/debug: quiet will just print the stats while debug will print every event that happens
./memsim bzip.trace 32 fifo quiet
total memory frames: 32
events in trace: 1000000
total disk reads: 2497
total disk writes: 851
total faults: 2497
./memsim bzip.trace 16 lru quiet
total memory frames: 16
events in trace: 1000000
total disk reads: 3344
total disk writes: 1069
total faults: 3344
total hits: 996656
./memsim bzip.trace 64 vms 50 quiet
total memory frames: 64
events in trace: 1000000
total disk reads: 1290
total disk writes: 427
total faults: 1290
total hits: 998710