Atomic Instructions Random Tests Generation Using Lock Contention Analysis
Atomic operations functional verification is known operations cannot be tested with the help of stochastic test to be a rather labour-intensive process because atomic generation methods due to their unpredictable nature. Atomic operations are synchronization primitives used as building blocks for mutual exclusions, spinlocks, and thread execution barriers. There are numerous approaches proposing a variety of methods to analyze and reduce lock contention problems in software or in hardware. These approaches quantify the synchronization mechanisms execution overhead or assess the impact these primitives have on the completion time of multithreaded application. However, it is reasonable to create test cases with forced shared data areas between threads intentionally to test the interaction between cores. In the paper, we propose to apply all previous researches to increase the coverage of atomic operations functional verification. According to the mentioned methods, we run PARSEC benchmarks and Linux Kernel Lock Torture Test to estimate and find the most contented segments of code in these applications. The obtained knowledge has been applied for extension of our current test generator Ristretto to create test cases with random load/store and atomic instructions combinations to generate necessary stimulus. The discussed approach was successfully tried out in practice on the verification process of the RTL-model of dual-core microprocessor with SMP developed in SRISA RAS. The advantage of the technique is that there is no need to change verification strategy and process to adjust to a new project design.