token ‘starting_phase‘. Originating package ‘$unit‘.

在学习 《uvm 实战》2.4.3,2.5.1的时候遇到了 starting_phase 再不同 uvm 版本中不一致的问题。

再 uvm 1.2 中弃用了 starting_phaseraise_objectiondrop_obection 并提示:

my_case0.sv, 12
Error found while trying to resolve cross-module reference.
  token 'starting_phase'.  Originating package '$unit'.
  Source info: starting_phase.raise_objection(\this );
  Instance stack trace:
      $unit  /home/xxx/Documents/1800.2-2020-1.1/src/uvm_pkg.sv, 1

Error-[IND] Identifier not declared
my_case0.sv, 11
  Identifier 'starting_phase' has not been declared yet. If this error is not 
  expected, please check if you have set `default_nettype to none.
  Instance stack trace:
      $unit  /home/xxx/Documents/1800.2-2020-1.1/src/uvm_pkg.sv, 1

Error-[XMRE] Cross-module reference resolution error
my_case0.sv, 20
  Error found while trying to resolve cross-module reference.
  token 'starting_phase'.  Originating package '$unit'.
  Source info: starting_phase.drop_objection(\this );
  Instance stack trace:
      $unit  /home/liuyq/Documents/1800.2-2020-1.1/src/uvm_pkg.sv, 1

Error-[IND] Identifier not declared
my_case0.sv, 19
  Identifier 'starting_phase' has not been declared yet. If this error is not 
  expected, please check if you have set `default_nettype to none.
  Instance stack trace:
      $unit  /home/liuyq/Documents/1800.2-2020-1.1/src/uvm_pkg.sv, 1
  


Error-[IND] Identifier not declared
base_test.sv, 28
  Identifier 'get_report_server' has not been declared yet. If this error is 
  not expected, please check if you have set `default_nettype to none.
  

1 warning
5 errors

解决方法是使用 uvm1.1 迁移 uvm1.2 工具 uvm11-to-uvm12.pl

perl uvm11-to-uvm12.pl -write

或者直接修改 my_sequence.sv

修改前

    virtual task body();
       if (starting_phase != null) begin
           starting_phase.raise_objection(this);
       end
       
       repeat (10) begin
         `uvm_do(m_trans)
       end
       
       #1000;
       
       if (starting_phase != null) begin
           starting_phase.drop_objection(this);
       end
    endtask

修改后

   virtual task body(); 
        uvm_phase p = get_starting_phase();
        
        if (p != null) begin
            p.raise_objection(this);
        end
        
        repeat(10) begin
            `uvm_do(m_trans);
        end
        
        #1000;
        
        if (p != null) begin
            p.drop_objection(this);
        end
    endtask
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PYGC

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值