在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 7237|回复: 10

[求助] 求助:p_sequencer的使用

[复制链接]
发表于 2012-9-13 14:46:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 oscillator_cn1 于 2012-9-13 14:48 编辑

各位:
     继续跟UVM死磕。
     今天使用UVM的virtual sequencer的时候遇到一个问题。本来我认为要使用virtual sequencer只需要在相应的sequence中用`uvm_declare_p_sequencer()申明一下就可以了,然后就可以使用p_sequencer来指向这个virtual sequencer。但是我这次却遇到p_sequencer为null的情况。不知道是为什么呢?代码如下:



  1. vsequence extends uvm_sequence;
  2.     `uvm_object_utils(vsequence)
  3.     `uvm_declare_p_sequencer(vsequencer)
  4.     base_reg_seq   reg_seq;
  5.     function new (string name="vsequence");
  6.         super.new(name);
  7.     endfunction : new
  8.     virtual task body();
  9.         reg_seq=base_reg_seq::type_id::create("reg_seq");
  10.         if(p_sequencer==null)
  11.             `uvm_error("p_sequencer get error","In vsequence ,could not get p_sequencer,and p_sequencer is null")
  12.     endtask :body


复制代码
结果当然是11行的`uvm_error中的信息被打印出来了,说明p_sequencer是null,我该怎么做才能正确使用p_sequencer呢?
发表于 2012-9-13 15:41:07 | 显示全部楼层
有可能是你的vseqencer没有使用宏进行注册。
发表于 2012-9-13 15:43:10 | 显示全部楼层
还有就是你的vsequencer在环境中new过或者create过了么?
 楼主| 发表于 2012-9-14 08:48:33 | 显示全部楼层
回复 2# asic_wang
你是指 `uvm_component_utils(vsequencer)么?这个是有的。
 楼主| 发表于 2012-9-14 08:53:13 | 显示全部楼层
回复 3# asic_wang


    这个也确认有。
在test中:
vsequencer vsqr;
virtual function void build_phase(...);
   vsqr=vsequencer::type_id::create("vsqr",this);
   .....
.....
发表于 2012-9-14 13:12:23 | 显示全部楼层
make sure there are always "super.build_phase(phase)" at the beginning of  each build_phase() function in your env.
 楼主| 发表于 2012-9-14 16:20:06 | 显示全部楼层
回复 6# asic_wang

这个有很大的问题么?
发表于 2012-9-14 19:46:04 | 显示全部楼层
yes,a big deal
 楼主| 发表于 2012-9-15 13:48:00 | 显示全部楼层
回复 8# asic_wang

如果是忘了写这一句呢?会产生什么后果呢?
发表于 2012-9-15 23:30:05 | 显示全部楼层
Any override should call super.build_phase(phase) to execute the automatic configuration of fields registed in the component by calling apply_config_settings. To turn off automatic configuration for a component, do not call super.build_phase(phase).
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-22 07:26 , Processed in 0.023334 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表