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

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

日志

Connections to DUT Interfaces(从DualTop开始)

已有 871 次阅读| 2018-9-28 09:26 |系统分类:芯片设计

        DualTop

      通常,DUT-TB验证框架具有单个SystemVerilog模块作为顶层。该顶层模块包含DUT及其相关接口、协议模块、连接关系和所支持的逻辑。它还包含用于创建测试平台的代码。该顶层模块所包含的这些繁杂的“东西”都会变得混乱而难以管理。管理所有这些东西的另一种方法是将与DUT直接相关的所有内容封装在包装器模块中。Verilog允许在simulation中使用多个顶层模块。这两个模块都没有实例化,而是都被视为顶层模块。这种安排称为双顶层。
       双顶层是emulation的必需品。DUT包装器模块(双顶层中的其中一个顶层)是emulator中的东西。包含测试平台的另一个顶层模块(双顶层中的另一个顶层模块)在simulator中保持运行。如果测试平台仅用于simulation,则双顶层不是必需的,但是仍然可以为模块化、重用性等目的提供有用的封装级别。
       使用uvm_config_db完成DUT包装器模块和测试平台之间的虚拟接口连接通信。

       【此处需一幅图】

       DUT Wrapper module  

       在此示例中,MAC DUT及其相关接口和协议模块以及WISHBONE slave memory以及WISHBONE总线逻辑包含在DUT包装器模块top_mac中。

       module top_mac;
              import uvm_pkg::*;
              import test_params_pkg::*;

              // WISHBONE interface instance
              // Supports up to 8 masters and up to 8 slaves
              wishbone_bus_syscon_if wb_bus_if();

              //----------------------------------- 
              // WISHBONE 0, slave 0: 000000 - 0fffff
              // this is 1 Mbytes of memory
              wb_slave_mem #(mem_slave_size) wb_s_0 (
                     ...
              );

              // wires for MAC MII connection
             wire [3:0] MTxD;
             wire [3:0] MRxD;

             //----------------------------------- 
             // MAC 0
             // It is WISHBONE slave 1: address range 100000 - 100fff
             // It is WISHBONE Master 0
             eth_top mac_0 (
                  ...
             );

             // protocol module for MAC MII interface
             mac_mii_protocol_module #(.INTERFACE_NAME("MIIM_IF")) mii_pm(
                   ...
             );

             initial
                //set WISHBONE virtual interface in config space
                uvm_config_db #(virtual wishbone_bus_syscon_if)::set(null, "uvm_test_top", "WB_BUS_IF", wb_bus_if);

       endmodule

       Testbench top module

       在创建测试平台的顶层模块中是一个调用run_test()的initial块。请注意导入uvm_pkg :: run_test和tests_pkg :: test_mac_simple_duplex。这些是编译run_test()代码行所必需的。

       // This the top for the tesbench in a dual top setup
       // The dut is in the top_mac dut wrapper module
       module top;
              import uvm_pkg::run_test;
              import tests_pkg::test_mac_simple_duplex;

              initial
                 run_test("test_mac_simple_duplex"); // create and start running test
              endmodule

        Questasim with more than one top level module

        对vsim的调用包括多个顶层模块。

        #Makefile
        ...
        normal: clean cmp
             vsim +nowarnTSCALE -c top top_mac -suppress 3829 -do "run -all"
        ...

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


点赞

评论 (0 个评论)

facelist

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

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

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 0

    好友
  • 0

    获赞
  • 6

    评论
  • 访问数
关闭

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

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

GMT+8, 2024-4-20 20:33 , Processed in 0.027719 second(s), 18 queries , Gzip On, Redis On.

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