|
楼主 |
发表于 2014-7-21 13:08:32
|
显示全部楼层
raise_objection和drop_objection 是放在env 中的。
class my_env extends uvm_env;
`uvm_component_utils(my_env)
virtual dfe_if dfe_bfm;
dfe_agent agent1;
function new(string name,uvm_component parent=null);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db#(virtual dfe_if)::get(this,"","dfe_bfm",dfe_bfm))
`uvm_fatal("env","BFM not set")
uvm_config_db#(virtual dfe_if)::set(this,"agent1","bfm",dfe_bfm)
endfunction
task run_phase(uvm_phase phase);
my_sequence seq;
seuper.run_phase(phase);
seq=my_sequence::tpyeid::create("seq");
seq.addr_low=1;
seq.addr_high='h100;
seq.length=10000;
phase.raise_objection(this);
fork
seq.start(agent1.sequencer);
join
phase.drop_objection(this);
endtask
endclass |
|