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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2787|回复: 3

[求助] agent中undefined variable

[复制链接]
发表于 2012-6-1 10:58:31 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 puyaraimondii 于 2012-6-1 13:56 编辑

我写的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
 楼主| 发表于 2012-6-1 13:56:18 | 显示全部楼层
回复 2# 海天之间


   这里我是用的tab,粘贴过程中排版问题吧?
发表于 2012-6-2 11:19:07 | 显示全部楼层
请检查一下 仿真工具的编译的log里面  是否在报这个错误之前 已经将这几个文件编译过了

`include "booth_monitor.sv"
`include "booth_driver.sv"
`include "booth_sequencer.sv"
 楼主| 发表于 2012-6-4 10:01:08 | 显示全部楼层
回复 3# feiying_cq


   是我写错了。new中的super.new写错了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-5-2 06:06 , Processed in 0.041456 second(s), 9 queries , Gzip On, Redis On.

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