Simulator
Explore how to use a paging simulator to understand virtual to physical address translation. Learn to analyze page tables, identify valid and invalid pages, and compute physical addresses from virtual ones using different memory parameters.
We'll cover the following...
We'll cover the following...
To run
the program, remember to either type just the name of the program
(./paging-linear-translate.py) or possibly this (python paging-linear-translate.py). When you run it with the -h (help) flag, you
see:
Usage: paging-linear-translate.py [options]
Options:
-h, --help show this help message and exit
-s SEED, --seed=SEED the random seed
-a ASIZE, --asize=ASIZE
address space size (e.g., 16, 64k, ...)
-p PSIZE, --physmem=PSIZE
physical memory size (e.g., 16, 64k, ...)
-P PAGESIZE, --pagesize=PAGESIZE
page size (e.g., 4k, 8k, ...)
-n NUM, --addresses=NUM number of virtual addresses to generate
-u USED, --used=USED percent of address space that is used
-v verbose mode
-c compute answers for me
First, run the program without any arguments in the terminal below:
./paging-linear-translate.py
Here is what you will see:
ARG seed 0
ARG address space size 16k
ARG phys mem size 64k
ARG page size 4k
ARG verbose False
The format of the ...