|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 oscillator_cn1 于 2012-8-30 16:24 编辑
各位:
最近在跟UVM的register model死磕,还请各位帮帮忙。
我想把register sequence放到virtual sequence中,再把这个virtual sequence设置为virtual sequencer的default_sequence,这样就可以将register_sequence跟其他sequence结合起来使用了。我具体操作如下:
1.virtual sequencer:
- class vsequencer extends uvm_sequencer;
- `uvm_component_utils(vsequencer)
- apb_master_sequencer apb_seq;
- my_reg_block regmodel;
- function new(string name,uvm_component parent);
- super.new(name,parent);
- endfunction
- endclass:vsequencer
复制代码 2.virtual sequence:
- class vsequence extends uvm_sequence;
- `uvm_object_utils(vsequence)
- `uvm_declare_p_sequencer(vsequence)
- my_reg_seq reg_seq;
- function new(string name="vsequence");
- super.new(name);
- endfunction : new
- virtual task body();
- reg_seq=my_reg_seq::type_id::create("reg_seq");
- reg_seq.regmodel=p_sequencer.regmodel;
- reg_seq.start(null);
- endtask : body
- endclass : vsequence
复制代码 3.test:
- class my_reg_test extends uvm_test;
- `uvm_component_utils(my_reg_test)
- reg_tb reg_tb0;
- function new(string name,uvm_component parent);
- super.new(name,parent);
- endfunction : new
- virtual function build_phase(uvm_phase phase);
- super.build_phase(phase);
- reg_tb0=reg_tb::type_id::create("reg_tb0",this);
- vsqr=vsequencer::type_id::create("vsqr",this):
- uvm_config_db#(uvm_object_wrapper)::set(this,"vsqr.run_phase","default_sequence",vsequence::type_id::get());
- endfunction : build_phase
- virtual function connect_phase(uvm_phase phase);
- vsqr.regmodel=reg_tb0.regmodel;
- endfunction : connect_phase
- endclass : my_reg_test
复制代码 但是,这样写出的代码,用irun跑的时候,出现错误,如下:
reg_seq.regmodel=p_sequencer.regmodel;
|
nc_vlog:*E,NOTCLM(./my_reg/reg_seq_lib.sv,49|44):regmodel is not a class item.
因此,我觉得,可能是我不该这样传递regmode,但是我又不知道该怎么修改,请问,有知道的么? |
|