• 山西省互联网违法和不良信息举报中心——黄河新闻网 2019-01-28
  • 【三厢轿车】最新汽车报价 2019-01-28
  • 世界小姐张梓琳练功晒逆天长腿 被调侃心疼屋顶 2019-01-26
  • 体彩排列三走势图:Connections to DUT Interfaces(从Connect/TwoKingdomsFactory开始_2)

    排列五开奖结果查询 www.kj742.com 上一篇 / 下一篇  2018-09-28 08:42:11

            Connecting the testbench to the DUT

           【此处需一幅图】

           在wishbone包装器中,为基类driver创建派生的concrete class driver的实例重载。请注意,此示例中的代码设置为处理wishbone总线包装器的多个实例(因此还有多个DUT),这是使用WB_ID参数来统一实例重载的原因。此参数在top_mac??橹猩柚?。

            module top_mac;

                   wb_bus_wrapper #(0) wb_bus_0();
                   ...

            endmodule

            module wb_bus_wrapper #(int WB_ID = 0);
            ...

                   // Concrete driver class
                   class wb_bus_bfm_driver_c #(int ID = WB_ID) extends wb_bus_bfm_driver_base;
                        ...
                   endclass

                    initial begin
                        //set inst override of concrete bfm driver for base bfm driver
                        wb_bus_bfm_driver_base::type_id::set_inst_override(
                              wb_bus_bfm_driver_c #(WB_ID)::get_type(),
                              $sformatf("*env_%0d*", WB_ID));
                        ...
                    end

            endmodule

            【此处需一幅图】

           在testbench中的wishbone agent中,声明了一个基类driver句柄。当它由factory创建时,重载将生效,并且将创建派生的concrete class driver object。作为此object的Verilog域来说,此对象包含的wishbone总线包装器及其Verilog路径将指示它位于top_mac(wb_bus_0)内部创建的wishbone总线包装器实例内。从UVM的角度来看,该对象是wishbone agent的UVM分层子代(不是子类,仅仅是agent包含了此object),其ports连接到wishbone agent中的ports。

           class wb_master_agent extends uvm_agent;
           ...
                //ports
                uvm_analysis_port #(wb_txn) wb_agent_drv_ap;
                ...
                // components
                wb_bus_bfm_driver_base wb_drv;
                wb_config m_config;
                ...
                function void build_phase(uvm_phase phase);
                     super.build_phase(phase);
                     if (!uvm_config_db #(wb_config)::get(this, "", "wb_config", m_config)) // get config object
                         `uvm_fatal("Config Fatal", "Can't get the wb_config")
                     //ports
                     wb_agent_drv_ap = new("wb_agent_drv_ap", this);
                     ...
                     //components
                     wb_drv = wb_bus_bfm_driver_base::type_id::create("wb_drv", this); // driver
                     ...
                endfunction : build_phase

                function void connect_phase(uvm_phase phase);
                     super.connect_phase(phase);
                     //analysis ports
                     wb_drv.wb_drv_ap.connect(wb_agent_drv_ap);
                     ...
                     // child ports
                     wb_drv.seq_item_port.connect(wb_seqr.seq_item_export);
                endfunction : connect_phase

                function void end_of_elaboration_phase(uvm_phase phase);
                     wb_drv.m_id = m_config.m_wb_master_id;
                     ...
                endfunction : end_of_elaboration_phase
          endclass

          (在//verificationacademy.com/uvm-ovm上在线下载源代码示例)。



    TAG:

     

    评分:0

    我来说两句

    显示全部

    :loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

    日历

    « 2018-12-08  
          1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031     

    数据统计

    • 访问量: 15016
    • 日志数: 48
    • 建立时间: 2018-09-03
    • 更新时间: 2018-10-12

    RSS订阅

    Open Toolbar
  • 山西省互联网违法和不良信息举报中心——黄河新闻网 2019-01-28
  • 【三厢轿车】最新汽车报价 2019-01-28
  • 世界小姐张梓琳练功晒逆天长腿 被调侃心疼屋顶 2019-01-26