【UVM避坑】记录UVM/SV使用过程中遇到的问题

问题索引

  • ◼ uvm_hdl_force失败,force失败
  • ◼ 成功解决 uvm_hdl_force问题:You may not have sufficient PLI/ACC capabilites enabled for that path
  • ◼ $random_range(min, max) 随机失败,未按要求随机
  • ◼ "import" is not expected to be used in this context
  • ◼ define 编译报错
  • ◼ uvm/sv function、task使用ref、input、output、inout进行参数传递
  • ◼ 跑仿真编译器被kill

◼ uvm_hdl_force失败,force失败


  这里就不提找不到hierarchy引起的force失败了,只介绍一种 我以为force成功了,其实未按我的预期进行force的情况。

  模块u0中的wire a接入模块u1.rx及u2.rx,此时我想对u1、u2的rx force不同的值,采用如下force操作是错误的。由于两个wire信号源头相同,编译器解析时存在概率将其认定为同一条wire,第二行force的有可能会覆盖掉第一行的force操作


force u1.rx = 1; // uvm_hdl_force亦然
force u2.rx = 0; // uvm_hdl_force亦然

  稳妥的做法是找到该信号在u1、u2内过一级触发器之后的信号进行force。


【UVM避坑】记录UVM/SV使用过程中遇到的问题_第1张图片


◼ 成功解决 uvm_hdl_force问题:You may not have sufficient PLI/ACC capabilites enabled for that path

  1. 先看下debug_access选项参数,是不是要force的路径无法access,实在不行+debug_access+all
  2. +debug_access+all还不行的话,看下vcs是不是加了+applylearn选项,加了该选项的话,编译的时候会忽略+debug*,删掉+applylearn


◼ $random_range(min, max) 随机失败,未按要求随机

遇到问题:使用 $urandom_range系统函数进行随机的时候,发现产生的数值与预期不符。
解决办法:原因是urandom_range随机范围上限是32 bit,上限数值max位宽很大的话只取低32 bit



◼ “import” is not expected to be used in this context

遇到问题:编译错误,提示语法错误,具体错误信息 “import” is not expected to be used in this context
问题解决:看下parsing log里,报错点是否有ifdef没写endif,当前文件找不到就到上一个parsing的文件去找


◼ define 编译报错

出现问题:sv/uvm define 代码块编译报语法错误,找不到问题
问题解决:检查行尾的换行符“\”之后是否有多余符合,尤其是空格,有多余符号会报错



◼ uvm/sv function、task使用ref、input、output、inout进行参数传递

出现问题:使用ref、input、output、inout进行参数传递时,参数传递的值不符合个人预期
问题解决:以上ref/input/output/inout等的作用域并非其后的一个参数,而是下一次出现ref/input/output/inout之间的所有参数。使用时应慎之又慎,在传参方向变化时及时纠正。


◼ 跑仿真编译器被kill

出现问题: 跑仿真的时候,编译阶段被kill,没有语法报错,主要错误提示信息如下

Internal error in tool's source file "xmr.cc" line 7430.
Please send these messages to [email protected].

An unexpected termination has occurred in /eadtool/synopsys/vcs/P-2019.06-SP2-1S/linux64/bin/vcs1 dut to an assertion failure in the tool.
Hostname xxxx
xxxxxxxxxxxxx
xxxxxxxxxxxxx
--- Stack trace follows:
"/eadtool/synopsys/vcs/P-2019.06-SP2-1S/bin/scs": not in executable format: File format not recognized
#0 0x********
#1 0x********

问题解决:在实例化类的时候,type_id::create(),忘了写create,加上就好了





你可能感兴趣的:(UVM,SV,verilog)