看uvm实战有一个raise_objection的问题
时间:12-12
整理:3721RD
点击:
第六章有两个例子 ,为啥一个有raise_objection 另一个没有呢
class sequence0 extends uvm_sequence #(my_transaction);
my_transaction m_trans;
function new(string name= "sequence0");
super.new(name);
endfunction
virtual task body();
if(starting_phase != null)
starting_phase.raise_objection(this);
repeat (5) begin
`uvm_do(m_trans)
`uvm_info("sequence0", "send one transaction", UVM_MEDIUM)
end
#100;
if(starting_phase != null)
starting_phase.drop_objection(this);
endtask
`uvm_object_utils(sequence0)
endclass
class drv_seq extends uvm_sequence #(my_transaction);
my_transaction m_trans;
`uvm_object_utils(drv_seq)
function new(string name= "drv_seq");
super.new(name);
endfunction
virtual task body();
repeat (10) begin
`uvm_do(m_trans)
`uvm_info("drv_seq", "send one transaction", UVM_MEDIUM)
end
endtask
endclass
class sequence0 extends uvm_sequence #(my_transaction);
my_transaction m_trans;
function new(string name= "sequence0");
super.new(name);
endfunction
virtual task body();
if(starting_phase != null)
starting_phase.raise_objection(this);
repeat (5) begin
`uvm_do(m_trans)
`uvm_info("sequence0", "send one transaction", UVM_MEDIUM)
end
#100;
if(starting_phase != null)
starting_phase.drop_objection(this);
endtask
`uvm_object_utils(sequence0)
endclass
class drv_seq extends uvm_sequence #(my_transaction);
my_transaction m_trans;
`uvm_object_utils(drv_seq)
function new(string name= "drv_seq");
super.new(name);
endfunction
virtual task body();
repeat (10) begin
`uvm_do(m_trans)
`uvm_info("drv_seq", "send one transaction", UVM_MEDIUM)
end
endtask
endclass
没有就错了呗。
哥们看你最近挖得坑挺多的,还是弄本uvm class reference看看吧
raise_objection/drop_objection的本质作用是用来同步phase,至于有地方用有地方不用那你要看具体需求啊
比如seq_a body里面调用了seq_b,seq_a的body如下
virtual task body ()
starting_phase.raise_objection(this);
seq_b.start();
starting_phase.drop_objection(this)
endtask
这个phase同步已经通过seq_a完成了,那seq_b里面用不用raise/drop objection就无关紧要了啊,你一定要用也没啥错