hover99的个人空间 https://blog.eetop.cn/253668 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

implement multi-imp in the same component

已有 1270 次阅读| 2011-6-8 14:31 |个人分类:UVM

The TLM implemenation declaration macros provide a way for components to provide multiple implemenation ports of the same implementation interface. When an implementation port is defined using the built-in set of imps, there must be exactly one implementation of the interface.
For example, if a component needs to provide a put implemenation then it would have an implementation port defined like:
class mycomp extends uvm_component;
   uvm_put_imp#(data_type, mycomp) put_imp;
   ...
   virtual task put (data_type t);
     ...
   endtask
 endclass

There are times, however, when you need more than one implementation for an interface. This set of declarations allow you to easily create a new implemenation class to allow for multiple implementations. Although the new implemenation class is a different class, it can be bound to the same types of exports and ports as the original class. Extending the put example above, lets say that mycomp needs to provide two put implementation ports. In that case, you would do something like:
 //Define two new put interfaces which are compatible with uvm_put_ports
 //and uvm_put_exports.

 `uvm_put_imp_decl(_1)
 `uvm_put_imp_decl(_2)
 class my_put_imp#(type T=int) extends uvm_component;
    uvm_put_imp_1#(T) put_imp1;
    uvm_put_imp_2#(T) put_imp2;
    ...
    function void put_1 (input T t);
      //puts comming into put_imp1
      ...
    endfunction
    function void put_2(input T t);
      //puts comming into put_imp2
      ...
    endfunction
 endclass

 The important thing to note is that each `uvm_<interface>_imp_decl creates a  new class of type uvm_<interface>_imp<suffix>, where suffix is the input  argument to the macro. For this reason, you will typically want to put these macros in a seperate package to avoid collisions and to allow  sharing of the definitions.

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 3

    粉丝
  • 0

    好友
  • 0

    获赞
  • 3

    评论
  • 982

    访问数
关闭

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


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

GMT+8, 2024-11-22 12:31 , Processed in 0.022234 second(s), 14 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部