In reply to idrees96:
Here’s an example for a AHB agent
This is the interface
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
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