Instruction set simulation based on dynamic compilation is a popular approach that focuses on fast simulation of user-visible features according to the instruction-set-architecture abstraction of a given processor. Simulation of interrupts, even though they are rare events, is very expensive for these simulators, because interrupts may occur anytime at any phase of the programs execution. Many optimizations in compiling simulators can not be applied or become less beneficial in the presence of interrupts.We propose a rollback mechanism in order to enable effective optimizations to be combined with cycle accurate handling of interrupts. Our simulator speculatively executes instructions of the emulated processor assuming that no interrupts will occur. At restore-points this assumption is verified and the processor state reverted to an earlier restore-point if an interrupt did actually occur. All architecture dependent simulation functions are derived using an architecture description language that is capable to automatically generate optimized simulators using our new approach.
We are able to eliminate most of the overhead usually induced by interrupts. The simulation speed is improved up to a factor of 2.95 and compilation time is reduced by nearly 30% even for lower compilation thresholds.
"Precise simulation of interrupts using a rollback mechanism"
Florian Brandner
Proceedings of the 12th International Workshop on Software and Compilers for Embedded Systems (SCOPES'09) , Nice, France, April 2009.
@inproceedings{1543833, author = {Brandner, Florian}, title = {Precise simulation of interrupts using a rollback mechanism}, booktitle = {SCOPES '09: Proceedings of the 12th International Workshop on Software and Compilers for Embedded Systems}, year = {2009}, isbn = {978-1-60558-696-0}, pages = {71--80}, location = {Nice, France}}, }