UVM中各个类的参数要求
1.uvm_object和uvm_compoent类
1.1 派生自uvm_object的类
除了派生自uvm_component类之外的类,几乎所有的类都派生自uvm_object。
uvm_transaction、uvm_sequence_item、uvm_sequence
1.2 派生自uvm_component的类
uvm_sequencer、uvm_driver、uvm_monitor、uvm_agent、uvm_scoreboard、uvm_env、uvm_test、uvm_root
reference_model可以直接派生自uvm_component。
但是uvm_sequencer类不是uvm树的结点。
uvm_component有两个特性是uvm_object特性所没有的,一是通过在new的时候指定parent参数来形成一种树形的组织关系,二是有phase的自动执行的特点。
所有的UVM树的结点都是由uvm_component组成的,只有基于uvm_component派生的类才可能称为uvm树的结点。
- 具有参数的类
class case0_sequence extends uvm_sequence #(my_transaction);
class my_driver extends uvm_driver#(my_transaction);
class my_sequencer extends uvm_sequencer #(my_transaction);
- 派生在uvm_component的create
sqr = my_sequencer::type_id::create("sqr", this);
drv = my_driver::type_id::create("drv", this);
mon = my_monitor::type_id::create("mon", this);
i_agt = my_agent::type_id::create("i_agt", this);
o_agt = my_agent::type_id::create("o_agt", this);
mdl = my_model::type_id::create("mdl", this);
scb = my_scoreboard::type_id::create("scb", this);
env = my_env::type_id::create("env", this);
4.各种组件new的不同
class my_transaction extends uvm_sequence_item;
function new(string name = "my_transaction");
super.new();
endfunction
endclass
class case0_sequence extends uvm_sequence #(my_transaction);
function new(string name= "case0_sequence");
super.new(name);
endfunction
endclass
其他
class chnl_driver extends uvm_driver #(chnl_trans);
function new (string name = "chnl_driver", uvm_component parent);
super.new(name, parent);
endfunction
endclass