微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC验证交流 > UVM中DUT的interface的连接问题

UVM中DUT的interface的连接问题

时间:10-02 整理:3721RD 点击:
各位大侠,我最近在学uvm,根据书《UVM1.1应用指南及源码分析》 在顶层连接interface时出错了,我的test是一个my_test类,但是书上通过config来配置却是:
25 initial begin
26uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv","my_if",my_my_if);
27uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.o_agt.mon","my_if",my_my_if);
28run_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;
6import uvm_pkg::*;
7`include "uvm_macros.svh"
8`include "my_test.sv"
9
10reg clk;
11my_if my_my_if(clk,clk);
12dut 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
19clk = 0;
20forever begin
21#10; clk=~clk;
22end
23 end
24
25 initial begin
26uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.i_agt.drv","my_if",my_my_if);
27uvm_config_db #(virtual my_if)::set(null,"uvm_test_top.env.o_agt.mon","my_if",my_my_if);
28run_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);
也是不对的
请知道的人赐教啊,小弟不甚感激。

uvm_test_top是一个例化名字,UVM根据你给的test_name,通过factory创建的test top对象的名字。而这个test_name是在调用run_test(string test_name="")时指定或者通过+UVM_TESTNAME=xxx指定的。

whxqq:
我跑test是 ius报告my_test 没有注册,我的my_test是一个类,在类中已经用uvm_component_utils注册过了,难道还要其他地方注册吗?

class my_test extends uvm_test;
6
7`uvm_component_utils(my_test)
8my_env env;
9extern function new(string name = "my_test" , uvm_component parent = null);
10extern 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.

uvm_test_top是UVM内部给最顶层的uvm_root的实例名。这个不能改。在top_tb的initial中通过config_db ::set以后,在driver和monitor中要config_db::get。set的意思是写入资源。get的意思是读出资源。你在driver和monitor中怎么还能再set啊?

用+UVM_TESTNAME=my_case。而不是my_test。而且在my_case中要通过config_db机制把某个sequence设置为sequencer在main_phase中的default_sequence。你看看是不是这个问题。

多谢了,这也是一个问题,现在可以run了,是宏定义写错了,感谢大家的帮组。

小编,请问是什么宏定义写错了,小弟现在也遇到和你一样的问题,Requested test from command line +UVM_TESTNAME not found
恳请指教,多谢。

小编好人...

小编,我也遇到了同样的问题,到底是哪里错了呀!

小编,您的interface怎么写的啊,求解答



uvm_test_top不是uvm_root的实例名,uvm_root是更高一层
uvm_test_top是你的case的最顶层,是uvm树的次顶层。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top