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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4332|回复: 6

[求助] 求助:在连接seq_item_port与seq_item_export时出错

[复制链接]
发表于 2013-3-13 11:50:46 | 显示全部楼层 |阅读模式

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

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

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:




  1. class axi_master_agent extends uvm_agent;   
  2.     axi_config               cfg;
  3.     axi_master_write_sequencer      write_sequencer;
  4.     axi_master_write_driver  write_driver;

  5.     `uvm_component_utils_begin(axi_master_agent)
  6.          `uvm_field_enum(uvm_active_passive_enum,is_active,UVM_DEFAULT)
  7.         `uvm_field_object(cfg,UVM_DEFAULT|UVM_REFERENCE)
  8.     `uvm_component_utils_end

  9.     function new (string name ,uvm_component parent);
  10.         super.new(name,parent);
  11.     endfunction : new

  12.     extern virtual function void build_phase(uvm_phase phase);
  13.     extern virtual function void connect_phase(uvm_phase phase);
  14.     extern virtual function void update_config(input axi_config cfg);

  15. endclass : axi_master_agent

  16. function void axi_master_agent::build_phase(uvm_phase phase);
  17.     uvm_object config_obj;
  18.     super.build_phase(phase);
  19.     if(cfg==null) begin
  20.         if(!uvm_config_db#(axi_config)::get(this,"","cfg",cfg))
  21.             `uvm_warning("NOCONFIG","Config not set for master agent, using default is_active field")
  22.     end
  23.     else is_active = cfg.master_config.is_active;

  24.     if(is_active==UVM_ACTIVE) begin
  25.         write_sequencer = axi_master_write_sequencer::type_id::create("write_sequencer",this);
  26.         write_driver    = axi_master_write_driver::type_id::create("write_driver",this);
  27.     end
  28. endfunction : build_phase

  29. function void axi_master_agent::connect_phase(uvm_phase phase);
  30.     super.connect_phase(phase);
  31.     if(is_active==UVM_ACTIVE)
  32.         write_driver.seq_item_port.connect(write_sequencer.seq_item_export);
  33. endfunction : connect_phase

  34. function void axi_master_agent::update_config(input axi_config cfg);
  35.     if(is_active==UVM_ACTIVE) begin
  36.         write_sequencer.cfg=cfg;
  37.     end
  38. endfunction : update_config


复制代码


axi_write_sequencer:




  1. class axi_master_write_sequencer extends uvm_sequencer;
  2.     axi_config cfg;

  3.     `uvm_component_utils_begin(axi_master_write_sequencer)
  4.         `uvm_field_object(cfg, UVM_DEFAULT)
  5.     `uvm_component_utils_end

  6.     function new(string name, uvm_component parent);
  7.         super.new(name,parent);
  8.     endfunction : new

  9.     virtual function void build_phase(uvm_phase phase);
  10.         super.build_phase(phase);
  11.         if(cfg == null)
  12.             if(!uvm_config_db#(axi_config)::get(this,"","cfg",cfg))
  13.                 `uvm_warning("NOCONFIG","apb_config not set for this component")
  14.     endfunction : build_phase
  15. endclass : axi_master_write_sequencer


复制代码


axi_write_driver:




  1. class axi_master_write_driver extends uvm_driver #(axi_transfer);
  2.     virtual axi_write_if vif;
  3.     axi_master_config cfg;
  4.     axi_transfer array_transfer[$];// use queue which size can be dynamically

  5.     `uvm_component_utils_begin(axi_master_write_driver)
  6.         `uvm_field_object(cfg,UVM_DEFAULT)
  7.     `uvm_component_utils_end

  8.     function new(string name,uvm_component parent);
  9.         super.new(name,parent);
  10.     endfunction : new

  11.     extern virtual function void build_phase(uvm_phase phase);
  12.     extern virtual function void connect_phase(uvm_phase phase);
  13.     extern virtual task run_phase(uvm_phase phase);
  14.     //extern virtual protected task get_and_drive();
  15.     extern virtual protected task reset();
  16.     extern virtual protected task drive();
  17.     extern virtual protected task drive_aw(axi_transfer trans);
  18.     extern virtual protected task drive_w(axi_transfer trans);
  19.     extern virtual protected task receive();

  20. endclass : axi_master_write_driver

  21. function void axi_master_write_driver::build_phase(uvm_phase phase);
  22.     super.build_phase(phase);
  23.     if(cfg == null)
  24.         if(!uvm_config_db#(axi_master_config)::get(this,"","cfg",cfg))
  25.             `uvm_error("NOCONFIG","axi_master_config not set for this component")

  26. endfunction : build_phase  

  27. function void axi_master_write_driver::connect_phase(uvm_phase phase);
  28.     super.connect_phase(phase);
  29.     if(!uvm_config_db#(virtual axi_write_if)::get(this,"","vif",vif))
  30.         `uvm_error("NOVIF",{"virtual interface must be set for : ",get_full_name(),".vif"})
  31. endfunction : connect_phase
  32. .....
  33. .....


复制代码


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).
发表于 2013-3-13 21:36:30 | 显示全部楼层
01.class axi_master_write_sequencer extends uvm_sequencer #(axi_transfer);
发表于 2013-3-14 09:49:41 | 显示全部楼层
顶楼上!你的sequencer后面没有加transaction类型。
 楼主| 发表于 2013-3-14 11:48:48 | 显示全部楼层
谢谢楼上诸位!
这个问题终于解决了。
发表于 2013-8-15 10:50:49 | 显示全部楼层
这个port 是UVM 自带的 port 么?
 楼主| 发表于 2013-8-15 16:53:41 | 显示全部楼层
回复 5# bruce_hz
应该是uvm_sequencer和uvm_driver中自带的,写了自己的sequencer和driver可以直接使用的。
发表于 2016-4-13 19:39:11 | 显示全部楼层
您好,我想问您一下,seq_item_port和seq_item_export是driver和sequencer自己已经定义好了,只需要在agent的connect——phase中完成连接就行了是吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-9-21 19:28 , Processed in 0.025671 second(s), 11 queries , Gzip On, Redis On.

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