|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
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的情况。不知道是为什么呢?代码如下:
- vsequence extends uvm_sequence;
- `uvm_object_utils(vsequence)
- `uvm_declare_p_sequencer(vsequencer)
- base_reg_seq reg_seq;
- function new (string name="vsequence");
- super.new(name);
- endfunction : new
- virtual task body();
- reg_seq=base_reg_seq::type_id::create("reg_seq");
- if(p_sequencer==null)
- `uvm_error("p_sequencer get error","In vsequence ,could not get p_sequencer,and p_sequencer is null")
- endtask :body
复制代码 结果当然是11行的`uvm_error中的信息被打印出来了,说明p_sequencer是null,我该怎么做才能正确使用p_sequencer呢? |
|