|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 oscillator_cn1 于 2013-5-23 09:10 编辑
各位:
最近正在使用UVM搭建仿真平台,遇到一个改变default_sequence的问题。嗯,先上代码:
class wdma_base_test extends uvm_test;
wdma_tb tb0;
vsequencer vsqr;
vi_config vdo_cfg;
`uvm_component_utils(wdma_base_test)
function new(string name="wdma_base_test",uvm_component parent);
super.new(name,parent);
endfunction : new
virtual function void set_default_sequence();
uvm_config_db#(uvm_object_wrapper)::set(this,"vsqr.run_phase","default_sequence",wdma_1080p_ud_seq::type_id::get());
endfunction : set_default_sequence
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
tb0=wdma_tb::type_id::create("tb0",this);
vsqr=vsequencer::type_id::create("vsqr",this);
vdo_cfg=vi_config::type_id::create("vdo_cfg");
uvm_config_db#(vi_config)::set(this,"*","vdo_cfg",vdo_cfg);
uvm_config_object::set(this,"tb0.vdo0*","cfg",vdo_cfg);
set_default_sequence();
endfunction : build_phase
virtual function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
vsqr.vdo_sqr=tb0.vdo0.master.sequencer;
endfunction : connect_phase
virtual task run_phase(uvm_phase phase);
super.run_phase(phase);
tb0.print();
endtask : run_phase
endclass : wdma_base_test
class wdma_1080p_30hz_test extends wdma_base_test;
`uvm_component_utils(wdma_1080p_30hz_test)
function new(string name, uvm_component parent);
super.new(name,parent);
endfunction : new
function void set_default_sequence();
uvm_config_db#(uvm_object_wrapper)::set(this,"vsqr.run_phase","default_sequence",wdma_1080p_30hz_seq::type_id::get());
endfunction : set_default_sequence
function void build_phase(uvm_phase phase);
super.build_phase(phase);
$display("30hz");
endfunction : build_phase
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
endfunction : connect_phase
endclass : wdma_1080p_30hz_test
可是问题是,当我跑wdma_1080p_30hz_test时,启动的还是wdma_1080p_ud_seq,就好像wdma_1080p_30hz_test中改写的set_default_sequence()函数没有起作用一样。各位有什么办法解决呢? |
|