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

當前位置:首頁 > > 芯片驗證工程師
[導讀]在UVMtestbench開始發(fā)送激勵之前,必須構建其組件層次結構以及驗證組件之間的連接關系。UVMtestbench的第一階段(phase)是buildphase,在此階段自上而下地實例化組成驗證環(huán)境層次結構中的各個uvm_component類。當在頂層的initial語句塊中...

在UVM testbench開始發(fā)送激勵之前,必須構建其組件層次結構以及驗證組件之間的連接關系。


UVM testbench 的第一階段(phase)是build phase,在此階段自上而下地實例化組成驗證環(huán)境層次結構中的各個uvm_component類。

當在頂層initial 語句塊中調用run_test()方法時,就開始激活驗證平臺的構建,即從testcase開始依次調用各組件的build_phase。在執(zhí)行test case的build phase期間,需要準備好testbench配置對象,并將virtual interface賦值給testbench中各個組件中的virtual interface句柄。


在下一級的層次結構(uvm_env)中,將根據(jù)從testcase獲取的配置對象進一步地配置(uvm_agent)并可以根據(jù)實際情況進行更改。在build phase完成后,將開始connect phase確保完成所有組件之間的連接(自下而上)。等到所有的uvm_phase運行完成,會將控制權再給到test case。


簡而言之,在發(fā)送測試激勵之前需要完成驗證組件的構建、配置和組件之間的連接。

UVM testbench 的構建過程從test case開始,決定了構建怎樣的驗證平臺:


? 進行factory override,以便將配置對象或組件對象替換為為派生類型

UVM factory 允許一個UVM類在構建時被另一個派生類替換,必須在構建對象之前就指定factory override,因此需要在該組件上層的build phase進行指定。


? 設置一個層次化的env配置對象,其中包含各種子組件所需的配置對象

每個驗證組件如env或agent ,都應該有一個定義其結構和行為的配置對象。這些配置對象應該在build phase方法中創(chuàng)建,并根據(jù)測試用例的要求進行配置。如果驗證子組件的配置比較復雜或者可能需要發(fā)生更改,那么值得添加一個 virtual function調用并在擴展的測試用例中重載

class?spi_test_base?extends?uvm_test;`uvm_component_utils(spi_test_base)spi_env m_env;spi_env_config m_env_cfg;apb_agent_config m_apb_cfg;spi_agent_config m_spi_cfg;
// Standard UVM Methods:extern function new(string name = "spi_test_base", uvm_component parent = null);extern?function?void?build_phase(?uvm_phase?phase?);
extern virtual function void configure_env(spi_env_config cfg);extern virtual function void configure_apb_agent(apb_agent_config cfg);endclass: spi_test_base
function spi_test_base::new(string name = "spi_test_base", uvm_component parent = null);super.new(name, parent);endfunction
// Build the env, create the env configuration// including any sub configurations and assigning virtual interfacesfunction void spi_test_base::build_phase( uvm_phase phase );// Create env configuration objectm_env_cfg = spi_env_config::type_id::create("m_env_cfg");// Call function to configure the envconfigure_env(m_env_cfg);// Create apb agent configuration objectm_apb_cfg = apb_agent_config::type_id::create("m_apb_cfg");// Call function to configure the apb_agentconfigure_apb_agent(m_apb_cfg);// More to followendfunction: build_phase
// Convenience function to configure the env// This can be overloaded by extensions to this base classfunction void spi_test_base::configure_env(spi_env_config cfg);cfg.has_functional_coverage = 1;cfg.has_reg_scoreboard = 0;cfg.has_spi_scoreboard = 1;endfunction: configure_env
// Convenience function to configure the apb agent// This can be overloaded by extensions to this base classfunction void spi_test_base::configure_apb_agent(apb_agent_config cfg);cfg.active = UVM_ACTIVE;cfg.has_functional_coverage = 0;cfg.has_scoreboard = 0;endfunction: configure_apb_agent? 配置驗證環(huán)境中各組件的virtual interface句柄

在調用UVM run_test()方法之前,DUT頂層I/O上的信號應該通過連接到 SystemVerilog interfaces并賦值給virtual interface,然后通過uvm_config_db::set將每個接口的virtual interface賦值給所需的驗證組件,然后各個組件訪問其配置對象內部的virtual interface手柄,以驅動或監(jiān)視DUT信號。

if( !uvm_config_db #( virtual apb3_if )::get(this, "" , "APB_vif",m_apb_cfg.APB) ) `uvm_error(...)

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