工厂的意义:为了更方便的替换验证环境中的实例或已注册的类型,使注册机制更加灵活。
UVM验证环境的两大类:uvm_component,uvm_object。
从关系上来看,uvm_component 继承于 uvm_report_objec t继承于 uvm_object。uvm_component实现了验证环境的层次化,uvm_object实现了环境的配置和数据的传输。
uvm_component是静态的组件类,对应sv中的generator,stimulator,monitor,agent,checker,refmod,env,test等
uvm_object是动态的验证场景,对应sv中的transaction,从generator流向stimulator的数据包。
---------------------------------------------------------------------------------------------------------------------------------
工厂类的三个步骤:定义、注册、创建
class comp1 extends uvm_component; //定义comp类
'uvm_component_utils(comp1) //注册
function new(string name = "comp1", uvm_component parent = null); //创建
super.new(name, parent);
$display($sformatf("%s is cr