Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

sequence/driver response scheme improvement

$
0
0

When a driver returns a response to the sequence, it calls 'set_id_info()' to set the identifiers of the transactions returned. This way, the originating sequence can correlate the response and the originating transaction, by matching the 2 fields sequence_id and transaction_id.

 

 

This has a couple of drawbacks :

  1. the sequence writer must set this field 'transaction_id' by hand
  2. the transanction_id may not be unique - a bug can be introduced (sequence/driver) and go unnnoticed when the wrong matching occurs - worst scenario is when a user simply forgets to set it, and the matching still occurs, but is wrong !

 

An improvement/fix to address these 2 issues would be to use field 'inst_id' (which is unique) instead of 'transaction_id' (user defined).

It looks to me the original intention was to use this field rather than 'transaction_id'.

 

The code change would be :

 

  function void set_id_info(uvm_sequence_item item);
    if (item == null) begin
      uvm_report_fatal(get_full_name(), "set_id_info called with null parameter", UVM_NONE);
    end
  /* this.set_transaction_id(item.get_transaction_id()); */
    this.set_transaction_id(item.get_inst_id());

    this.set_sequence_id(item.get_sequence_id());
  endfunction

 


Viewing all articles
Browse latest Browse all 756

Trending Articles