# UVM Sequence Item

**URL:** <https://verificationacademy.com/forums/t/uvm-sequence-item/41331>\
**Category:** UVM\
**Tags:** System-verilog-interface, UVM, uvm\_sequence\_item, sequence-item, UVM-DRIVER-INTERFACE\
**Created:** [February 28, 2023, 9:33am UTC](https://verificationacademy.com/forums/t/uvm-sequence-item/41331 "2023-02-28T09:33:29Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![graeme\_jessiman](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/graeme_jessiman/32/1201_2.png) [@graeme\_jessiman](https://verificationacademy.com/forums/u/graeme_jessiman)\
**Post date:** [March 1, 2023, 9:48am UTC](https://verificationacademy.com/forums/t/uvm-sequence-item/41331/4 "2023-03-01T09:48:49Z")

</div>

_In reply to [idrees96](https://verificationacademy.com/forums/t/uvm-sequence-item/41331/3):_

Here’s an example for a AHB agent

This is the interface

```verilog
interface ahb_if 

  (
  input tri hclk, 
  input tri hresetn,
  inout tri [31:0] haddr,
  inout tri [15:0] hwdata,
  inout tri [1:0] htrans,
  inout tri [2:0] hburst,
  inout tri [2:0] hsize,
  inout tri hwrite,
  inout tri hsel,
  inout tri hready,
  inout tri [15:0] hrdata,
  inout tri [1:0] hresp
  );

```

and here is the start of transaction class

```verilog
class ahb_transaction extends uvmf_transaction_base;

  `uvm_object_utils( ahb_transaction )

  rand ahb_op_t op ;
  rand bit [15:0] data ;
  rand bit [31:0] addr ;

```

From the the sequence item point of view, you want to randomize  
(a) is it a READ or a WRITE operation : this is ‘op’ in the above example  
(b) the data  
(c) the address

If doing a read, then the ‘data’ field will get populated with the actual read data that your agent monitor detects.

This AHB example is part of the UVM Framework base examples.  
You can download the UVM Framework (inclusing this example) from the Verification Academy site.  
Look inside this directory to find the agent source code (including the interface and the transaction class)  
UVMF\_2022.3\base\_examples\verification\_ip\interface\_packages\ahb\_pkg\src

---

_[View the full topic](https://verificationacademy.com/forums/t/uvm-sequence-item/41331)._
