www.久久久久|狼友网站av天堂|精品国产无码a片|一级av色欲av|91在线播放视频|亚洲无码主播在线|国产精品草久在线|明星AV网站在线|污污内射久久一区|婷婷综合视频网站

當(dāng)前位置:首頁 > 公眾號精選 > 芯片驗(yàn)證工程師
[導(dǎo)讀]UVM?agent可以被認(rèn)為是特定interface的驗(yàn)證組件工具包(package),其中包括一個用于連接DUT的SystemVeriloginterface以及一個組成整個agent組件類的SystemVerilog?package。agent類是一個容器類,包含driver...

UVM?agent 可以被認(rèn)為是特定interface的驗(yàn)證組件工具package ,其中包括一個用于連接DUT的SystemVerilog interface以及一個組成整個agent 組件類的SystemVerilog?package


agent 類是一個容器類,包含driver、sequencer 和monitor。agent 類還具有一個analysis port,該端口連接到monitor上的analysis port。

我們使用一個APB總線agent 展示它是如何封裝、配置、構(gòu)建和連接的。APB?agent 使用一個名為apb_if的接口apb_if.sv。agent 的各種類模板文件一起收集在一個SystemVerilog packageapb_agent_pkg.sv

package apb_agent_pkg;import uvm_pkg::*;`include "uvm_macros.svh"`include "apb_seq_item.svh"`include "apb_agent_config.svh" `include "apb_driver.svh"`include "apb_coverage_monitor.svh"`include "apb_monitor.svh"`include "apb_sequencer.svh"`include "apb_agent.svh"`include "apb_seq.svh"endpackage: apb_agent_pkg

agent 有一個配置對象,用于定義

1、agent的拓?fù)浣涌凇?/span>

UVM agent中有一個類型為UVM_ACTIVE_PASSIVE_e的變量,UVM_ACTIVE會構(gòu)建sequencer driver,UVM_PASSIVE則不會。此參數(shù)默認(rèn)情況下為UVM_ACTIVE,當(dāng)然也可以不去使用。


2、virtual interface句柄

配置對象還會包含一個driver monitor需要使用的?virtual interface句柄。配置對象在Testcase中構(gòu)造和配置,virtual interface賦值給agent中的virtual interface。

?

3、子組件的行為

配置對象還可以包含影響agent 的行為的其他變量。例如,在apb agent的配置對象中,有一些變量可以設(shè)置哪些內(nèi)存地址是有效的。

class apb_agent_config extends uvm_object;`uvm_object_utils(apb_agent_config)virtual?apb_if?APB;?uvm_active_passive_enum active = UVM_ACTIVE;bit has_functional_coverage = 0;bit has_scoreboard = 0;int no_select_lines = 1;logic[31:0] start_address[15:0];logic[31:0] range[15:0];extern function new(string name = "apb_agent_config");endclass: apb_agent_configfunction
apb_agent_config::new(string name = "apb_agent_config");super.new(name);endfunction一旦構(gòu)建了agent的子組件,就需要連接它們。通常需要的連接有:

1、Monitor analysis portagent's analysis port

2、?sequencer的seq_item_pull_export到driver的seq_item_pull_port

3、agent配置對象中的virtual interface賦值給driver?和monitor?中virtual interfaces句柄


上述連接方式只是一個示例,具體項(xiàng)目可能有所不同,但是本質(zhì)上是一樣的。


以下示例了apb agent 的 build phase和 connect phase:


class apb_agent extends uvm_component;`uvm_component_utils(apb_agent)apb_agent_config m_cfg;uvm_analysis_port #(apb_seq_item) ap;apb_monitor m_monitor;apb_sequencer m_sequencer;apb_driver m_driver;apb_coverage_monitor m_fcov_monitor;extern function new(string name = "apb_agent", uvm_component parent = null);extern function void build_phase( uvm_phase phase );extern function void connect_phase( uvm_phase phase );endclass: apb_agent
function apb_agent::new(string name = "apb_agent", uvm_component parent = null);super.new(name, parent);endfunctionfunction void apb_agent::build_phase( uvm_phase phase );if( !uvm_config_db #( apb_agent_config )::get(this,"apb_agent_config",m_cfg) ) `uvm_error(...)m_monitor = apb_monitor::type_id::create("m_monitor", this);if(m_cfg.active == UVM_ACTIVE) begin m_driver = apb_driver::type_id::create("m_driver", this); m_sequencer = apb_sequencer::type_id::create("m_sequencer", this);endif(m_cfg.has_functional_coverage) begin m_fcov_monitor = apb_coverage_monitor::type_id::create("m_fcov_monitor", this);endendfunction:?build_phasefunction void apb_agent::connect_phase( uvm_phase phsae );m_monitor.APB = m_cfg.APB;ap = m_monitor.ap;if(m_cfg.active == UVM_ACTIVE) begin m_driver.seq_item_port.connect(m_sequencer.seq_item_export); m_driver.APB = m_cfg.APB;endif(m_cfg.has_functional_coverage) begin m_monitor.ap.connect(m_fcov_monitor.analysis_export);?end?endfunction:?connect_phase

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
關(guān)閉
關(guān)閉