|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 oscillator_cn1 于 2013-3-13 11:58 编辑
各位:
目前正在学习UVM,在agent中将driver的seq_item_port与sequencer的seq_item_export连接起来的时候,nc报错TYCMPAT,大致是说类型不一致?可是port与export相连会类型不一致么,这个问题还是第一次碰到,有没有高手能帮忙解答一下?
相关代码如下:
axi_master_agent:
- class axi_master_agent extends uvm_agent;
- axi_config cfg;
- axi_master_write_sequencer write_sequencer;
- axi_master_write_driver write_driver;
- `uvm_component_utils_begin(axi_master_agent)
- `uvm_field_enum(uvm_active_passive_enum,is_active,UVM_DEFAULT)
- `uvm_field_object(cfg,UVM_DEFAULT|UVM_REFERENCE)
- `uvm_component_utils_end
- function new (string name ,uvm_component parent);
- super.new(name,parent);
- endfunction : new
- extern virtual function void build_phase(uvm_phase phase);
- extern virtual function void connect_phase(uvm_phase phase);
- extern virtual function void update_config(input axi_config cfg);
- endclass : axi_master_agent
- function void axi_master_agent::build_phase(uvm_phase phase);
- uvm_object config_obj;
- super.build_phase(phase);
- if(cfg==null) begin
- if(!uvm_config_db#(axi_config)::get(this,"","cfg",cfg))
- `uvm_warning("NOCONFIG","Config not set for master agent, using default is_active field")
- end
- else is_active = cfg.master_config.is_active;
- if(is_active==UVM_ACTIVE) begin
- write_sequencer = axi_master_write_sequencer::type_id::create("write_sequencer",this);
- write_driver = axi_master_write_driver::type_id::create("write_driver",this);
- end
- endfunction : build_phase
- function void axi_master_agent::connect_phase(uvm_phase phase);
- super.connect_phase(phase);
- if(is_active==UVM_ACTIVE)
- write_driver.seq_item_port.connect(write_sequencer.seq_item_export);
- endfunction : connect_phase
- function void axi_master_agent::update_config(input axi_config cfg);
- if(is_active==UVM_ACTIVE) begin
- write_sequencer.cfg=cfg;
- end
- endfunction : update_config
复制代码
axi_write_sequencer:
- class axi_master_write_sequencer extends uvm_sequencer;
- axi_config cfg;
- `uvm_component_utils_begin(axi_master_write_sequencer)
- `uvm_field_object(cfg, UVM_DEFAULT)
- `uvm_component_utils_end
- function new(string name, uvm_component parent);
- super.new(name,parent);
- endfunction : new
- virtual function void build_phase(uvm_phase phase);
- super.build_phase(phase);
- if(cfg == null)
- if(!uvm_config_db#(axi_config)::get(this,"","cfg",cfg))
- `uvm_warning("NOCONFIG","apb_config not set for this component")
- endfunction : build_phase
- endclass : axi_master_write_sequencer
复制代码
axi_write_driver:
- class axi_master_write_driver extends uvm_driver #(axi_transfer);
- virtual axi_write_if vif;
- axi_master_config cfg;
- axi_transfer array_transfer[$];// use queue which size can be dynamically
- `uvm_component_utils_begin(axi_master_write_driver)
- `uvm_field_object(cfg,UVM_DEFAULT)
- `uvm_component_utils_end
- function new(string name,uvm_component parent);
- super.new(name,parent);
- endfunction : new
- extern virtual function void build_phase(uvm_phase phase);
- extern virtual function void connect_phase(uvm_phase phase);
- extern virtual task run_phase(uvm_phase phase);
- //extern virtual protected task get_and_drive();
- extern virtual protected task reset();
- extern virtual protected task drive();
- extern virtual protected task drive_aw(axi_transfer trans);
- extern virtual protected task drive_w(axi_transfer trans);
- extern virtual protected task receive();
- endclass : axi_master_write_driver
- function void axi_master_write_driver::build_phase(uvm_phase phase);
- super.build_phase(phase);
- if(cfg == null)
- if(!uvm_config_db#(axi_master_config)::get(this,"","cfg",cfg))
- `uvm_error("NOCONFIG","axi_master_config not set for this component")
- endfunction : build_phase
- function void axi_master_write_driver::connect_phase(uvm_phase phase);
- super.connect_phase(phase);
- if(!uvm_config_db#(virtual axi_write_if)::get(this,"","vif",vif))
- `uvm_error("NOVIF",{"virtual interface must be set for : ",get_full_name(),".vif"})
- endfunction : connect_phase
- .....
- .....
复制代码
nc错误提示:
write_driver.seq_item_port.connect(write_sequencer.seq_item_export);
|
ncelab: *E,TYCMPAT (./axi_master_agent.sv,46|73): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'class uvm_port_base#(.IF(class uvm_sqr_if_base#(.T1(class axi_transfer),.T2(class axi_transfer))))' but found 'class uvm_seq_item_pull_imp#(.REQ(class uvm_sequence_item),.RSP(class uvm_sequence_item),.IMP(class uvm_sequencer#(.REQ(class uvm_sequence_item),.RSP(class uvm_sequence_item))))' instead). |
|