Pseudo Random Instruction Generator Based on GRU_LSTM and Reinforcement Learning Algorithms
In the CPU verification process,the traditional pseudo random instruction generator generates a large number of legally unordered instruction sequences to achieve the verification goal of function coverage or code coverage.However,there is no trend towards targeted instruction generation,and it takes a lot of manpower and time to achieve the target.Taking a RISC-V based self-developed core as an example,we design a pesudo random instruction generator on the verification platform based on Universal Verification Methodology(UVM),and establish a GRU_LSTM algorithm model to solve the problems of low coverage and slow convergence of ordinary random instruction.A new algorithm model RLGRU_LSTM combined with Reinforcement Learning(RL)is applied to the pesudo random instruction generation process.Aiming at the RL direction decision,LSTM proposes a CPU instruction package coding method based on Huffman coding proposed to train opcode distribution,which integrates the CPU instruction type and the execution order factors between instructions,quickly captures the unexpected verification blind spots of manual directional verification,and effectively speeds up the process of code coverage reaching the expected rate.We focus on the description of pesudo random instruction generator and RLGRU_LSTM algorithm guides the model training process.The experimental results show that compared with the direct use of pesudo random instruction generation technology,the proposed method can improve the coverage rate by about 19%under the agreed pesudo random instruction entry compared with the traditional pseudo random method,and converge to the target coverage rate about 22%earlier.