失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > env——同相运算放大器

env——同相运算放大器

时间:2024-07-18 01:49:45

相关推荐

env——同相运算放大器

放小豪老师的b站IC验证 - 手把手教你搭建UVM芯片验证环境(含代码)_哔哩哔哩_bilibili

整个验证环境由4个组件组成,i_agt、o_agt 、mdl(reference model)、 scb(scoreboard)。

组件之间通过TLM通信,声明了analysis_fifo.

i_agt:内部例化了driver、monitor、sequencer。

o_agt: 内部只例化了monitor。

目录

1.代码解析(声明)

2.代码解析(例化)

3.代码解析(连接)

4.代码解析(打印)

总结:

1.代码解析(声明)

class ue_env extends uvm_env;ue_config cfg;ue_agent i_agt;ue_agent o_agt;ue_ref_model mdl;ue_scoreboard scb;uvm_tlm_analysis_fifo #(ue_transaction) iagt_mdl_fifo;uvm_tlm_analysis_fifo #(ue_transaction) oagt_scb_fifo;uvm_tlm_analysis_fifo #(ue_transaction) mdl_scb_fifo;`uvm_component_utils(ue_env)extern function new (string name = "ue_env", uvm_component parent =null);extern function void build();extern function void connect();extern function void report();endclass : ue_env

extern 表示 build、connect、report方法外部声明

2.代码解析(例化)

function void ue_env::build();super.build();if(!uvm_config_db#(ue_config)::get(this,"","cfg", cfg)) begincfg = ue_config::type_id::create("cfg");endi_agt = ue_agent::type_id::create("i_agt",this);i_agt.is_active=cfg.i_agt_is_active;o_agt = ue_agent::type_id::create("o_agt",this);o_agt.is_active=cfg.o_agt_is_active;mdl = ue_ref_model::type_id::create("mdl",this);scb = ue_scoreboard::type_id::create("scb",this);iagt_mdl_fifo = new("iagt_mdl_fifo",this);oagt_scb_fifo = new("oagt_scb_fifo",this);mdl_scb_fifo = new("mdl_scb_fifo",this);`uvm_info(get_type_name(), $sformatf("built"), UVM_LOW)endfunction :build

TLM端口并不属于component,所以不能通过create创建

3.代码解析(连接)

function void ue_env::connect();super.connect();i_agt.mon.ap.connect(iagt_mdl_fifo.analysis_export);mdl.gp.connect(iagt_mdl_fifo.blocking_get_export);o_agt.mon.ap.connect(oagt_scb_fifo.analysis_export);scb.act_gp.connect(oagt_scb_fifo.blocking_get_export);mdl.ap.connect(mdl_scb_fifo.analysis_export);scb.exp_gp.connect(mdl_scb_fifo.blocking_get_export);`uvm_info(get_type_name(), "connected", UVM_LOW)endfunction :connect

TLM_FIFO相当于缓存两端加上import端口作为中转,两侧连接的component都可以主动发送或索取数据。虽然作用上是import端口,但是命名上以export结束。

4.代码解析(打印)

function void ue_env::report();super.report();if(i_agt.mon.sent_item_num == o_agt.mon.sent_item_num) `uvm_info(get_type_name(), "sent_item_num check ok", UVM_LOW)else`uvm_error("ENV_ERROR", "sent_item_num check error")endfunction:report

i_agt与o_agt数量比较在env中完成。

总结:

sequencer将sequence产生的激励传给driver,driver通过virtual interface解析为dut可以识别的信号,monitor监测传给DUT的信号并将其发送给reference model,reference model调用c++库函数进行运算,将结果传递给scoreboard。

另一方面,dut运算后结果被o_agt中的monitor监测并传给scoreboard,在scoreboard中进行比较。

如果觉得《env——同相运算放大器》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。