日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > > 芯片驗證工程師
[導讀]UVM?factory允許一個類在構造時被派生類替換。這對于更改testbench的行為很有用,它將一個類替換為另一個類,而無需編輯或重新編譯testbench代碼。為了使factoryoverride發(fā)揮作用,需要遵循許多編碼約定的先決條件。主要存在component(實例替換...

UVM?factory 允許一個類在構造時被派生類替換。這對于更改testbench的行為很有用,它將一個類替換為另一個類,而無需編輯或重新編譯testbench 代碼。


為了使factory override發(fā)揮作用,需要遵循許多編碼約定的先決條件。主要存在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);參數(shù)化的組件類也可以override,但必須注意確保覆蓋類具有相同的參數(shù)值,否則它們不被認為是相關類型:

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組件層次結構中的路徑來被覆蓋。同樣,這種方法可以用于參數(shù)化的類,只要注意匹配覆蓋中涉及的兩個類的參數(shù):

// 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不同,其不具有組件層次結構路徑。對象覆蓋的代碼與組件覆蓋的形式相同。?

本站聲明: 本文章由作者或相關機構授權發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關閉