Performance improvement of simulators
Requirements
One of our Japanese customers required execution speed improvement of their simulators. The simulators were cycle accurate simulators. Though cycle accurate simulators provide accurate simulation, it is slow and this makes development and testing of large applications time consuming. So the customer's idea was that most application develop does not require cycle accurate simulation and so cycle accurate simulators can be converted to functional simulator which execute faster. Functional simulators do not provide cycle accurate simulation but simulates the processor with reasonable accuracy. So the first step was to convert cycle accurate simulators to functional simulators. Next step was to identify better algorithms for simulation and implement it. Identification of improvements was done in parallel by our team and the customer's team and the decided improvements are implemented by us.
Challenges
- Understanding existing simulation algorithms
- Measuring simulator performance
- Profiling the application to identify performance bottlenecks
- Identifying better simulation algorithms
Solution
-
Environment
OS
|
Windows |
| Language/Platform |
C
|
| Development model |
Incremental development model |
| Quality validation tools |
- Numega Dev Partner Studio to check for memory errors, memory leaks and test coverage
- QAC for static analysis of code
|
-
Description
Our first step was to identify how to measure the performance of the simulator given to us; so that we can measure our improvements. So we chose 2 typical applications for the target processor that can be used as input for the simulator to measure the execution speed. One DSP based application and one floating point application were chosen and ported to the target processor.
The simulator supported trace information which had a count of number of instructions executed. So we used performance measure as the number of instructions executed in one millisecond. Though time is not an accurate measure of execution speed in a multitasking OS like Windows, we repeated the tests multiple times and took the average measure of execution speed. This gave repeatable results.
Then we took the task of converting cycle accurate simulators to functional simulators. For this we had to identify which portions of cycle accurate simulations that we need to remove and then remove it. In this process we should make sure that we do not break the existing functionality / introduce defects. The identification of cycle accurate simulation portion to be removed and decided based on our understanding and discussion with the customers. At each stage testing was done to ensure that defects were not introduced.
At the next stage we profiled the application to identify performance bottlenecks. In most applications more than 90% of the time is spent on less that 10% of the code. We identified such portions of the code and started improving those areas. This approach gave us better performance improvement results.
At the end of the project the execution speed improvement to one of the simulator was 14:1.
|