A processor simulator using HySim consists of an Instruction Set Simulator, named as Target Simulator (TS), and an Abstract Simulator (AS). The AS is a virtual machine for the C programming language, which provides fast native execution for time-consuming functions, when the function source code is available. TS and AS are exposed together as a unified processor simulator to the simulation kernel, but internally execution control is transparently switched at runtime.
The hybridization facilitates to exploit the trade-off between simulation speed and accuracy on user demand. Performance profiling/optimization, can be performed on particular parts of the application, whereas other parts can be accelerated while keeping only its functionality. In these terms, the whole application will be functionally verified, while accurate timing information will be gathered only when required.
Quick performance estimation, without TS execution, is also possible by using AS as the execution engine. Currently there are two approaches (performance annotation and dynamic profiling) developed for RISC like processors or DSP/VLIW architectures respectively.
All these features (dynamic execution engine switching, performance annotation and dynamic profiling) are supported by an extensible instrumenter, which transforms the C source code of the application. The transformed code does not behave normally anymore, but it also imitates the behavior that a third-party target compiler would introduce in the target binary. For this reason the transformation is also called virtualization. The transformed code is compiled by the native compiler, and the generated binary can be executed by the AS, which can be customized to perform cache simulation and dynamic profiling. The Hybrid Simulation workflow is presented in the figure shown below.