Download PowerPC MMU Simulation

Transcript
5 Evaluation of our solution
This chapter presents an evaluation of our simulator based on the requirements in Chapter
3. The most important aspects with this extended simulator are functional correctness and
efficiency. What can be better than a correct and fast simulator? Therefore continuous testing
has been performed throughout the entire phase of development. This testing has assured us
that the simulator executes correctly. The efficiency of the simulator is a very interesting
attribute, which plays a big part in this chapter.
5.1
Test method
To test the correctness and efficiency of our implementation, a test environment had to be
initiated. The TLB, which is usually initiated by the operating system, now had to be initiated
by us. To do this we created our own small operating system. First a number of test programs
were created. Since Seffel used Tower of Hanoi as his test and benchmark program, we
considered it suitable to be used as our benchmark program as well.
TLB initialising and interrupts handling programs were written in C. Adding blocks of
assembler in the code and using register-mapped variables, gave us complete control of what
happened during execution and which instructions were used. The TLB is initialised with the
MMU related instructions, added to the instruction-set in this extended simulator, see
Appendix D. The TLB set up program is loaded to the address that is the start address for the
execution, normally zero. Next step is to load the program for interrupt handling. We've
implemented one interrupt routine, which handles the TLB instruction-miss interrupt. There
are three more interrupts currently supported in the simulator: data storage interrupt,
instruction storage interrupt and TLB data-miss interrupt. These interrupts have been tested
thoroughly as well. Finally the main program, for example, Tower of Hanoi is loaded into the
simulators memory, at an address that fits the mapping to be set up in the TLB, by the TLB
initialising program during execution.
We decided to initiate the TLB so that all programs should run with start address zero, but
the actual program is loaded at a totally different address. The TLB initialising program
initialises the TLB with information that tells the MMU to translate the addresses as described
above.
When the TLB has been initiated and the MMU functionality is turned on, the parameters
that control the execution flow are changed (a change in the processor state). This introduces
35