Abstract:The open-source architecture RISC-V has defined its memory consistency model RVWMO as an important specification for the software and hardware design and development of multi-core RISC-V systems. During the verification phase of multi-core chips, strict and comprehensive testing of the memory consistency of the chip is indispensable. Testing usually focuses on a specific memory access order and selects typical parallel program segments for large-scale testing(also known as Litmus testing)to deduce the memory consistency model of the chip based on the final state of the program execution. Analysis of Litmus test results is important for verifying the compatibility of the chip""s RVWMO and exploring the possibility of memory consistency optimization in multi-core systems. Based on the program states allowed by the RVWMO specification, more program states are observed in chip testing, which indicates the existence of compatibility, while fewer program states observed may indicate the potential of optimization. In the face of the large-scale and complex behavior of Litmus testing, how to automate the analysis of its test results is an urgent problem to be solved. This study made a deep analysis of the principle and output results of Litmus testing and proposed an automated analysis approach for RISC-V memory consistency testing, which used formal methods to simulate Litmus testing based on the RVWMO specification, and drew conclusions by comparing the results with the measured data of the chip. This approach was tested on the Hifive Unmatched board. The experiment shows that the approach can effectively and quickly perform automated analysis of RISC-V memory consistency testing.