首页|基于GRU_LSTM及RL算法的伪随机指令生成器

基于GRU_LSTM及RL算法的伪随机指令生成器

扫码查看
在CPU验证过程中,传统伪随机指令生成器通过生成大量合法无序的指令序列,从而实现功能覆盖率或代码覆盖率的验证目标.然而,没有趋向针对性的指令生成,为达到指标需要耗费大量的人力及时间成本.该文以一款基于精简指令集(RISC-V)自研核心为例,在基于通用验证方法学(Universal Verification Methodology,UVM)的验证平台上设计出一种伪随机指令生成器,并针对普通伪随机指令生成器覆盖率低、收敛速度慢的问题,建立GRU_LSTM算法模型,并结合强化学习(Reinforcement Learning,RL)算法构建新算法模型RLGRU_LSTM应用于伪随机指令生成过程,并且针对RL方向决策,提出了基于霍夫曼编码的CPU指令包编码方式训练opcode分布,同时融合了CPU指令类型和指令间执行顺序因素,快速捕获人工定向验证预料不到的验证盲点,有效加快了代码覆盖率达到预期的进程.该文着重描述伪随机指令生成器及RLGRU_LSTM算法对模型训练过程的指导.实验结果表明,与直接使用伪随机指令生成技术相比,该方法在约定伪随机指令条目下,相比传统伪随机方法能提高约19%的覆盖率,收敛至目标覆盖率消耗时长减少22%.
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.

gate recurrent unit(GRU)long short-term memory(LSTM)reinforcement learningpesudo random instruction generationuniversal verification methodology(UVM)

欧阳有恒、严大卫

展开 >

南京信息工程大学,江苏 南京 210044

无锡先进技术研究院,江苏 无锡 214125

门控循环单元 长短记忆 强化学习 伪随机指令生成 通用验证方法学

国家自然科学基金

61732018

2024

计算机技术与发展
陕西省计算机学会

计算机技术与发展

CSTPCD
影响因子:0.621
ISSN:1673-629X
年,卷(期):2024.34(2)
  • 1
  • 10