UVM基础之------uvm_transaction

uvm_transaction继承自uvm_object,添加了timing和recording接口,该类是uvm_sequence_item的基类。下边将做剖析
1. 这个类提供了时间戳属性(timestamp properties),通知事件(notification events),和交易记录(transaction recording)支持。
2. 使用这个类作为用户定义的基础交易是弃用。其子类uvm_sequence_item应当作为基类为所有用户定义的事务类型。
3. 这个API的使用意图是在sequence item执行过程中通过调用uvm_component < uvm_driver >::accept_tr uvm_component::begin_tr uvm_component::end_tr。从而设置对应的时间戳(accept_time,begin_time,and end_tr),触发对应的event(begin_event and end_event),如果启用,记录事务内容特定于供应商的事务数据库。
4. Note that start_item/finish_item (or `uvm_do* macro) executed from a uvm_sequence #(REQ,RSP) will automatically trigger the begin_event and end_events via calls to begin_tr and end_tr.
5. 虽然方便,但是触发这些事件通常应该由drivers去标记事务执行期间的进展,标志着一个事务执行期间的进展。 To allow the driver to control sequence item timestamps, events, and recording, you must add +define+UVM_DISABLE_AUTO_ITEM_RECORDING when compiling the UVM package. 
6. 另外,用户可能使用事务的event pool,events,定义自定义events驱动触发和序列等。任何中间事件等标记的地址和数据的开始阶段事务执行可以通过events pools实现。
7. In pipelined protocols, the driver may release a sequence (return from finish_item() or it’s `uvm_do macro) before the item has been completed.  If the driver uses the begin_tr/end_tr API in uvm_component, the sequence can wait on the item’s end_event to block until the item was fully executed, as in the following example.
8.  task uvm_execute(item, ...);
    // can use the `uvm_do macros as well
    start_item(item);
    item.randomize();
    finish_item(item);
    item.end_event.wait_on();
    // get_response(rsp, item.get_transaction_id()); //if needed
endtask

9. A simple two-stage pipeline driver that can execute address and data phases concurrently might be implemented as follows:
task run();
    // this driver supports a two-deep pipeline
    fork
      do_item();
      do_item();
    join
endtask
 
 
task do_item();
 
  forever begin
    mbus_item req;  
    lock.get();  
    seq_item_port.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值