微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC验证交流 > agent中undefined variable

agent中undefined variable

时间:10-02 整理:3721RD 点击:

我写的agent提示:# QuestaSim vlog 10.0d Compiler 2011.10 Oct 30 2011
# ** Note: (vlog-2286) Using implicit +incdir+E:/questasim_10.0d/uvm-1.1/../verilog_src/uvm-1.1/src from import uvm_pkg
# ** Error: booth_agent.sv(36): Undefined variable: sqr.
# ** Error: booth_agent.sv(37): Undefined variable: drv.
# ** Error: booth_agent.sv(41): Undefined variable: mon.
附agent的代码:
`include "uvm_macros.svh"
`include "booth_monitor.sv"
`include "booth_driver.sv"
`include "booth_sequencer.sv"
import uvm_pkg::*;
class booth_agent extends uvm_agent;
uvm_active_passive_enum is_active = UVM_ACTIVE;
booth_sequencer sqr;
booth_driver drv;
booth_monitor mon;
uvm_analysis_port #( booth_frame ) agent_from_drv_mon;
function new( string name , uvm_component parent );

super.name( name , parent );
endfunction

extern virtual function void build_phase( uvm_phase phase );
extern virtual function void connect_phase( uvm_phase phase );
`uvm_component_utils_begin( booth_agent )
`uvm_field_enum( uvm_active_passive_enum , is_active , UVM_ALL_ON);
//`uvm_field_object( sqr , UVM_DEFAULT )
//`uvm_field_object( drv , UVM_ALL_ON )
//`uvm_field_object( mon , UVM_ALL_ON )
`uvm_component_utils_end
endclass
function void build_phase( uvm_phase phase );
super.build_phase( phase );
//if( is_active == UVM_ACTIVE ) begin
sqr = booth_sequencer::type_id::create("sqr",this);
drv = booth_driver::type_id::create("drv",this);
`uvm_info("Create","Agent have created sqr and drv.",UVM_LOW)
//end
//else begin
mon = booth_monitor::type_id::create("mon",this);
`uvm_info("Create","Agent have created sqr and drv.",UVM_LOW)
//end
endfunction
function void booth_agent::connect_phase( uvm_phase phase );
super.connect_phase( phase );
if( is_active == UVM_ACTIVE ) begin
this.agent_from_drv_mon = drv.driver_to_agent;
drv.seq_item_port.connect(sqr.seq_item_export);
end
else begin
this.agent_from_drv_mon = mon.monitor_to_agent;
end
endfunction
`endif

这里我是用的tab,粘贴过程中排版问题吧?

请检查一下 仿真工具的编译的log里面是否在报这个错误之前 已经将这几个文件编译过了
`include "booth_monitor.sv"
`include "booth_driver.sv"
`include "booth_sequencer.sv"

是我写错了。new中的super.new写错了。

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

网站地图

Top