// Function: get_transaction_id
//
// Returns this transaction's numeric identifier, which is -1 if not set
// explicitly by ~set_transaction_id~.
//
// When using a <uvm_sequence #(REQ,RSP)> to generate stimulus, the transaction
// ID is used along with the sequence ID to route responses in sequencers and to correlate
// responses to requests.
extern function integer get_transaction_id();
// set_transaction_id
function void uvm_transaction::set_transaction_id(integer id);
m_transaction_id = id;
endfunction
// get_transaction_id
function integer uvm_transaction::get_transaction_id();
return (m_transaction_id);
endfunction
// new
function uvm_transaction::new (string name="", uvm_component initiator = null);
super.new(name);
this.initiator = initiator;
m_transaction_id = -1;
begin_event = events.get("begin");
end_event = events.get("end");
endfunction // uvm_transaction