What is the difference between ovm_transaction and ovm_sequence_item?

In reply to mpattaje:

Hello Sir,

Thank you for your reply.

My question is Can I use ovm_transaction as properties in Ovm_sequence_item??
Is the below code correct??

class write_waddr_phase extends ovm_transaction;
     rand [3:0] awid ;
     rand [31:0] waddr; 
     rand [31:0] wlen; 
     rand [31:0] wlsize;
    //added contraints
    //factory registration
 endclass

  class write_wdata_phase extends ovm_transaction;
       rand [31:0] data;
       rand [31:0] strb;
       rand [31:0] wlen;
       //added contraints
       //factory registration
   endclass

class write_wresp_phase extends ovm_transaction;
        rand [3:0] bid;
 endclass

 class read_raddr_phase extends ovm_transaction;
     rand [3:0] arid ;
     rand [31:0] raddr; 
     rand [31:0] rlen; 
     rand [31:0] rsize;
    //added contraints
    //factory registration
 endclass

  class read_rdata_phase extends ovm_transaction;
       rand [31:0] rdata;
       rand [3:0] rid ;
       //added contraints
       //factory registration
   endclass


  //building the ovm_sequence_ITEM

   class basic_transfer extends ovm_sequence_item;
     write_waddr_phase  wap;
     write_wdata_phase  wdp;
     write_wresp_phase  wrp;
     read_raddr_phase   rap;
     read_rdata_phase   rdp; 
  
 `ovm_component_utils_begin(basic_transfer)
    `ovm_field_object ( wap ,OVM_ALL_ON)
    `ovm_field_object ( wdp ,OVM_ALL_ON)
    `ovm_field_object ( wresp ,OVM_ALL_ON) 
    `ovm_field_object ( rap ,OVM_ALL_ON)
    `ovm_field_object ( rdp ,OVM_ALL_ON)
   `ovm_component_utils_end
endclass

    class my_sequence extends ovm_sequence#(basic_transfer);
     //fac reg
     
     virtual task body();
      `ovm_do_with(req,{wap.waddr=8'h 0000_0000;wlen=2;})
      `ovm_do_with(req,{wap.wdata=8'h AAAAA_0000;wstrb=1001})
       ...
       ...
      endtask
     endclass

Now i want to set ID tag for each transaction with in a sequence and as well as for each each sequence.
where can i use set_transaction_id method to set the id tag for each each transaction class.

how can i make it ?

#####################################################################################

Murali Hanumanth