|  | 
 
| 
本帖最后由 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
 | 
 |