Miscellaneous updates
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
// ----------------------------------------------------------------------
|
||||
class axi_transaction extends uvm_sequence_item;
|
||||
// Declare AXI transaction fields
|
||||
rand axi_transaction_type_t txn_type; // Transaction type (read/write)
|
||||
rand bit [`ADDR_WIDTH-1:0] addr; // Address
|
||||
rand bit [`DATA_WIDTH-1:0] data; // Data
|
||||
rand bit [`DATA_WIDTH_DIV_8-1:0] strb; // Byte enable
|
||||
rand axi_transaction_type_t txn_type; // Transaction type (read/write)
|
||||
rand bit [`ADDR_WIDTH-1:0] addr; // Address
|
||||
rand bit [`DATA_WIDTH-1:0] data; // Data
|
||||
rand bit [`DATA_WIDTH_DIV_8-1:0] strb; // Byte enable
|
||||
rand bit [2:0] size; // Size
|
||||
rand bit [7:0] length; // Length
|
||||
|
||||
`uvm_object_utils_begin(axi_transaction)
|
||||
`uvm_field_enum(axi_transaction_type_t, txn_type, UVM_DEFAULT)
|
||||
`uvm_field_int(addr, UVM_DEFAULT)
|
||||
`uvm_field_int(data, UVM_DEFAULT)
|
||||
`uvm_field_int(strb, UVM_DEFAULT)
|
||||
`uvm_field_int(size, UVM_DEFAULT)
|
||||
`uvm_field_int(length, UVM_DEFAULT)
|
||||
`uvm_object_utils_end
|
||||
|
||||
// Constructor
|
||||
@@ -18,6 +22,34 @@ class axi_transaction extends uvm_sequence_item;
|
||||
super.new(name);
|
||||
endfunction
|
||||
|
||||
// Get transaction id - made up of sequence ID and trasacton ID
|
||||
function axi_transaction_id_t get_tid();
|
||||
axi_transaction_id_t tid;
|
||||
|
||||
tid.seq_id = this.get_sequence_id();
|
||||
tid.txn_id = this.get_transaction_id();
|
||||
|
||||
return tid;
|
||||
endfunction
|
||||
|
||||
// Show transaction id - sequence ID:trasacton ID
|
||||
function string show_tid();
|
||||
return $sformatf("%0h:%0h", this.get_sequence_id(), this.get_transaction_id());
|
||||
endfunction
|
||||
|
||||
// Show transaction tag - Transaction type:sequence ID:trasacton ID
|
||||
function string show_tag();
|
||||
return $sformatf("%s:%0h:%0h", this.txn_type.name(), this.get_sequence_id(), this.get_transaction_id());
|
||||
endfunction
|
||||
|
||||
// Wait for transaction to be done
|
||||
task wait_for_done();
|
||||
uvm_event finished_event;
|
||||
|
||||
finished_event = get_event_pool().get("finished");
|
||||
finished_event.wait_on();
|
||||
endtask
|
||||
|
||||
// Copy method for cloning
|
||||
virtual function uvm_object clone();
|
||||
axi_transaction copy;
|
||||
@@ -26,6 +58,8 @@ class axi_transaction extends uvm_sequence_item;
|
||||
copy.addr = this.addr;
|
||||
copy.data = this.data;
|
||||
copy.strb = this.strb;
|
||||
copy.size = this.size;
|
||||
copy.length = this.length;
|
||||
return copy;
|
||||
endfunction
|
||||
|
||||
@@ -36,7 +70,9 @@ class axi_transaction extends uvm_sequence_item;
|
||||
return (this.txn_type == other.txn_type) &&
|
||||
(this.addr == other.addr) &&
|
||||
(this.data == other.data) &&
|
||||
(this.strb == other.strb);
|
||||
(this.strb == other.strb) &&
|
||||
(this.size == other.size) &&
|
||||
(this.length == other.length);
|
||||
endfunction
|
||||
|
||||
endclass : axi_transaction
|
||||
|
||||
Reference in New Issue
Block a user