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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 16390|回复: 11

[求助] UVM中DUT的interface的连接问题

[复制链接]
发表于 2012-4-20 19:00:37 | 显示全部楼层 |阅读模式

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

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

x
各位大侠,我最近在学uvm,根据书《UVM1.1应用指南及源码分析》 在顶层连接interface时出错了,我的test是一个my_test类,但是书上通过config来配置却是:
25 initial begin
26     uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv","my_if",my_my_if);
27     uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.o_agt.mon","my_if",my_my_if);
28     run_test();
29 end

用irun运行时出现
file: ./top.sv
    uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv","my_if",my_my_if);
                |
ncvlog: *E,NOPBIND (./top.sv,26|16): Package uvm_config_db could not be bound.
    uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.o_agt.mon","my_if",my_my_if);
                |
ncvlog: *E,NOPBIND (./top.sv,27|16): Package uvm_config_db could not be bound.
        module worklib.top:sv
                errors: 2, warnings: 0


我的问题是这uvm_test_top是uvm里面内定的吗?无论什么testcase 都这样配置??我仔细看过路径没有错啊,这个错误怎样去除??
我将其改为my_test.env.o_agt.drv问题仍然是一样的,

top的源代码是

2 `include "my_if.sv"
  3 `include "dut.sv"
  4
  5 module top;
  6    import uvm_pkg::*;
  7    `include "uvm_macros.svh"
  8    `include "my_test.sv"
  9
10    reg clk;
11    my_if my_my_if(clk,clk);
12    dut my_dut(.clk(clk),
13               .rxd(my_my_if.rxd),
14               .rx_dv(my_my_if.rx_dv),
15               .txd(my_my_if.txd),
16               .tx_en(my_my_if.tx_en)
17              );
18 initial begin
19     clk = 0;
20     forever begin
21         #10; clk=~clk;
22     end
23 end
24
25 initial begin
26     uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv","my_if",my_my_if);
27     uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.o_agt.mon","my_if",my_my_if);
28     run_test();
29 end
30 endmodule

在driver和monitor中声明 interface是这样的


  virtual my_if vif;

但是我改为
uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv",“vif",my_my_if);
也是不对的

请知道的人赐教啊,小弟不甚感激。
发表于 2012-4-21 12:37:19 | 显示全部楼层
uvm_test_top是一个例化名字,UVM根据你给的test_name,通过factory创建的test top对象的名字。而这个test_name是在调用run_test(string test_name="")时指定或者通过+UVM_TESTNAME=xxx指定的。
 楼主| 发表于 2012-4-23 14:53:33 | 显示全部楼层
whxqq:
      我跑test是 ius报告my_test 没有注册,我的my_test是一个类,在类中已经用uvm_component_utils注册过了,难道还要其他地方注册吗??



class my_test extends uvm_test;
  6
  7      `uvm_component_utils(my_test)
  8      my_env env;
  9      extern function new(string name = "my_test" , uvm_component parent = null);
10      extern virtual function void build_phase(uvm_phase phase);
11 endclass



UVM_WARNING @ 0: reporter [BDTYP] Cannot create a component of type 'my_test' because it is not registered with the factory.
UVM_FATAL @ 0: reporter [INVTST] Requested test from command line +UVM_TESTNAME=my_test not found.
发表于 2012-4-23 23:30:49 | 显示全部楼层
uvm_test_top是UVM内部给最顶层的uvm_root的实例名。这个不能改。在top_tb的initial中通过config_db ::set以后,在driver和monitor中要config_db::get。set的意思是写入资源。get的意思是读出资源。你在driver和monitor中怎么还能再set啊?
发表于 2012-4-23 23:36:03 | 显示全部楼层
回复 3# heritor


    用+UVM_TESTNAME=my_case。而不是my_test。而且在my_case中要通过config_db机制把某个sequence设置为sequencer在main_phase中的default_sequence。你看看是不是这个问题。
 楼主| 发表于 2012-4-24 09:59:04 | 显示全部楼层
回复 5# zhaowf


    多谢了,这也是一个问题,现在可以run了,是宏定义写错了,感谢大家的帮组。
发表于 2014-2-27 17:02:22 | 显示全部楼层
回复 6# heritor


    楼主,请问是什么宏定义写错了,小弟现在也遇到和你一样的问题,Requested test from command line +UVM_TESTNAME not found
恳请指教,多谢。
发表于 2014-3-10 18:30:10 | 显示全部楼层
楼主好人...
发表于 2015-1-29 15:42:00 | 显示全部楼层
回复 6# heritor


    楼主,我也遇到了同样的问题,到底是哪里错了呀!
发表于 2016-3-31 17:15:44 | 显示全部楼层
楼主,您的interface怎么写的啊,求解答~~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

×

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

GMT+8, 2024-5-5 20:23 , Processed in 0.026588 second(s), 6 queries , Gzip On, Redis On.

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