ee_king的个人空间 https://blog.eetop.cn/1494617 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

Testbench/IntegrationLevel(从The PSS env开始)

已有 917 次阅读| 2018-9-12 14:37 |系统分类:芯片设计

       The PSS env

       在测试各种has_ <sub-component>字段以确定测试用例是否需要相应env之后,PSS env build过程检索配置对象并构造各种子env。如果需要使用子env,则在PSS envs配置表中设置sub-envs配置对象。connect method用于在TLM ports and exports之间建立连接,就如monitors和analysis components(如记分板)之间建立连接就是这样一个典型例子。

       //
       // Class Description:
       //
       //
       class pss_env extends uvm_env;

       // UVM Factory Registration Macro
       //
       `uvm_component_utils(pss_env)

       //------------------------------------------
       // Data Members
       //------------------------------------------
       pss_env_config m_cfg;
       //------------------------------------------
       // Sub Components
       //------------------------------------------
       spi_env m_spi_env;
       gpio_env m_gpio_env;
       ahb_agent m_ahb_agent;
       pss_virtual_sequencer m_vsqr;
       //------------------------------------------
       // Methods
       //------------------------------------------

       // Standard UVM Methods:
       extern function new(string name = "pss_env", uvm_component parent = null);
       // Only required if you have sub-components
       extern function void build_phase( uvm_phase phase );
       // Only required if you have sub-components which are connected
       extern function void connect_phase( uvm_phase phase );

       endclass: pss_env

       function pss_env::new(string name = "pss_env", uvm_component parent = null);
            super.new(name, parent);
       endfunction

       // Only required if you have sub-components
       function void pss_env::build_phase( uvm_phase phase );
            if( !uvm_config_db #( pss_env_config )::get(this,"","pss_env_config",m_cfg) ) `uvm_error(...)【此处书上有笔误,"::get"错写成“::get_config”】
            if(m_cfg.has_spi_env) begin
                uvm_config_db::set( this , "m_spi_env*", "spi_env_config", m_cfg.m_spi_env_cfg);
                m_spi_env = spi_env::type_id::create("m_spi_env", this);
            end
            if(m_cfg.has_gpio_env) begin
                uvm_config_db #( gpio_env_config )::set("m_gpio_env*", "gpio_env_config", m_cfg.m_gpio_env_cfg);
                m_gpio_env = gpio_env::type_id::create("m_gpio_env", this);
            end
            if(m_cfg.has_ahb_agent) begin
                uvm_config_db #( ahb_agent_config )::set( this , "m_ahb_agent*", "ahb_agent_config", m_cfg.m_ahb_agent_cfg);
                m_ahb_agent = ahb_agent::type_id::create("m_ahb_agent", this);
            end

       endfunction: build_phase

       // Only required if you have sub-components which are connected
       function void pss_env::connect_phase( uvm_phase phase );
            // Inter-component TLM connections
       endfunction: connect_phase
 

       The rest of the test bench hierarchy

       build过程从上到下继续进行,子envs如块级测试平台示例中所示的那样有条件地构建,并且子env中包含的agent正如agent示例中所述的那样构建。

       Further levels of integration

       通过扩展针对PSS示例描述的过程,可以实现用于更进一步集成水平的垂直重用。每个级别的集成都会添加另一个层,因此例如,第2级的集成环境将包含两个或更多第1级的env,而第2级的env配置对象将包含第1级 env配置对象的嵌套句柄。显然,在层次结构的test级别,每轮垂直重用的代码量都会增加,但在层次结构的下面,配置和构建过程已经在上一代垂直分层中实现。

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


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 0

    好友
  • 0

    获赞
  • 6

    评论
  • 访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 07:55 , Processed in 0.019046 second(s), 18 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部