当前位置:首页 > 公众号精选 > 芯片验证工程师
[导读]UVM factory允许一个类在构造时被派生类替换。这对于更改testbench的行为很有用,它将一个类替换为另一个类,而无需编辑或重新编译testbench代码。为了使factoryoverride发挥作用,需要遵循许多编码约定的先决条件。主要存在component(实例替换...

UVM factory 允许一个类在构造时被派生类替换。这对于更改testbench的行为很有用,它将一个类替换为另一个类,而无需编辑或重新编译testbench 代码。


为了使factory override发挥作用,需要遵循许多编码约定的先决条件。主要存在component (实例替换、类替换)和object(实例替换、类替换)

 

Component Type Overrides

类型覆盖适用于该组件类型的所有实例:

class colour extends uvm_component;`uvm_component_utils(colour)// etcendclass: colour // Red child classclass red extends colour;`uvm_component_utils(red)//etcendclass: red // ::type_id::set_type_override(::get_type(), replace);// Where replace is a bit which when ==1 enables the override of an existing override, otherwise// the existing override is honoured.// To override all instances of colour with red:colour::type_id::set_type_override(red::get_type(), 1);// This means that the following creation line returns a red, rather than a colourpixel = colour::type_id::create("pixel", this);参数化的组件类也可以override,但必须注意确保覆盖类具有相同的参数值,否则它们不被认为是相关类型:

class bus_driver #(int BUS_WIDTH = 32) extends uvm_component;`uvm_component_param_utils(bus_driver #(BUS_WIDTH))// etcendclass: bus_driver class bus_conductor #(int BUS_WIDTH = 32) extends bus_driver #(BUS_WIDTH);`uvm_component_param_utils(bus_conductor #(BUS_WIDTH))// etcendclass: bus_conductor // The parameterised type override needs to keep the parameterisation consistentbus_driver #(64)::type_id::set_type_override(bus_conductor #(64)::get_type(), 1); // This will succeed // Creation of a #(64) bus_driver results in a #(64) bus_conductor handle being returned:bus_person = bus_driver#(64)::type_id::create("bus_person", this);// Whereas creating a #(16) bus_driver results in a #(16) bus_driver handle being returned because// the matching type override is not found:bus_person = bus_driver#(16)::type_id::create("bus_person", this);// Similarly if a type override has non-matching parameters, then it will fail and return the original typebus_driver #(64)::type_id::set_type_override(bus_conductor #(32)::get_type(), 1); // Returns bus_driver #(64)Component Instance Overrides

一个特定的组件实例可以通过指定其在uvm组件层次结构中的路径来被覆盖。同样,这种方法可以用于参数化的类,只要注意匹配覆盖中涉及的两个类的参数:

// Using red --> colour example from type override example// ::type_id::set_inst_override(::get_type(), );colour::type_id::set_inst_override(red::get_type(), "top.env.raster.spot");// And again for a parameterised type, the parameter values must matchbus_driver #(64)::type_id::set_inst_override(bus_conductor #(64)::get_type(), "top.env.bus_agent.m_driver");Objects sequence 相关的对象通常只与类型覆盖一起使用,因为uvm_object与uvm_component不同,其不具有组件层次结构路径对象覆盖的代码与组件覆盖的形式相同。 

本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除。
换一批
延伸阅读

(全球TMT2022年2月23日讯)Nova宣布在中国建立新的本地公司实体,并在上海开设新的中国总部。近年来,Nova在中国的业务显著增长,服务于该地区半导体行业的扩张。新设施是Nova强化全球网点战略的组成部分,该战...

关键字: ov

呼吁年轻人才加入他们的虚拟合唱团 美国旧金山2022年2月16日 /美通社/ -- 才...

关键字: ov

北京2022年1月25日 /美通社/ -- 全球领先的图像级激光雷达提供商Innovusion与自动驾驶头部公司蘑菇车联宣布,双方正式达成战略合作。未来三年里,双方将基于各自前瞻性的技术优势与深厚的资源布局,围绕自动驾驶...

关键字: 进程 自动驾驶 ov

(全球TMT2022年1月26日讯)图像级激光雷达提供商Innovusion与自动驾驶头部公司蘑菇车联宣布,双方正式达成战略合作。未来三年里,双方将基于各自前瞻性的技术优势与深厚的资源布局,围绕自动驾驶、车联网及其他业...

关键字: 激光雷达 自动驾驶 ov

苏州2022年1月4日 /美通社/ -- 全球领先的图像级激光雷达提供商Innovusion在2022年国际消费电子展上,将展出其即将量产并搭载于蔚来首款旗舰轿车ET7上问世的图像级超远距激光雷达猎鹰(Falcon)。与...

关键字: 激光雷达 ov

(全球TMT2022年1月5日讯)图像级激光雷达提供商Innovusion在2022年国际消费电子展上,将展出其即将量产并搭载于蔚来首款旗舰轿车ET7上问世的图像级超远距激光雷达猎鹰(Falcon)。与此同时,Inno...

关键字: 激光雷达 ov

香港2021年12月14日 /美通社/ -- 亚洲一般保险领导者中银集团保险有限公司、国际保险精算咨询公司Milliman携手企业级保险技术平台CoverGo,共同简化中银集团保险的车险生态系统和客户体验。 中银集团保...

关键字: ov

(全球TMT2021年11月4日讯)11月3日上午,激光雷达提供商图达通智能科技(苏州)有限公司 (Innovusion) 举办了一场热烈且激动人心的开业庆典。庆典仪式在Innovusion位于苏州高铁新城长三角国际研...

关键字: ov

来源:blog.csdn.net/lizeyang/article/details/40040817为了避免空指针调用,我们经常会看到这样的语句。...if (someobject != null) {    someo...

关键字: ov

香港2021年10月18日 /美通社/ -- 亚洲无代码保险技术领域的领导者CoverGo正在将业务拓展到美国、加拿大和拉美地区,以帮助当地的保险公司通过数字化转型,在这一高科技时代保持敏捷性和相关性。 CoverGo...

关键字: 代码 数字化 ov
关闭
关闭