在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 5138|回复: 5

[求助] `include "hello_pkg.sv" 和import uvm_pkg::*; 区别

[复制链接]
发表于 2017-3-3 11:22:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
`include "hello_pkg.sv" 和import uvm_pkg::*; 区别 ?  这里做了两次,为什么?
`include "hello_pkg.sv"    //这里Include hello_pkg.sv"
`include "dut_hello.v"//测试模块DUT文件
`include "hello_if.sv"//接口文件
`include "hello_case.sv"//测试用例case

module hello_tb_top;
    import uvm_pkg::*;  
    import hello_pkg::*;//  import hello_pkg::*   
    reg clk;
    hello_if my_hello_if(clk,clk);//实例化接口
    dut my_dut(.clk(clk),
               .rxd(my_hello_if.rxd),
               .rx_dv(my_hello_if.rx_dv),
               .txd(my_hello_if.txd),
               .tx_en(my_hello_if.tx_en)
               );//实例化DUT,并将DUT的输入输出端口和my_hello_if连接在一起

    initial begin//产生DUT需要的时钟
        clk = 0;
        forever begin
            #10;clk = ~clk;
        end
    end
   
    initial begin//通过config_db的set方式将my_if通知driver和monitor
        //从而Driver和monitor可以直接和DUT通信
        uvm_config_db#(virtual hello_if)::set(null,"uvm_test_top.env.input_agt.drv","hello_if",my_hello_if);
        uvm_config_db#(virtual hello_if)::set(null,"uvm_test_top.env.output_agt.mon","hello_if",my_hello_if);
        run_test();//启动UVM
    end
endmodule
发表于 2017-3-3 21:28:24 | 显示全部楼层
include 你把代码吃进来,但是并不会被调用。import 调用
我并不用include,我在filelist吃它
我觉得你缺任何一个都不会work
 楼主| 发表于 2017-3-6 11:09:05 | 显示全部楼层
谢谢!
发表于 2017-3-6 14:51:38 | 显示全部楼层
楼主好棒
发表于 2017-6-9 14:46:16 | 显示全部楼层
回复 1# mil818


   include 把对应文件中的内容放到该文件中使用。        import引用命名空间,可以使用对应命名空间下的参数。
发表于 2017-6-14 14:26:10 | 显示全部楼层
我觉得`include "hello_pkg.sv"可以省略,前提是filelist中包含hello_pkg.sv并且在 hello_tb_top.sv 前面。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-5-13 19:18 , Processed in 0.022992 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表